[cig-commits] r22709 - long/3D/SNAC/trunk/Snac/plugins/remesher_BI

echoi at geodynamics.org echoi at geodynamics.org
Wed Aug 7 22:32:27 PDT 2013


Author: echoi
Date: 2013-08-07 22:32:26 -0700 (Wed, 07 Aug 2013)
New Revision: 22709

Modified:
   long/3D/SNAC/trunk/Snac/plugins/remesher_BI/RemeshElements.c
Log:
Negative value of a coefficient for barycentric coordinates can lead to tiny negative value of a variable that needs to be strictly positive.
-- As a solution, absolute values smaller than a tolerance is set to be zero.



Modified: long/3D/SNAC/trunk/Snac/plugins/remesher_BI/RemeshElements.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/remesher_BI/RemeshElements.c	2013-08-07 10:49:55 UTC (rev 22708)
+++ long/3D/SNAC/trunk/Snac/plugins/remesher_BI/RemeshElements.c	2013-08-08 05:32:26 UTC (rev 22709)
@@ -680,7 +680,7 @@
 								for(tet_I=0;tet_I<5;tet_I++) {
 									Index	coef_I;
 									double 	lambda[4];
-									double 	tol_error = 1e-4;
+									double 	tol_error = 1e-6;
 									
 									lambda[3] = 1.0;
 									for(coef_I=0;coef_I<3;coef_I++) {
@@ -691,7 +691,9 @@
 											meshExt->barcoef[element_dI].coef[tet_I][coef_I][3];
 										lambda[3] -= lambda[coef_I];
 									}
-
+									for(coef_I=0;coef_I<4;coef_I++) {
+										if( fabs(lambda[coef_I]) < tol_error ) lambda[coef_I] = 0.0;
+									}
 									/* Keep track of closest element in case the current new barycenter is outside of the old grid. */
 									lambda_sqrd = 0.0;
 									for(coef_I=0;coef_I<4;coef_I++) 



More information about the CIG-COMMITS mailing list