Daniel Reynolds avatar Daniel Reynolds committed 32dc498

Updated Grid_SolveDengo.C with minor modifications

Comments (0)

Files changed (1)

src/enzo/Grid_SolveDengo.C

 
   this->DebugCheck("SolveDengo");
 
-  // declarations
-  int IENum;
-  FLOAT a = 1.0, dadt;
-    
-  // find internal energy density field
-  if ((GENum = FindField(InternalEnergy, FieldType, NumberOfBaryonFields)) < 0)
-    ENZO_FAIL("Could not find internal energy field.\n");
-
   // find photo-ionization fields
   int kphHINum, kphHeINum, kphHeIINum, kdissH2INum;
   int gammaNum;
     size *= GridDimension[dim];
 
   // get units 
-  float TemperatureUnits = 1.0, DensityUnits = 1.0, LengthUnits = 1.0, 
-    VelocityUnits = 1.0, TimeUnits = 1.0, aUnits = 1.0;
+  FLOAT a=1.0, dadt;
+  float TemperatureUnits=1.0, DensityUnits=1.0, LengthUnits=1.0, 
+    VelocityUnits=1.0, TimeUnits=1.0, aUnits=1.0;
   if (ComovingCoordinates) {
     if (CosmologyComputeExpansionFactor(Time+0.5*dtFixed, &a, &dadt) == FAIL)
       ENZO_FAIL("Error in CosmologyComputeExpansionFactors.");
   // rescale all relevant fields to CGS
   //    internal energy
   float rscale = LengthUnits*LengthUnits/TimeUnits/TimeUnits;
-  for (i=0; i<size; i++)  BaryonField[IENum][i] *= rscale;
+  for (i=0; i<size; i++)  BaryonField[DengoData.Field[0]][i] *= rscale;
   
   //    remaining fields (all density-like)
   int ifield;
   //    remaining fields (all density-like)
   int ifield;
   rscale = DensityUnits;
-  for (ifield=0; ifield<DengoData.NumberOfFields; ifield++) {
+  for (ifield=1; ifield<DengoData.NumberOfFields; ifield++) {
     for (i=0; i<size; i++) 
-      BaryonField[DengoData.field[ifield]][i] /= rscale;
+      BaryonField[DengoData.Field[ifield]][i] /= rscale;
   }
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.