[cig-commits] r4937 - in long/3D/Gale/trunk/src/Underworld: . plugins/EulerDeform

walter at geodynamics.org walter at geodynamics.org
Wed Oct 11 13:54:23 PDT 2006


Author: walter
Date: 2006-10-11 13:54:23 -0700 (Wed, 11 Oct 2006)
New Revision: 4937

Modified:
   long/3D/Gale/trunk/src/Underworld/
   long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c
Log:
 r597 at earth:  boo | 2006-10-11 13:52:10 -0700
  r559 at earth (orig r336):  LukeHodkinson | 2006-09-26 19:59:54 -0700
  Fixing a minor surface remeshing bug.
  
 



Property changes on: long/3D/Gale/trunk/src/Underworld
___________________________________________________________________
Name: svk:merge
   - 9570c393-cf10-0410-b476-9a651db1e55a:/cig:596
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:335
   + 9570c393-cf10-0410-b476-9a651db1e55a:/cig:597
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:336

Modified: long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c	2006-10-11 20:54:20 UTC (rev 4936)
+++ long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c	2006-10-11 20:54:23 UTC (rev 4937)
@@ -301,6 +301,12 @@
 		/* Swap back coordinates and free memory. */
 		sys->remesher->mesh->nodeCoord = newCrds;
 		FreeArray( oldCrds );
+
+		/* Re-sync with new coordinates. */
+		Mesh_Sync( sys->mesh );
+		for( var_i = 0; var_i < sys->nFields; var_i++ ) {
+			FeVariable_SyncShadowValues( sys->fields[var_i] );
+		}
 	}
 }
 
@@ -415,7 +421,7 @@
 	modCrds[3][0] = crds[3][0]; modCrds[3][1] = crds[3][2]; modCrds[3][2] = 0.0;
 	modPnt[0] = pnt[0]; modPnt[1] = pnt[2]; modPnt[2] = 0.0;
 
-	if( _HexaEL_FindTriBarycenter( modCrds, modPnt, bc, inds ) ) {
+	if( _HexaEL_FindTriBarycenter( modCrds, modPnt, bc, inds, INCLUSIVE_UPPER_BOUNDARY, NULL, 0 ) ) {
 		*val = bc[0]*crds[inds[0]][1] + bc[1]*crds[inds[1]][1] + bc[2]*crds[inds[2]][1];
 		return True;
 	}
@@ -469,7 +475,7 @@
 	modCrds[3][0] = crds[3][0]; modCrds[3][1] = crds[3][1]; modCrds[3][2] = 0.0;
 	modPnt[0] = pnt[0]; modPnt[1] = pnt[1]; modPnt[2] = 0.0;
 
-	if( _HexaEL_FindTriBarycenter( modCrds, modPnt, bc, inds ) ) {
+	if( _HexaEL_FindTriBarycenter( modCrds, modPnt, bc, inds, INCLUSIVE_UPPER_BOUNDARY, NULL, 0 ) ) {
 		*val = bc[0]*crds[inds[0]][1] + bc[1]*crds[inds[1]][1] + bc[2]*crds[inds[2]][1];
 		return True;
 	}
@@ -581,10 +587,11 @@
 
 				/* Interpolate. */
 /*#ifndef NDEBUG
-				assert( _EulerDeform_LineInterp( (const Coord*)crds, newCrd, 2, 0, &mesh->nodeCoord[centerInd][0] ) );
+				assert( _EulerDeform_LineInterp( (const Coord*)crds, newCrd, 2, 0, 
+								 &mesh->nodeCoord[centerInd][0] ) );
 #else
 				_EulerDeform_LineInterp( (const Coord*)crds, newCrd, 2, 0, &mesh->nodeCoord[centerInd][0] );
-				#endif*/
+#endif*/
 				mesh->nodeCoord[centerInd][0] += (ijk[0] == 0) ? 1e-15 : -1e-15;
 				newCrd[0] = mesh->nodeCoord[centerInd][0];
 			}
@@ -604,10 +611,11 @@
 
 				/* Interpolate. */
 /*#ifndef NDEBUG
-				assert( _EulerDeform_LineInterp( (const Coord*)crds, newCrd, 0, 2, &mesh->nodeCoord[centerInd][2] ) );
+				assert( _EulerDeform_LineInterp( (const Coord*)crds, newCrd, 0, 2, 
+								 &mesh->nodeCoord[centerInd][2] ) );
 #else
 				_EulerDeform_LineInterp( (const Coord*)crds, newCrd, 0, 2, &mesh->nodeCoord[centerInd][2] );
-				#endif*/
+#endif*/
 				mesh->nodeCoord[centerInd][2] += (ijk[2] == 0) ? 1e-15 : -1e-15;
 				newCrd[2] = mesh->nodeCoord[centerInd][2];
 			}
@@ -617,19 +625,19 @@
 			if( ijk[0] > 0 && ijk[2] > 0 ) {
 				ijk[0]--; ijk[2]--; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]--; ijk[2]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
 
 				if( _EulerDeform_QuadYInterp( crds, newCrd, &mesh->nodeCoord[centerInd][1] ) ) {
 					mesh->nodeCoord[centerInd][1] -= 1e-15;
@@ -640,19 +648,19 @@
 			if( ijk[0] > 0 && ijk[2] < grm->nNodes[2] - 1 ) {
 				ijk[0]--; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]--; ijk[2]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
 
 				ijk[2]--;
 				if( _EulerDeform_QuadYInterp( crds, newCrd, &mesh->nodeCoord[centerInd][1] ) ) {
@@ -664,19 +672,19 @@
 			if( ijk[0] < grm->nNodes[0] - 1 && ijk[2] > 0 ) {
 				ijk[2]--; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]--; ijk[2]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]--;
 				if( _EulerDeform_QuadYInterp( crds, newCrd, &mesh->nodeCoord[centerInd][1] ) ) {
@@ -688,19 +696,19 @@
 			if( ijk[0] < grm->nNodes[0] - 1 && ijk[2] < grm->nNodes[2] - 1 ) {
 				GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[1], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[0], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]--; ijk[2]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]++; GRM_Project( grm, ijk, &ind );
 				ind = Mesh_NodeMapGlobalToDomain( mesh, ind );
-				memcpy( crds[3], oldCrds[ind], sizeof(Coord) );
+				memcpy( crds[2], oldCrds[ind], sizeof(Coord) );
 
 				ijk[0]--; ijk[2]--;
 				if( _EulerDeform_QuadYInterp( crds, newCrd, &mesh->nodeCoord[centerInd][1] ) ) {



More information about the cig-commits mailing list