// Sequential component labeling for two phase systems // Reads parallel simulation data and performs connectivity analysis // and averaging on a blob-by-blob basis // James E. McClure 2015 #include #include #include "analysis/analysis.h" #include "analysis/TwoPhase.h" using namespace std; inline void ReadFromRank(char *FILENAME, DoubleArray &Phase, int nx, int ny, int nz, int iproc, int jproc, int kproc) { int i,j,k,q,n,N; int iglobal,jglobal,kglobal; double value; double denA,denB; double f0,f1,f2,f3,f4,f5,f6,f7,f8,f9; double f10,f11,f12,f13,f14,f15,f16,f17,f18; N = nx*ny*nz; double *Den, *DistEven, *DistOdd; Den = new double[2*N]; DistEven = new double[10*N]; DistOdd = new double[9*N]; 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); int BoundaryCondition=0; Nx = (nx-2)*nprocx; Ny = (ny-2)*nprocy; Nz = (nz-2)*nprocz; Domain Dm(Nx,Ny,Nz,rank,1,1,1,Lx,Ly,Lz,BoundaryCondition); printf("Full domain size: %i x %i x %i \n", Nx,Ny,Nz); DoubleArray Phase(Nx,Ny,Nz); DoubleArray SignDist(Nx,Ny,Nz); // Filenames used char LocalRankString[8]; char LocalRankFilename[40]; char BaseFilename[20]; int proc,iglobal,kglobal,jglobal; double * Temp; Temp = new double[nx*ny*nz]; // read the files and populate main arrays for ( kproc=0; kproc