diff --git a/common/Domain.h b/common/Domain.h index e31c3459..7bb73f9b 100755 --- a/common/Domain.h +++ b/common/Domain.h @@ -24,7 +24,8 @@ struct Domain{ Domain(int nx, int ny, int nz, int rnk, int npx, int npy, int npz, double lx, double ly, double lz, int BC){ - Volume = nx*ny*nx*npx*npy*npz*1.0; + + Volume = nx*ny*nx*npx*npy*npz*1.0; Nx = nx+2; Ny = ny+2; Nz = nz+2; Lx = lx, Ly = ly, Lz = lz; rank = rnk; diff --git a/tests/BlobAnalyzeParallel.cpp b/tests/BlobAnalyzeParallel.cpp index cc86a15b..fb477520 100644 --- a/tests/BlobAnalyzeParallel.cpp +++ b/tests/BlobAnalyzeParallel.cpp @@ -118,17 +118,34 @@ int main(int argc, char **argv) //....................................................................... int nprocx, nprocy, nprocz, nx, ny, nz, nspheres; double Lx, Ly, Lz; - ifstream domain("Domain.in"); - domain >> nprocx; - domain >> nprocy; - domain >> nprocz; - domain >> nx; - domain >> ny; - domain >> nz; - domain >> nspheres; - domain >> Lx; - domain >> Ly; - domain >> Lz; + + if (rank==0){ + ifstream domain("Domain.in"); + domain >> nprocx; + domain >> nprocy; + domain >> nprocz; + domain >> nx; + domain >> ny; + domain >> nz; + domain >> nspheres; + domain >> Lx; + domain >> Ly; + domain >> Lz; + } + MPI_Barrier(MPI_COMM_WORLD); + // Computational domain + MPI_Bcast(&nx,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&ny,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&nz,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&nprocx,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&nprocy,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&nprocz,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&nspheres,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(&Lx,1,MPI_DOUBLE,0,MPI_COMM_WORLD); + MPI_Bcast(&Ly,1,MPI_DOUBLE,0,MPI_COMM_WORLD); + MPI_Bcast(&Lz,1,MPI_DOUBLE,0,MPI_COMM_WORLD); + //................................................. + MPI_Barrier(MPI_COMM_WORLD); // Check that the number of processors >= the number of ranks if ( rank==0 ) { @@ -182,6 +199,14 @@ int main(int argc, char **argv) fclose(BLOBLOCAL); printf("Wrote BlobLabel.%05i \n",rank); + sprintf(LocalRankString,"%05d",rank); +// sprintf(LocalRankFilename,"%s%s","ID.",LocalRankString); +// WriteLocalSolidID(LocalRankFilename, id, N); + sprintf(LocalRankFilename,"%s%s","SignDist.",LocalRankString); + ReadBinaryFile(LocalRankFilename, Averages.SDs.get(), N); + MPI_Barrier(MPI_COMM_WORLD); + if (rank == 0) cout << "Domain set." << endl; + //....................................................................... //copies of data needed to perform checkpointing from cpu double *Den, *DistEven, *DistOdd; @@ -266,9 +291,8 @@ int main(int argc, char **argv) if (rank==0) printf("Porosity = %f \n",porosity); Dm.CommInit(MPI_COMM_WORLD); - // nblobs = ComputeGlobalBlobIDs(nx,ny,nz,rank_info, - // Averages.Phase,Averages.SDs,vF,vS,Averages.BlobLabel); - +// nblobs = ComputeGlobalBlobIDs(nx,ny,nz,rank_info, +// Averages.Phase,Averages.SDs,vF,vS,Averages.BlobLabel); // if ( rank==0 ) { printf("Identified %i blobs\n",nblobs); } for (int k=0; k