Commits

Matthew Turk  committed b5d8445

Switching particles to use particle_* fields.

  • Participants
  • Parent commits b08eb16

Comments (0)

Files changed (3)

File src/enzo/grid/utilities/Grid_WriteGrid.C

   //if(WriteEverything==TRUE)CopyOnlyActive = FALSE;
  
   char *ParticlePositionLabel[] =
-     {"position_x", "position_y", "position_z"};
+     {"particle_position_x", "particle_position_y", "particle_position_z"};
   char *ParticleVelocityLabel[] =
-     {"velocity_x", "velocity_y", "velocity_z"};
-  char *OldParticlePositionLabel[] =
-     {"particle_position_x", "particle_position_y", "particle_position_z"};
-  char *OldParticleVelocityLabel[] =
      {"particle_velocity_x", "particle_velocity_y", "particle_velocity_z"};
   char *SmoothedDMLabel[] = {"Dark_Matter_Density", "Velocity_Dispersion",
 			     "Particle_x-velocity", "Particle_y-velocity",
       this->write_dataset(1, TempIntArray, ParticlePositionLabel[dim],
           dm_group_id, HDF5_FILE_PREC, (VOIDP) ParticlePosition[dim], FALSE);
       H5Lcreate_hard(dm_group_id, ParticlePositionLabel[dim], 
-                     group_id, OldParticlePositionLabel[dim],
+                     group_id, ParticlePositionLabel[dim],
                      H5P_DEFAULT, H5P_DEFAULT);
     }
 
       this->write_dataset(1, TempIntArray, ParticleVelocityLabel[dim],
           dm_group_id, HDF5_REAL, (VOIDP) ParticleVelocity[dim], FALSE);
       H5Lcreate_hard(dm_group_id, ParticleVelocityLabel[dim], 
-                     group_id, OldParticleVelocityLabel[dim],
+                     group_id, ParticleVelocityLabel[dim],
                      H5P_DEFAULT, H5P_DEFAULT);
     }
 
     /* Copy mass to temp and write it. */
 
-    this->write_dataset(1, TempIntArray, "mass",
+    this->write_dataset(1, TempIntArray, "particle_mass",
         dm_group_id, HDF5_REAL, (VOIDP) ParticleMass, FALSE);
-    H5Lcreate_hard(dm_group_id, "mass",
+    H5Lcreate_hard(dm_group_id, "particle_mass",
                    group_id, "particle_mass",
                    H5P_DEFAULT, H5P_DEFAULT);
 

File src/enzo/particles/active_particles/ActiveParticle.C

 
     /* Can be handled manually */
    
-    handlers.push_back(new ArrayHandler<ap, FLOAT, 3, &ap::pos>("position_x", 0));
-    handlers.push_back(new ArrayHandler<ap, FLOAT, 3, &ap::pos>("position_y", 1));
-    handlers.push_back(new ArrayHandler<ap, FLOAT, 3, &ap::pos>("position_z", 2));
+    handlers.push_back(new ArrayHandler<ap, FLOAT, 3, &ap::pos>("particle_position_x", 0));
+    handlers.push_back(new ArrayHandler<ap, FLOAT, 3, &ap::pos>("particle_position_y", 1));
+    handlers.push_back(new ArrayHandler<ap, FLOAT, 3, &ap::pos>("particle_position_z", 2));
 
-    handlers.push_back(new ArrayHandler<ap, float, 3, &ap::vel>("velocity_x", 0));
-    handlers.push_back(new ArrayHandler<ap, float, 3, &ap::vel>("velocity_y", 1));
-    handlers.push_back(new ArrayHandler<ap, float, 3, &ap::vel>("velocity_z", 2));
+    handlers.push_back(new ArrayHandler<ap, float, 3, &ap::vel>("particle_velocity_x", 0));
+    handlers.push_back(new ArrayHandler<ap, float, 3, &ap::vel>("particle_velocity_y", 1));
+    handlers.push_back(new ArrayHandler<ap, float, 3, &ap::vel>("particle_velocity_z", 2));
 
-    handlers.push_back(new Handler<ap, double, &ap::Mass>("mass"));
+    handlers.push_back(new Handler<ap, double, &ap::Mass>("particle_mass"));
     handlers.push_back(new Handler<ap, float, &ap::BirthTime>("creation_time"));
     handlers.push_back(new Handler<ap, float, &ap::DynamicalTime>("dynamical_time"));
     handlers.push_back(new Handler<ap, float, &ap::Metallicity>("metallicity"));

File src/enzo/particles/active_particles/ActiveParticle_GMCParticle.C

   writeScalarAttribute(AccretingParticleGroupID,HDF5_INT,"Number of GMC Particles",&n);  
 
   char *ParticlePositionLabel[] =
-     {"position_x", "position_y", "position_z"};
+     {"particle_position_x", "particle_position_y", "particle_position_z"};
   char *ParticleVelocityLabel[] =
-     {"velocity_x", "velocity_y", "velocity_z"};
+     {"particle_velocity_x", "particle_velocity_y", "particle_velocity_z"};
 
   /* Create temporary buffers to store particle data */
 
 		  AccretingParticleGroupID, HDF5_REAL, (VOIDP) Velocity[dim]);
   }
   
-  WriteDataset(1,&TempInt,"mass",AccretingParticleGroupID,HDF5_REAL,(VOIDP) Mass);
+  WriteDataset(1,&TempInt,"particle_mass",AccretingParticleGroupID,HDF5_REAL,(VOIDP) Mass);
   WriteDataset(1,&TempInt,"creation_time",AccretingParticleGroupID,HDF5_REAL,(VOIDP) BirthTime);
   WriteDataset(1,&TempInt,"dynamical_time",AccretingParticleGroupID,HDF5_REAL,(VOIDP) DynamicalTime);
   WriteDataset(1,&TempInt,"metallicity_fraction",AccretingParticleGroupID,HDF5_REAL,(VOIDP) Metallicity);
   particles_to_read = new ActiveParticleType*[n]();
 
   char *ParticlePositionLabel[] =
-     {"position_x", "position_y", "position_z"};
+     {"particle_position_x", "particle_position_y", "particle_position_z"};
   char *ParticleVelocityLabel[] =
-     {"velocity_x", "velocity_y", "velocity_z"};
+     {"particle_velocity_x", "particle_velocity_y", "particle_velocity_z"};
 
   FLOAT *Position[MAX_DIMENSION];
   float *Velocity[MAX_DIMENSION];
     ReadDataset(1,&TempInt,ParticleVelocityLabel[dim],
 		  AccretingParticleGroupID, HDF5_REAL, (VOIDP) Velocity[dim]);
   }
-  ReadDataset(1,&TempInt,"mass",AccretingParticleGroupID,HDF5_R8,(VOIDP) Mass);
+  ReadDataset(1,&TempInt,"particle_mass",AccretingParticleGroupID,HDF5_R8,(VOIDP) Mass);
   ReadDataset(1,&TempInt,"creation_time",AccretingParticleGroupID,HDF5_REAL,(VOIDP) BirthTime);
   ReadDataset(1,&TempInt,"dynamical_time",AccretingParticleGroupID,HDF5_REAL,(VOIDP) DynamicalTime);
   ReadDataset(1,&TempInt,"metallicity_fraction",AccretingParticleGroupID,HDF5_REAL,(VOIDP) Metallicity);