// Sequential blob analysis // Reads parallel simulation data and performs connectivity analysis // and averaging on a blob-by-blob basis // James E. McClure 2014 #include #include #include "analysis/pmmc.h" #include "analysis/analysis.h" //#include "Domain.h" using namespace std; inline void ReadCheckpoint(char *FILENAME, double *cDen, double *cDistEven, double *cDistOdd, int N) { int q,n; double value; ifstream File(FILENAME,ios::binary); for (n=0; n> nprocx; domain >> nprocy; domain >> nprocz; domain >> nx; domain >> ny; domain >> nz; domain >> nspheres; domain >> Lx; domain >> Ly; domain >> Lz; //....................................................................... nx+=2; ny+=2; nz+=2; nprocs = nprocx*nprocy*nprocz; printf("Number of MPI ranks: %i \n", nprocs); Nx = (nx-2)*nprocx+2; Ny = (ny-2)*nprocy+2; Nz = (nz-2)*nprocz+2; printf("Full domain size: %i x %i x %i \n", Nx,Ny,Nz); DoubleArray Phase(Nx,Ny,Nz); DoubleArray SignDist(Nx,Ny,Nz); Phase.fill(0); SignDist.fill(-100.0); // read the files and populate main arrays for (int kproc=0; kproc 0.0){ porosity += 1.0; } } } } //int N=int(porosity*1.25); //porosity /= (Nx*Ny*Nz*1.0); //printf("Media porosity is %f \n",porosity); /* **************************************************************** IDENTIFY ALL BLOBS: F > vF, S > vS ****************************************************************** */ // Find blob domains, number of blobs double vF=0.0; double vS=0.0; printf("Execute blob identification algorithm... \n"); IntArray GlobalBlobID; int nblobs = ComputeLocalBlobIDs( Phase, SignDist, vF, vS, GlobalBlobID ); ReorderBlobIDs(GlobalBlobID,MPI_COMM_WORLD); // This will reorder by blob size printf("Identified %i blobs. Writing per-process output files. \n",nblobs); int sizeLoc = nx*ny*nz; int *LocalBlobID; LocalBlobID = new int [sizeLoc]; printf("File size (4 bytes per entry) %i, \n",sizeLoc); // read the files and populate main arrays for (int kproc=0; kproc