1. Matthew Turk
  2. enzo-dengo

Commits

Sam Skillman  committed c41948d

Adding ability to use WritePotential in TestGravitySphere.

  • Participants
  • Parent commits 2e471ad
  • Branches week-of-code

Comments (0)

Files changed (2)

File src/enzo/Grid_TestGravitySphereInitializeGrid.C

View file
       FieldType[NumberOfBaryonFields++] = Velocity2;
     if (GridRank > 2)
       FieldType[NumberOfBaryonFields++] = Velocity3;
+
+    if (WritePotential)
+      FieldType[NumberOfBaryonFields++] = GravPotential;
+
   }
  
   /* Return if this doesn't concern us. */

File src/enzo/TestGravitySphereInitialize.C

View file
   char *Vel1Name = "x-velocity";
   char *Vel2Name = "y-velocity";
   char *Vel3Name = "z-velocity";
+  char *GPotName  = "Grav_Potential";
  
   /* declarations */
  
   DataLabel[count++] = Vel2Name;
   DataLabel[count++] = Vel3Name;
  
-  DataUnits[0] = NULL;
-  DataUnits[1] = NULL;
-  DataUnits[2] = NULL;
-  DataUnits[3] = NULL;
-  DataUnits[4] = NULL;
-  DataUnits[5] = NULL;
- 
+  if (WritePotential){
+    DataLabel[count++] = GPotName;
+  }
+
+  for (int j = 0; j<count; j++){
+    DataUnits[j] = NULL;
+  }
+
   /* Write parameters to parameter output file */
  
   if (MyProcessorNumber == ROOT_PROCESSOR) {