Commits

John Wise  committed 379131a

A few minor changes to sink particle formation. Thanks to Alan Boss
for pointing out these errors!

1. If star formation is turned on in a simulation previously without
particle attributes, it will automatically add the particle
attributes.
2. When reporting the total sink particle mass, the time and total
mass were not defined.
3. star_maker3 -> sink_maker in write statements.

  • Participants
  • Parent commits b86d52b

Comments (0)

Files changed (3)

File src/enzo/ReadParameterFile.C

 
   /* Set the number of particle attributes, if left unset. */
  
-  if (NumberOfParticleAttributes == INT_UNDEFINED)
+  if (NumberOfParticleAttributes == INT_UNDEFINED || 
+      NumberOfParticleAttributes == 0) {
     if (StarParticleCreation || StarParticleFeedback) {
       NumberOfParticleAttributes = 3;
       if (StarMakerTypeIaSNe) NumberOfParticleAttributes++;
+      AddParticleAttributes = TRUE;
     } else {
       NumberOfParticleAttributes = 0;
     }
+    
+  }
  
 #ifdef UNUSED
   if (MaximumGravityRefinementLevel == INT_UNDEFINED)

File src/enzo/StarParticleFinalize.C

   float TotalMass;
   Star *ThisStar, *MoveStar;
   LevelHierarchyEntry *Temp;
-  FLOAT TimeNow;
+  FLOAT TimeNow = LevelArray[level]->GridData->ReturnTime();
+  float Timestep = LevelArray[level]->GridData->ReturnTimeStep();
 
   NumberOfStars = 0;
   for (ThisStar = AllStars; ThisStar; ThisStar = ThisStar->NextStar)
 
   int count = 0;
   int mbh_particle_io_count = 0;
-  float Timestep;
-  TimeNow = LevelArray[level]->GridData->ReturnTime();
-  Timestep = LevelArray[level]->GridData->ReturnTimeStep();
   for (ThisStar = AllStars; ThisStar; ThisStar = ThisStar->NextStar, count++) {
     //TimeNow = LevelArray[ThisStar->ReturnLevel()]->GridData->ReturnTime();
 //    if (debug) {

File src/enzo/sink_maker.C

   } // ENDFOR k
 
   if (ii > 0)
-    printf("star_maker3[add]: %"ISYM" new sink particles\n", ii);
+    printf("sink_maker[add]: %"ISYM" new sink particles\n", ii);
 
 //  if (nsinks > 0)
-//    printf("star_maker3[sink]: %"ISYM" old sink particles\n", nsinks);
+//    printf("sink_maker[sink]: %"ISYM" old sink particles\n", nsinks);
 
   if (ii >= *nmax) {
-    fprintf(stdout, "star_maker3: reached max new particle count");
+    fprintf(stdout, "sink_maker: reached max new particle count");
     return FAIL;
   }