[cig-commits] commit: Just some super hacks... don't really have enough

Mercurial hg at geodynamics.org
Mon Nov 24 11:31:07 PST 2008


changeset:   110:651d58bf14dd
user:        LukeHodkinson
date:        Tue Aug 26 02:27:15 2008 +0000
files:       MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/MaterialPointsSwarm.h
description:
Just some super hacks... don't really have enough
time to implement this the right way, so will have
to come back and fix it later.  I needed a way to
convert frictional material into real material if
it drifts across the frictional boundary layer.


diff -r d05d9c214e66 -r 651d58bf14dd MaterialPoints/src/MaterialPointsSwarm.c
--- a/MaterialPoints/src/MaterialPointsSwarm.c	Thu Aug 21 06:28:38 2008 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.c	Tue Aug 26 02:27:15 2008 +0000
@@ -296,6 +296,8 @@ void _MaterialPointsSwarm_Construct( voi
 			escapedRoutine,
 			material,
 			materials_Register );
+
+	self->geomodHack = Dictionary_GetBool_WithDefault( cf->rootDict, "geomodHacks", False );
 }
 
 void _MaterialPointsSwarm_Build( void* swarm, void* data ) {
@@ -405,9 +407,38 @@ void _MaterialPointsSwarm_UpdateHook( vo
 				materialPoint->coord[ I_AXIS ],
 				materialPoint->coord[ J_AXIS ],
 				materialPoint->coord[ K_AXIS ] );
+
+                        /* Super hack. For the geomod benchmarks we need to convert frictional
+                           materials into regular materials as they cross the frictional boundaries. */
+                        if( self->geomodHack ) {
+                           Material* material;
+                           FeMesh* mesh;
+                           Grid* grid;
+                           int inds[3];
+
+                           mesh = (FeMesh*)((ElementCellLayout*)self->cellLayout)->mesh;
+                           grid = *Mesh_GetExtension( mesh, Grid**, "elementGrid" );
+                           material = MaterialPointsSwarm_GetMaterialOn( self, materialPoint );
+                           if( !strcmp( material->name, "quartzFriction" ) ) {
+                              Grid_Lift( grid, cell, inds );
+                              if( inds[0] > 1 && inds[0] < grid->sizes[0] - 2 &&
+                                  inds[1] > 1 && inds[1] < grid->sizes[1] - 2 )
+                              {
+                                 materialPoint->materialIndex = Materials_Register_GetIndex( self->materials_Register, "quartz" );
+                              }
+                           }
+                           else if( !strcmp( material->name, "corundumFriction" ) ) {
+                              Grid_Lift( grid, cell, inds );
+                              if( inds[0] > 1 && inds[0] < grid->sizes[0] - 2 &&
+                                  inds[1] > 1 && inds[1] < grid->sizes[1] - 2 )
+                              {
+                                 materialPoint->materialIndex = Materials_Register_GetIndex( self->materials_Register, "corundum" );
+                              }
+                           }
+                        }
 		}
 	}
-	
+
 }
 
 void MaterialPointsSwarm_SetMaterialAt( void* swarm, Index point_I, Index materialIndex ) {
diff -r d05d9c214e66 -r 651d58bf14dd MaterialPoints/src/MaterialPointsSwarm.h
--- a/MaterialPoints/src/MaterialPointsSwarm.h	Thu Aug 21 06:28:38 2008 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.h	Tue Aug 26 02:27:15 2008 +0000
@@ -70,7 +70,8 @@
 		Material*                             material;             /**< For material assignment */ \
 		Materials_Register*                   materials_Register;   \
 		SwarmVariable*                        particleCoordVariable; /** Set only if a global coord system swarm. */ \
-		SwarmVariable*                        materialIndexVariable; 
+		SwarmVariable*                        materialIndexVariable; \
+                Bool                                  geomodHack;
 
 	struct MaterialPointsSwarm { __MaterialPointsSwarm };
 	



More information about the CIG-COMMITS mailing list