[cig-commits] commit: Fixes for NearestNeighbor mapper

Mercurial hg at geodynamics.org
Mon Oct 24 19:48:11 PDT 2011


changeset:   900:83478e3b0624
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Mon Oct 24 19:46:35 2011 -0700
files:       Rheology/src/Compressible.cxx Utils/src/RecoveredFeVariable.cxx
description:
Fixes for NearestNeighbor mapper


diff -r cf8c6a5e7d07 -r 83478e3b0624 Rheology/src/Compressible.cxx
--- a/Rheology/src/Compressible.cxx	Sun Oct 23 19:26:43 2011 -0700
+++ b/Rheology/src/Compressible.cxx	Mon Oct 24 19:46:35 2011 -0700
@@ -203,7 +203,6 @@ void _Compressible_AssembleElement(
 	double                    factor;
 	FeMesh*  		  geometryMesh        = self->geometryMesh;
 	ElementType*              geometryElementType;
-	Particle_Index            lParticle_I;
 	double oneOnLambda = 0.0;
 	Bool oneToMany;
 
@@ -226,7 +225,6 @@ void _Compressible_AssembleElement(
 	/* Loop over points to build Stiffness Matrix */
 	for ( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
 		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
-		lParticle_I = swarm->cellParticleTbl[cell_I][cParticle_I];
 
 		if(oneToMany) {
 		    /*
@@ -254,14 +252,18 @@ void _Compressible_AssembleElement(
 		    oneOnLambda /= ((double)ref->numParticles);
 		}
 		else {
+                  IntegrationPointsSwarm* NNswarm(swarm);
+                  IntegrationPoint* NNparticle(particle);
+                  NearestNeighbor_Replace(&NNswarm,&NNparticle,lElement_I,dim);
 
-		    material = (RheologyMaterial*) IntegrationPointsSwarm_GetMaterialAt( swarm, lParticle_I );
+                  material = (RheologyMaterial*)
+                    IntegrationPointsSwarm_GetMaterialOn( swarm, NNparticle );
 
-		    /* Only make contribution to the compressibility matrix if this material is compressible */
-		    if ( !material->compressible ) 
-			continue;
+                  /* Only make contribution to the compressibility matrix if this material is compressible */
+                  if ( !material->compressible ) 
+                    continue;
 
-		    oneOnLambda = material->compressible->oneOnLambda;
+                  oneOnLambda = material->compressible->oneOnLambda;
 		}
 
 		/* Calculate Determinant of Jacobian and Shape Functions */
diff -r cf8c6a5e7d07 -r 83478e3b0624 Utils/src/RecoveredFeVariable.cxx
--- a/Utils/src/RecoveredFeVariable.cxx	Sun Oct 23 19:26:43 2011 -0700
+++ b/Utils/src/RecoveredFeVariable.cxx	Mon Oct 24 19:46:35 2011 -0700
@@ -261,8 +261,12 @@ void _RecoveredFeVariable_AssembleAtPart
    double**             Fi_Mat )
 {
 	SymmetricTensor p_StrainRate, p_Stress, theCopy;
-   RheologyMaterial* material = (RheologyMaterial*) IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*)constitutiveMatrix->integrationSwarm, particle );
 	int dim  = self->dim;
+
+        IntegrationPointsSwarm* NNswarm((IntegrationPointsSwarm*)constitutiveMatrix->integrationSwarm);
+        IntegrationPoint* NNparticle(particle);
+        NearestNeighbor_Replace(&NNswarm,&NNparticle,lElement_I,dim);
+        RheologyMaterial* material = (RheologyMaterial*) IntegrationPointsSwarm_GetMaterialOn(NNswarm, NNparticle);
 	int dofThatExist = self->fieldComponentCount;
 	int order = self->orderOfInterpolation;
 	int dof_I;



More information about the CIG-COMMITS mailing list