[cig-commits] r14290 - long/3D/SNAC/trunk/Snac/plugins/remesher

echoi at geodynamics.org echoi at geodynamics.org
Tue Mar 10 16:11:49 PDT 2009


Author: echoi
Date: 2009-03-10 16:11:49 -0700 (Tue, 10 Mar 2009)
New Revision: 14290

Modified:
   long/3D/SNAC/trunk/Snac/plugins/remesher/Remesh.c
   long/3D/SNAC/trunk/Snac/plugins/remesher/RemeshElements.c
Log:
* The Nearest Neghibor Transfer (NNT) between tets now works but the remeshing is not perfect yet:

	1. Explicitly update the element-level variables rather than simply copy them after an NNT (Remesh.c).

	2. Find a way to let other plugins know that the remesh plugin is being loaded. The current way of searching the list of plugins is sensitive to the order of plugins specified in an input file. For instance, for plastic strain to be remapped through NNT, "SnacRemesher" is required to be listed before SnacPlastic.



Modified: long/3D/SNAC/trunk/Snac/plugins/remesher/Remesh.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/remesher/Remesh.c	2009-03-10 22:24:14 UTC (rev 14289)
+++ long/3D/SNAC/trunk/Snac/plugins/remesher/Remesh.c	2009-03-10 23:11:49 UTC (rev 14290)
@@ -143,6 +143,11 @@
 		
 		/* Interpolate current elemental values onto new coordinates. */
 		meshExt->newElements = (Snac_Element*)ExtensionManager_Malloc( mesh->elementExtensionMgr, mesh->elementLocalCount );
+
+		/* Store element-level variables. This is temporary. They sould be updated after the nearest neighbor transfer is done on the tet level. */
+ 		memcpy( meshExt->newElements, mesh->element, mesh->elementExtensionMgr->finalSize * mesh->elementLocalCount );
+
+		/* Do the nearest neighbor transfer between tets. */
 		_SnacRemesher_InterpolateElements( context );
 		
 

Modified: long/3D/SNAC/trunk/Snac/plugins/remesher/RemeshElements.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/remesher/RemeshElements.c	2009-03-10 22:24:14 UTC (rev 14289)
+++ long/3D/SNAC/trunk/Snac/plugins/remesher/RemeshElements.c	2009-03-10 23:11:49 UTC (rev 14290)
@@ -455,24 +455,9 @@
 								     dstEltInd );
 	Snac_Element*	srcElt = Snac_Element_At( context, srcEltInd );
 
-	memcpy( dstElt, srcElt, 
-		ExtensionManager_GetFinalSize( mesh->elementExtensionMgr ) );
+	/* Copy the whole structure from the nearest tet in the old mesh. */
+	memcpy( &(dstElt->tetra[dstTetInd]), &(srcElt->tetra[srcTetInd]), sizeof(Snac_Element_Tetrahedra) );
 
-#if 0
-	dstElt->tetra[srcTetInd].strain[0][0] = srcElt->tetra[srcTetInd].strain[0][0];
-	dstElt->tetra[srcTetInd].strain[1][1] = srcElt->tetra[srcTetInd].strain[1][1];
-	dstElt->tetra[srcTetInd].strain[2][2] = srcElt->tetra[srcTetInd].strain[2][2];
-	dstElt->tetra[srcTetInd].strain[0][1] = srcElt->tetra[srcTetInd].strain[0][1];
-	dstElt->tetra[srcTetInd].strain[0][2] = srcElt->tetra[srcTetInd].strain[0][2];
-	dstElt->tetra[srcTetInd].strain[1][2] = srcElt->tetra[srcTetInd].strain[1][2];
-
-	dstElt->tetraStress[srcTetInd][0][0] = srcElt->tetraStress[srcTetInd][0][0];
-	dstElt->tetraStress[srcTetInd][1][1] = srcElt->tetraStress[srcTetInd][1][1];
-	dstElt->tetraStress[srcTetInd][2][2] = srcElt->tetraStress[srcTetInd][2][2];
-	dstElt->tetraStress[srcTetInd][0][1] = srcElt->tetraStress[srcTetInd][0][1];
-	dstElt->tetraStress[srcTetInd][0][2] = srcElt->tetraStress[srcTetInd][0][2];
-	dstElt->tetraStress[srcTetInd][1][2] = srcElt->tetraStress[srcTetInd][1][2];
-#endif
 }
 
 



More information about the CIG-COMMITS mailing list