[cig-commits] commit: Remove splitIntParticleByIndexOnCPU since it used uninitialized

Mercurial hg at geodynamics.org
Sun Oct 16 05:46:59 PDT 2011


changeset:   430:ca263445fe73
user:        Walter Landry <wlandry at caltech.edu>
date:        Sun Oct 16 05:42:05 2011 -0700
files:       Utils/src/PCDVC.cxx Utils/src/PCDVC.h
description:
Remove splitIntParticleByIndexOnCPU since it used uninitialized
variables and was not called by anyone.


diff -r 3e2a821deb08 -r ca263445fe73 Utils/src/PCDVC.cxx
--- a/Utils/src/PCDVC.cxx	Thu Sep 29 15:07:20 2011 -0700
+++ b/Utils/src/PCDVC.cxx	Sun Oct 16 05:42:05 2011 -0700
@@ -575,81 +575,6 @@ void splitIntParticleByIndexWithinCell( 
 	      
     /* Copy particle information */
     intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
-    memcpy( intNewParticle, intParticleToSplit, intSwarm->particleExtensionMgr->finalSize );
-    Swarm_AddParticleToCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU );
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intNewParticle); /* so we can set the reference to the material point */
-    ref->particle_I = matNewParticle_IndexOnCPU; /* now the ref for the new int particle points to the new material particle -- the swarm id should be correct because we memcpy'd from the original */
-
-    /* Now get the material point corresponding to the int point being split so that
-       we can copy the material properties to the newly created material particle */
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToSplit);
-    matParticleToSplit_IndexOnCPU = ref->particle_I;
-    matParticleToSplit  =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToSplit_IndexOnCPU );
-    memcpy( matNewParticle, matParticleToSplit, matSwarm->particleExtensionMgr->finalSize );
-    Swarm_AddParticleToCell( matSwarm, matNewParticle->owningCell, matNewParticle_IndexOnCPU );
-
-    /* Copy new local position to xi on new int particle */
-    memcpy( intNewParticle->xi, xi, sizeof(Coord) );
-	      
-    /* Get new Global Coordinates from the Local Coordinates */
-    FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
-
-    /* Copy new global position to coord on new mat particle */
-    memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
-	      
-    // intNewParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU);
-    /*
-      printf("\e[1;33m");
-      printf("Creating int particle number %d from cell %d local within cell particle num = %d\n\n", intNewParticle_IndexOnCPU ,lCell_I, intNewParticle_IndexWithinCell);
-      printf("matSwarm particle count is now : %d\n",matSwarm->cellParticleCountTbl[lCell_I]);
-      printf("intSwarm particle count is now : %d\n",intSwarm->cellParticleCountTbl[lCell_I]);
-      printf("Original Population was %d\n",nump-1);
-      printf("\e[0;32m");
-    */
-
-}
-void splitIntParticleByIndexOnCPU( IntegrationPointsSwarm*  intSwarm, MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi ) {
-    MaterialPointRef*       ref;
-    Particle_Index    intNewParticle_IndexOnCPU;/* the particle number within the swarm on the local CPU */
-    Particle_Index    matNewParticle_IndexOnCPU;
-    IntegrationPoint* intNewParticle;
-    MaterialPoint*    matNewParticle;
-    // Particle_Index    intNewParticle_IndexWithinCell;/* the number of the particle within the cell */
-    //Particle_Index    matNewParticle_IndexWithinCell;
-    IntegrationPoint* intParticleToSplit;
-    MaterialPoint*    matParticleToSplit;
-    Particle_Index    intParticleToSplit_IndexWithinCell;
-    //Particle_Index    matParticleToSplit_IndexWithinCell;
-    Particle_Index    matParticleToSplit_IndexOnCPU;
-//      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
-//      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
-    Coord                   newCoord;
-//      Coord                   xi;
-
-    Cell_LocalIndex lCell_I;
-
-    FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
-
-	      
-    //intParticleToSplit_IndexWithinCell = maxI;
-
-    /* Add a new particle to end the end of each swarm */
-    /* this calls Swarm_Realloc -- don't like reallocing every time we create a particle
-       need to do this differently */
-    intNewParticle     = (IntegrationPoint*) Swarm_CreateNewParticle( intSwarm, &intNewParticle_IndexOnCPU );
-    matNewParticle     = (MaterialPoint*) Swarm_CreateNewParticle( matSwarm, &matNewParticle_IndexOnCPU );
-	      
-
-
-    /* Copy particle information */
-    intParticleToSplit_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToSplit->owningCell, intParticleToSplit_IndexOnCPU);
-
-    intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
-
-
-    lCell_I = intParticleToSplit->owningCell;
-
-
     memcpy( intNewParticle, intParticleToSplit, intSwarm->particleExtensionMgr->finalSize );
     Swarm_AddParticleToCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU );
     ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intNewParticle); /* so we can set the reference to the material point */
diff -r 3e2a821deb08 -r ca263445fe73 Utils/src/PCDVC.h
--- a/Utils/src/PCDVC.h	Thu Sep 29 15:07:20 2011 -0700
+++ b/Utils/src/PCDVC.h	Sun Oct 16 05:42:05 2011 -0700
@@ -163,7 +163,6 @@ void splitIntParticleByIndexWithinCell( 
 void splitIntParticleByIndexWithinCell( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi );
 void deleteIntParticleByIndexWithinCell( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm,  Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexWithinCell );
 void deleteIntParticleByIndexOnCPU( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexWithinCell );
-void splitIntParticleByIndexOnCPU( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi );
 void _PCDVC_Calculate3D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I );
 void _PCDVC_Calculate2D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I );  
 void _PCDVC_Calculate( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ) ;



More information about the CIG-COMMITS mailing list