Commits

Nathan Goldbaum committed ee6dc29

Fixing the way active particle masses are deposited.

Comments (0)

Files changed (1)

src/enzo/grid/utilities/Grid_DepositParticlePositions.C

 	ActiveParticlePosition[dim] = new FLOAT[NumberOfActiveParticles];
       this->GetActiveParticlePosition(ActiveParticlePosition);
 
-      float ActiveParticleMassPointer[NumberOfActiveParticles];
-      for (i = NumberOfActiveParticles; i < NumberOfParticles+NumberOfActiveParticles; i++) {
+      float* ActiveParticleMassPointer = new float[NumberOfActiveParticles];
+      for (i = 0; i < NumberOfActiveParticles; i++) {
 	ActiveParticleMassPointer[i] = ActiveParticles[i]->ReturnMass()*MassFactor;
       }
 
       for (dim = 0; dim < GridRank; dim++)
 	delete [] ActiveParticlePosition[dim];
       delete [] ActiveParticlePosition;
+      delete [] ActiveParticleMassPointer;
     }
  
     /* Deposit particles. */