Commits

Nathan Goldbaum committed b36416d

Bugfixes for the serial feedback zone. Still doesn't work.

Comments (0)

Files changed (8)

src/enzo/grid/Make.module.objects

 	Grid_TracerParticleCreateParticles.o \
 	Grid_TracerParticleOutputData.o \
 	Grid_TracerParticleSetVelocity.o \
-	Grid_UpdateActiveParticle.o \
 	Grid_UpdateParticlePosition.o \
 	Grid_UpdateParticleVelocity.o \
 	Grid_UpdateParticleWithActiveParticle.o \

src/enzo/grid/particles/Grid_AccreteOntoAccretingParticle.C

   vsink[1] = ThisParticle->ReturnVelocity()[1];
   vsink[2] = ThisParticle->ReturnVelocity()[2];
 
-  for (k = GridStartIndex[2]; k <= GridEndIndex[2]; k++) {
-    for (j = GridStartIndex[1]; j <= GridEndIndex[1]; j++) {
-      index = GRIDINDEX_NOGHOST(GridStartIndex[0],j,k);
-      for (i = GridStartIndex[0]; i <= GridEndIndex[0]; i++, index++) {
+  // need to iterate over the whole grid since I don't want to communicate the
+  // ghost zones
+  for (k = 0; k <= GridDimension[2]; k++) {
+    for (j = 0; j <= GridDimension[1]; j++) {
+      index = 0;
+      for (i = 0; i <= GridDimension[0]; i++, index++) {
 	radius2 = 
 	  POW((CellLeftEdge[0][i] + 0.5*CellWidth[0][i]) - ParticlePosition[0],2) +
 	  POW((CellLeftEdge[1][j] + 0.5*CellWidth[1][j]) - ParticlePosition[1],2) +
 	  POW((CellLeftEdge[2][k] + 0.5*CellWidth[2][k]) - ParticlePosition[2],2);   
 	if ((AccretionRadius*AccretionRadius) > radius2) {
-#ifdef DEBUG
-	  fprintf(stderr,
-		  "CellLeftEdge[0][i] = %"GSYM", CellRightEdge[0][i] =%"GSYM"\n"
-		  "CellLeftEdge[1][j] = %"GSYM", CellRightEdge[1][j] =%"GSYM"\n"
-		  "CellLeftEdge[2][k] = %"GSYM", CellRightEdge[2][k] =%"GSYM"\n",
-		  CellLeftEdge[0][i],CellLeftEdge[0][i]+CellWidth[0][i],CellLeftEdge[1][j],CellLeftEdge[1][j]+CellWidth[1][j],
-		  CellLeftEdge[2][k],CellLeftEdge[2][k]+CellWidth[2][k]);
-#endif
-	  if ((CellLeftEdge[0][i] < ParticlePosition[0]) && (CellLeftEdge[0][i]+CellWidth[0][i] > ParticlePosition[0]) &&
-	      (CellLeftEdge[1][j] < ParticlePosition[1]) && (CellLeftEdge[1][j]+CellWidth[1][j] > ParticlePosition[1]) &&
-	      (CellLeftEdge[2][k] < ParticlePosition[2]) && (CellLeftEdge[2][k]+CellWidth[2][k] > ParticlePosition[2]))
-	    fprintf(stderr,"Particle in this cell!\n");
-
 
 	  // useful shorthand
 	  vgas[0] = BaryonField[Vel1Num][index];

src/enzo/grid/particles/Grid_ConstructFeedbackZone.C

 #include "ActiveParticle.h"
 #include "phys_constants.h"
 
-int grid::ConstructFeedbackZone(ActiveParticleType* ThisParticle, int FeedbackRadius, FLOAT dx, grid* FeedbackZone)
+grid* grid::ConstructFeedbackZone(ActiveParticleType* ThisParticle, int FeedbackRadius, FLOAT dx)
 {
   FLOAT* ParticlePosition = ThisParticle->ReturnPosition();
 
   if ((GridLeftEdge[0] > ParticlePosition[0]+FeedbackRadius) || (GridRightEdge[0] < ParticlePosition[0]-FeedbackRadius) ||
       (GridLeftEdge[1] > ParticlePosition[1]+FeedbackRadius) || (GridRightEdge[1] < ParticlePosition[1]-FeedbackRadius) ||
       (GridLeftEdge[2] > ParticlePosition[2]+FeedbackRadius) || (GridRightEdge[2] < ParticlePosition[2]-FeedbackRadius))
-    return FAIL;
+    return NULL;
 
   /* Setup grid properties */
 
-  int FeedbackZoneRank = FeedbackZone->GetGridRank();
+  int FeedbackZoneRank = this->GetGridRank();
 
   // Since the grid creation machinery assume we want ghost zones, we need to
   // trick it into giving us a fake grid without ghost zones.  We therefore ask
       FeedbackZoneDimension[i] = 2*DEFAULT_GHOST_ZONES+1;
     size *= FeedbackZoneDimension[i];
 
-    LeftCellOffset[i]        = fmod(ParticlePosition[i],dx);
+    LeftCellOffset[i]        = fmod(ParticlePosition[i],dx)*dx;
     RightCellOffset[i]       = dx-LeftCellOffset[i];
     
     FeedbackZoneLeftEdge[i]  = ParticlePosition[i]-FeedbackRadius*dx-LeftCellOffset[i];
   }
 
   /* Intialize the fake grid */
-  FeedbackZone = new grid;
+  grid *FeedbackZone = new grid;
   
   FeedbackZone->InheritProperties(this);
   
   FeedbackZone->PrepareGrid(FeedbackZoneRank, FeedbackZoneDimension, 
 			    FeedbackZoneLeftEdge,FeedbackZoneRightEdge,0);
-  
+
   FeedbackZone->SetProcessorNumber(MyProcessorNumber);
 
-  FeedbackZone->AllocateAndZeroBaryonField();
+  if (FeedbackZone->AllocateAndZeroBaryonField() == FAIL)
+    return NULL;
     
   // Allocate flagging field of the same size as BaryonField. If FlaggingField =
   // 0, the corresponding zone in the BaryonField has not been copied yet.
     
-  int* FlaggingField = new int[size];
-  for (int i = 0; i<size; i++)
-    FlaggingField[i] = 0;
+  //int* FlaggingField = new int[size];
+  //for (int i = 0; i<size; i++)
+  //  FlaggingField[i] = 0;
 
   // Copy zones from this grid (which must overlap the position of the AP).
   // Note, using ZeroVector here will break if a FeedbackZone overlaps with a
   // Next, recursively iterate over the siblings of that grid, copying
   // zones from overlapping grids until the grid is filled
 
-  delete [] FlaggingField;
+  //delete [] FlaggingField;
 
-  return SUCCESS;
+  return FeedbackZone;
   
 }

src/enzo/grid/particles/Grid_UpdateActiveParticle.C

-/***********************************************************************
-/
-/  GRID CLASS (Update the active particle on this grid with the field 
-/              info from id == ThisParticle->identifier)
-/
-/  written by: Nathan Goldbaum
-/  date:       June 2012
-/
-************************************************************************/
-
-#include "preincludes.h"
-
-#include "ErrorExceptions.h"
-#include "macros_and_parameters.h"
-#include "typedefs.h"
-#include "global_data.h"
-#include "Fluxes.h"
-#include "GridList.h"
-#include "ExternalBoundary.h"
-#include "Grid.h"
-#include "Hierarchy.h"
-#include "ActiveParticle.h"
-
-int grid::UpdateActiveParticle(ActiveParticleType* ThisParticle) {
-    // Return if this doesn't concern us
-  if (ProcessorNumber != MyProcessorNumber)
-    return SUCCESS;
-
-  int i;
-  int iFound = -1, pFound = -1;
-  float CellVolume = 1.0;
-
-  for (i = 0; i<NumberOfActiveParticles; i++) {
-    if (this->ActiveParticles[i]->ReturnID() == ThisParticle->ReturnID()) {
-      iFound = i;
-      break;
-    }
-  }
-
-  if (iFound == -1)
-    return SUCCESS;
-
-  this->ActiveParticles[iFound] = ThisParticle;
-
-  ENZO_FAIL("NJG: Need to check this in a debugger\n");
-
-  return SUCCESS;
-}

src/enzo/headers/Grid.h

     if (MyProcessorNumber != ProcessorNumber)
       return SUCCESS;
 
-    if (BaryonField != NULL)
+    if (BaryonField[0] != NULL)
       return FAIL;
 
     int size = this->GetGridSize();
   int DetachActiveParticles(void);
   int MirrorActiveParticles(void);
   int DebugActiveParticles(int level);
-  int ConstructFeedbackZone(ActiveParticleType* ThisParticle, int FeedbackRadius, FLOAT dx, grid* FeedbackZone);
+  grid* ConstructFeedbackZone(ActiveParticleType* ThisParticle, int FeedbackRadius, FLOAT dx);
   int DistributeFeedbackZone(ActiveParticleType* ThisParticle, FLOAT FeedbackRadius);
 
   /* Returns averaged velocity from the 6 neighbor cells and itself */
 
   int UpdateStarParticles(int level);
 
-  int UpdateActiveParticle(ActiveParticleType* ThisParticle);
-
   int UpdateParticleWithActiveParticle(PINT ID);
 
   int AddH2Dissociation(Star *AllStars);

src/enzo/particles/Make.module.objects

 	ActiveParticle_SampleParticle.o \
 	ActiveParticle_SphereContained.o \
 	ActiveParticle_SpringelHernquist.o \
+	AssignActiveParticlesToGrids.o \
 	DetachActiveParticles.o \
+	ParticleBufferHandler.o \
+	ParticleBufferHandler_AllocateBuffer.o \
+	ParticleBufferHandler_UnpackBuffer.o \
 	RecordTotalActiveParticleCount.o \
 
 # ENZO BUILD SYSTEM DIRECTORY MODULE
 ENZO_OBJS +=\
 	CalculatePopIIILifetime.o \
 	CalculateSubtractionParameters.o \
-	ParticleBufferHandler.o \
-	ParticleBufferHandler_AllocateBuffer.o \
-	ParticleBufferHandler_UnpackBuffer.o \
 	ParticleMergeRoutines.o \
 	ParticleSplitter.o \
 	RecalibrateAccretingMass.o \

src/enzo/particles/active_particles/ActiveParticle_AccretingParticle.C

 			      int AccretingParticleID);
   static int SetFlaggingField(LevelHierarchyEntry *LevelArray[], int level, int TopGridDims[], int ActiveParticleID);
   static int InitializeParticleType();
-  int AdjustBondiHoyle(grid* CurrentGrid);
+  int AdjustBondiHoyle();
   
   int GetEnabledParticleID(int myid = -1) {				
     static int ParticleID = -1;						
   return SUCCESS;
 }
 
-int GenerateGridArray(LevelHierarchyEntry *LevelArray[], int level,
-		      HierarchyEntry **Grids[]);
-
 int ActiveParticleType_AccretingParticle::BeforeEvolveLevel(HierarchyEntry *Grids[], TopGridData *MetaData,
 						       int NumberOfGrids, LevelHierarchyEntry *LevelArray[], 
 						       int ThisLevel, int TotalStarParticleCountPrevious[],
   return SUCCESS;
 }
 
+int GenerateGridArray(LevelHierarchyEntry *LevelArray[], int level,
+		      HierarchyEntry **Grids[]);
+int AssignActiveParticlesToGrids(ActiveParticleType** ParticleList, int nParticles, 
+				 LevelHierarchyEntry *LevelArray[]);
+
 ActiveParticleType_AccretingParticle** ActiveParticleType_AccretingParticle::MergeAccretingParticles
 (int *nParticles, ActiveParticleType** ParticleList, FLOAT LinkingLength, 
  int *ngroups, LevelHierarchyEntry *LevelArray[])
   
   MergedParticles = new ActiveParticleType_AccretingParticle*[*ngroups]();
 
+  printf("Number of particles after merging: %"ISYM"\n",*ngroups);
+
   /* Merge the mergeable groups */
 
   for (i=0; i<*ngroups; i++) {
   return MergedParticles;
 }
 
-int CommunicationSyncNumberOfParticles(HierarchyEntry *GridHierarchyPointer[],int NumberOfGrids);
-
 int ActiveParticleType_AccretingParticle::AfterEvolveLevel(HierarchyEntry *Grids[], TopGridData *MetaData,
 							   int NumberOfGrids, LevelHierarchyEntry *LevelArray[], 
 							   int ThisLevel, int TotalStarParticleCountPrevious[],
     {
 
       /* Generate a list of all sink particles in the simulation box */
-      int i,level,gridnum,nParticles,NumberOfLevelGrids,NumberOfMergedParticles;
-      HierarchyEntry **LevelGrids = NULL;
+      int i,nParticles,NumberOfMergedParticles;
       ActiveParticleType** ParticleList = NULL;
 
       ParticleList = ActiveParticleFindAll(LevelArray, &nParticles, AccretingParticleID);
    
       /* Assign local particles to grids */
  
-      int LevelMax, SavedGrid, NumberOfGrids;
-      FLOAT* pos = NULL;
-      float mass;
+      ParticleList = new ActiveParticleType*[NumberOfMergedParticles];
 
-      for (i = 0; i<NumberOfMergedParticles; i++) {
-	LevelMax = SavedGrid = -1;
-	NumberOfLevelGrids = 0;
-	for (level = 0; level < MAX_DEPTH_OF_HIERARCHY; level++) {
-	  NumberOfLevelGrids = GenerateGridArray(LevelArray, level, &LevelGrids);     
-	  for (gridnum = 0; gridnum < NumberOfLevelGrids; gridnum++) 
-	    if (LevelGrids[gridnum]->GridData->ReturnProcessorNumber() == MyProcessorNumber)
-	      if (LevelGrids[gridnum]->GridData->PointInGrid(MergedParticles[i]->ReturnPosition()) == true &&
-		  LevelGrids[gridnum]->GridData->isLocal() == true) { 
-		SavedGrid = gridnum;
-		LevelMax = level;
-	      }
-	  delete [] LevelGrids;
-	  LevelGrids = NULL;
-	}
-	
-	
-	/* Assign the merged particles to grids.  The repeated code in
-	   the serial and parallel implimentations kind of sucks -
-	   should this be different? */
+      // need to use a bit of redirection because C++ pointer arrays have
+      // trouble with polymorphism
+      for (i = 0; i<NumberOfMergedParticles; i++)
+	ParticleList[i] = static_cast<ActiveParticleType*>(MergedParticles[i]);
 
-	if (NumberOfProcessors == 1) {
-	
-	  grid* OldGrid = MergedParticles[i]->ReturnCurrentGrid();
-	  int ID = MergedParticles[i]->ReturnID();
-	  NumberOfGrids = GenerateGridArray(LevelArray, LevelMax, &LevelGrids); 
-	  MergedParticles[i]->AdjustBondiHoyle(LevelGrids[SavedGrid]->GridData);
-	  if (OldGrid != LevelGrids[SavedGrid]->GridData) {
-	    if (LevelGrids[SavedGrid]->GridData->AddActiveParticle(static_cast<ActiveParticleType*>(MergedParticles[i])) == FAIL)
-	      ENZO_FAIL("Active particle grid assignment failed");
-	  }
-	  // Still need to mirror the AP data to the particle list.
-	  else {
-	    LevelGrids[SavedGrid]->GridData->UpdateParticleWithActiveParticle(MergedParticles[i]->ReturnID());
-	  }
+      if (AssignActiveParticlesToGrids(ParticleList,NumberOfMergedParticles, LevelArray) == FAIL)
+	return FAIL;
 
-	  /* Clean up the active particle list on the old grid */
-	  
-	  int foundP = FALSE, foundAP = FALSE;
-	  // This could probably be a member function....
-	  if (SavedGrid != -1) {
-	    if (OldGrid != LevelGrids[SavedGrid]->GridData) {
-	      foundAP = OldGrid->RemoveActiveParticle(ID,LevelGrids[SavedGrid]->GridData->ReturnProcessorNumber());
-	      foundP = OldGrid->RemoveParticle(ID);
-	      if ((foundP != TRUE) || (foundAP != TRUE))
-		return FAIL;
-	      OldGrid->SetNumberOfActiveParticles(OldGrid->ReturnNumberOfActiveParticles()-1);
-	      OldGrid->CleanUpMovedParticles();
-	    }
-	  }
-	}
-	else {
-#ifdef USE_MPI
-	  /* Find the processor which has the maximum value of
-	     LevelMax and assign the accreting particle to the
-	     SavedGrid on that processor.  */
-	  struct { Eint32 value; Eint32 rank; } sendbuf, recvbuf;
-	  MPI_Comm_rank(EnzoTopComm, &sendbuf.rank); 
-	  sendbuf.value = LevelMax;
-	  MPI_Allreduce(&sendbuf, &recvbuf, 1, MPI_2INT, MPI_MAXLOC, EnzoTopComm);
-	  NumberOfGrids = GenerateGridArray(LevelArray, recvbuf.value, &LevelGrids); 
-	  if (LevelMax == recvbuf.value) {
-	    MergedParticles[i]->AdjustBondiHoyle(LevelGrids[SavedGrid]->GridData);
-	    if (LevelGrids[SavedGrid]->GridData->AddActiveParticle(static_cast<ActiveParticleType*>(MergedParticles[i])) == FAIL) {
-	      ENZO_FAIL("Active particle grid assignment failed"); 
-	    } 
-	    // Still need to mirror the AP data to the particle list.
-	    else {
-	      LevelGrids[SavedGrid]->GridData->UpdateParticleWithActiveParticle(MergedParticles[i]->ReturnID());
-	    }
-	  }
-	  LevelMax = recvbuf.value;
-#endif // endif parallel
-	}
+      delete [] ParticleList;
 
-	/* Sync the updated particle counts accross all proccessors */
-
-	CommunicationSyncNumberOfParticles(LevelGrids, NumberOfGrids);
-
-	delete [] LevelGrids;
-
-      }
+      for (i = 0; i<NumberOfMergedParticles; i++)
+	MergedParticles[i]->AdjustBondiHoyle();
 
       delete [] MergedParticles;
       
       return FAIL;
     }
     
-    if (sinkGrid->ConstructFeedbackZone(ParticleList[i],AccretionRadius, dx, FeedbackZone) == FAIL) 
+    FeedbackZone = sinkGrid->ConstructFeedbackZone(ParticleList[i],AccretionRadius, dx);
+      
+    if (FeedbackZone == NULL)
       return FAIL;
     
     float AccretionRate = 0;
     if (FeedbackZone->DistributeFeedbackZone(ParticleList[i],AccretionRadius*dx) == FAIL)
       return FAIL;
   
-    delete [] FeedbackZone;
+    delete FeedbackZone;
   
-    if (sinkGrid->UpdateActiveParticle(static_cast<ActiveParticleType*>(ParticleList[i])) == FAIL)
-      return FAIL;
-    
   }
 
+  if (AssignActiveParticlesToGrids(ParticleList, nParticles, LevelArray) == FAIL)
+    return FAIL;
+
   delete [] Grids;
   return SUCCESS;
 }
   return SUCCESS;
 }
 
-int ActiveParticleType_AccretingParticle::AdjustBondiHoyle(grid* CurrentGrid) {
+int ActiveParticleType_AccretingParticle::AdjustBondiHoyle() {
+  grid* CurrentGrid = this->CurrentGrid;
   float *density = CurrentGrid->AccessDensity();
   float *velx = CurrentGrid->AccessVelocity1();
   float *vely = CurrentGrid->AccessVelocity2();

src/enzo/particles/active_particles/AssignActiveParticlesToGrids.C

+/***********************************************************************
+/
+/  AssignActiveParticlesToGrids:
+/  Assigning a list of active particles to the appropriate grid.
+/
+/  written by: Nathan Goldbaum
+/  date:       June, 2012
+/  modified1:
+/
+/  PURPOSE: Given a list of active particles, this function will 
+/           traverse the hierarchy and assign them to the appropriate 
+/           grid.  If a particle with the same ID as the one under 
+/           consideration is already assigned to the wrong grid, that 
+/           particle is deleted.  If the particle is already assigned 
+/           to the correct grid, the mirrored particle is updated.
+/
+************************************************************************/
+
+#ifdef USE_MPI
+#include "communicators.h"
+#endif 
+
+#include "preincludes.h"
+
+#include "ErrorExceptions.h"
+#include "macros_and_parameters.h"
+#include "typedefs.h"
+#include "global_data.h"
+#include "units.h"
+#include "Fluxes.h"
+#include "GridList.h"
+#include "ExternalBoundary.h"
+#include "Grid.h"
+#include "Hierarchy.h"
+#include "LevelHierarchy.h"
+#include "TopGridData.h"
+#include "CommunicationUtilities.h"
+#include "phys_constants.h"
+
+int GenerateGridArray(LevelHierarchyEntry *LevelArray[], int level,
+		      HierarchyEntry **Grids[]);
+int CommunicationSyncNumberOfParticles(HierarchyEntry *GridHierarchyPointer[],int NumberOfGrids);
+
+int AssignActiveParticlesToGrids(ActiveParticleType** ParticleList, int nParticles, 
+				 LevelHierarchyEntry *LevelArray[]) 
+{
+  int LevelMax, SavedGrid, NumberOfGrids, i, level, NumberOfLevelGrids, gridnum;
+  HierarchyEntry **LevelGrids = NULL;
+  FLOAT* pos = NULL;
+  float mass;
+  
+  for (i = 0; i<nParticles; i++) {
+    // Find the grid and processor this particle lives on
+    LevelMax = SavedGrid = -1;
+    for (level = 0; level < MAX_DEPTH_OF_HIERARCHY; level++) {
+      NumberOfLevelGrids = GenerateGridArray(LevelArray, level, &LevelGrids);     
+      for (gridnum = 0; gridnum < NumberOfLevelGrids; gridnum++) 
+	if (LevelGrids[gridnum]->GridData->ReturnProcessorNumber() == MyProcessorNumber)
+	  if (LevelGrids[gridnum]->GridData->PointInGrid(ParticleList[i]->ReturnPosition()) == true &&
+	      LevelGrids[gridnum]->GridData->isLocal() == true) { 
+	    SavedGrid = gridnum;
+	    LevelMax = level;
+	  }
+      delete [] LevelGrids;
+      LevelGrids = NULL;
+    }
+    
+    /* Assign the merged particles to grids. */
+    
+    if (NumberOfProcessors == 1) {
+      grid* OldGrid = ParticleList[i]->ReturnCurrentGrid();
+      int ID = ParticleList[i]->ReturnID();
+      int foundP = FALSE; 
+      int foundAP = FALSE;
+      NumberOfGrids = GenerateGridArray(LevelArray, LevelMax, &LevelGrids); 
+      
+      // If the particle moved we need to add it to the new grid and remove
+      // it from the old grid.
+      if (OldGrid != LevelGrids[SavedGrid]->GridData) {
+	if (LevelGrids[SavedGrid]->GridData->AddActiveParticle(static_cast<ActiveParticleType*>(ParticleList[i])) == FAIL)
+	  ENZO_FAIL("Active particle grid assignment failed");
+	if (SavedGrid != -1) {
+	  foundAP = OldGrid->RemoveActiveParticle(ID,LevelGrids[SavedGrid]->GridData->ReturnProcessorNumber());
+	  foundP = OldGrid->RemoveParticle(ID);
+	  if ((foundP != TRUE) || (foundAP != TRUE))
+	    return FAIL;
+	  OldGrid->SetNumberOfActiveParticles(OldGrid->ReturnNumberOfActiveParticles()-1);
+	  OldGrid->CleanUpMovedParticles();
+	}
+      }
+      // If the particle didn't change grids, we still need to mirror the AP data to the particle list.
+      else {
+	LevelGrids[SavedGrid]->GridData->UpdateParticleWithActiveParticle(ParticleList[i]->ReturnID());
+      }
+    }
+    else {
+#ifdef USE_MPI
+      /* Find the processor which has the maximum value of
+	 LevelMax and assign the accreting particle to the
+	 SavedGrid on that processor.  */
+      struct { Eint32 value; Eint32 rank; } sendbuf, recvbuf;
+      MPI_Comm_rank(EnzoTopComm, &sendbuf.rank); 
+      sendbuf.value = LevelMax;
+      MPI_Allreduce(&sendbuf, &recvbuf, 1, MPI_2INT, MPI_MAXLOC, EnzoTopComm);
+      NumberOfGrids = GenerateGridArray(LevelArray, recvbuf.value, &LevelGrids); 
+      if (LevelMax == recvbuf.value) {
+	if (LevelGrids[SavedGrid]->GridData->AddActiveParticle(static_cast<ActiveParticleType*>(ParticleList[i])) == FAIL) {
+	  ENZO_FAIL("Active particle grid assignment failed"); 
+	} 
+	// Still need to mirror the AP data to the particle list.
+	else {
+	  LevelGrids[SavedGrid]->GridData->UpdateParticleWithActiveParticle(ParticleList[i]->ReturnID());
+	}
+      }
+      LevelMax = recvbuf.value;
+#endif // endif parallel
+    }
+    
+    /* Sync the updated particle counts accross all proccessors */
+    
+    CommunicationSyncNumberOfParticles(LevelGrids, NumberOfGrids);
+    
+    delete [] LevelGrids;
+    
+  }
+
+  return SUCCESS;
+}
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.