[cig-commits] commit: geeting rid of a redundant call to construct the integration points swarm

Mercurial hg at geodynamics.org
Mon Nov 24 11:30:36 PST 2008


changeset:   47:1617f7985e00
user:        DavidLee
date:        Thu Oct 11 05:10:52 2007 +0000
files:       MaterialPoints/src/SwarmVariableField.c
description:
geeting rid of a redundant call to construct the integration points swarm


diff -r 79a8ea36ccee -r 1617f7985e00 MaterialPoints/src/SwarmVariableField.c
--- a/MaterialPoints/src/SwarmVariableField.c	Thu Oct 11 04:56:29 2007 +0000
+++ b/MaterialPoints/src/SwarmVariableField.c	Thu Oct 11 05:10:52 2007 +0000
@@ -55,6 +55,7 @@
 #include "SwarmVariableField.h"
 #include "IntegrationPointsSwarm.h"
 #include "MaterialPointsSwarm.h"
+#include "IntegrationPointMapper.h"
 
 #include <assert.h>
 #include <string.h>
@@ -178,7 +179,7 @@ void _SwarmVariableField_Construct( void
 
 	self->materialSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "MaterialSwarm", MaterialPointsSwarm, True, data );
 
-	integrationSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "IntegrationSwarm", IntegrationPointsSwarm, True, NULL );
+	integrationSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Swarm", IntegrationPointsSwarm, True, NULL );
 	assert( integrationSwarm );
 
 	/* dunno if this is the right way about getting the context... */
@@ -222,7 +223,6 @@ void _SwarmVariableField_Build( void* sw
 	
 	self->eqNum->dofLayout = self->dofLayout;
 
-
 	_ParticleFeVariable_Build( self, data );
 	/* TODO: build self->swarmVar */
 	// TODO: granb self->SwarmVariableName out of the swarm vart register, save reference as self->swarmVar
@@ -272,17 +272,27 @@ void _SwarmVariableField_ValueAtParticle
 	Particle_InCellIndex	cParticle_I;
 	Particle_Index		lParticle_I;
 
-	matParticle = OneToOneMapper_GetMaterialPoint( swarm->mapper, particle, self->materialSwarm );
-	cell_I		= CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
+	//matParticle 	= OneToOneMapper_GetMaterialPoint( swarm->mapper, particle, self->materialSwarm );
+	//cell_I 		= CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
 
 	/* is the cell index required here local or global?? dave, 04.10.07 */
-	cParticle_I = Swarm_FindClosestParticleInCell( self->materialSwarm, 
-						       cell_I, 
-						       Mesh_GetDimSize( self->dofLayout->mesh ), 
-						       matParticle->coord, 
+	//cParticle_I = Swarm_FindClosestParticleInCell( self->materialSwarm, 
+	//					       cell_I, 
+	//					       Mesh_GetDimSize( self->dofLayout->mesh ), 
+	//					       matParticle->coord, 
+	//					       &distance );
+
+	//lParticle_I = self->materialSwarm->cellParticleTbl[cell_I][cParticle_I];
+
+	cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
+	cParticle_I = Swarm_FindClosestParticleInCell( swarm,
+		       				       cell_I,
+						       Mesh_GetDimSize( self->dofLayout->mesh ),
+						       particle->xi,
 						       &distance );
-
-	lParticle_I = self->materialSwarm->cellParticleTbl[cell_I][cParticle_I];
+	lParticle_I = IntegrationPointMapper_GetMaterialIndexAt( swarm->mapper, swarm->cellParticleTbl[cell_I][lParticle_I] );
+	
+	
 	// TODO SwarmVariable_ValueAt( self->swarmVariable, lParticle_I )
 	// TODO return / copy value
 	SwarmVariable_ValueAt( self->swarmVar, lParticle_I, value ); /* does the copy inside this func. dave, 18.09.07 */



More information about the CIG-COMMITS mailing list