[cig-commits] commit: Add a tolerance when checking whether a point is inside the mesh. Otherwise, with Q2 elements, the curvature can make it seem that points are outside the boundary when they are actually inside.

Mercurial hg at geodynamics.org
Thu Mar 15 16:39:36 PDT 2012


changeset:   644:b5ddaf8c1e65
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Thu Mar 15 16:39:24 2012 -0700
files:       Mesh/src/Mesh_Algorithms.cxx
description:
Add a tolerance when checking whether a point is inside the mesh.  Otherwise, with Q2 elements, the curvature can make it seem that points are outside the boundary when they are actually inside.


diff -r 2de8e7a4f1de -r b5ddaf8c1e65 Mesh/src/Mesh_Algorithms.cxx
--- a/Mesh/src/Mesh_Algorithms.cxx	Thu Mar 15 12:46:07 2012 -0700
+++ b/Mesh/src/Mesh_Algorithms.cxx	Thu Mar 15 16:39:24 2012 -0700
@@ -534,7 +534,7 @@ Bool Mesh_Algorithms_SearchWithFullIncid
 	unsigned		nEls;
 	unsigned		nearVert;
 	unsigned		nInc, *inc;
-	unsigned		e_i, d_i, inc_i;
+	unsigned		e_i, inc_i;
 
 	assert( self );
 	assert( self->mesh );
@@ -549,8 +549,9 @@ Bool Mesh_Algorithms_SearchWithFullIncid
 
 	/* If outside local range, immediately return false. */
 	Mesh_GetDomainCoordRange( mesh, minCrd, maxCrd );
-	for( d_i = 0; d_i < nDims; d_i++ ) {
-		if( point[d_i] < minCrd[d_i] || point[d_i] > maxCrd[d_i] )
+	for( unsigned d_i = 0; d_i < nDims; d_i++ ) {
+          if( point[d_i] < minCrd[d_i] - (maxCrd[d_i]-minCrd[d_i])*0.1
+              || point[d_i] > maxCrd[d_i] + (maxCrd[d_i]-minCrd[d_i])*0.1 )
 			return False;
 	}
 



More information about the CIG-COMMITS mailing list