diff --git a/common/Domain.cpp b/common/Domain.cpp index fc797a8e..9cf9a1ca 100644 --- a/common/Domain.cpp +++ b/common/Domain.cpp @@ -1433,3 +1433,94 @@ void Domain::ReadFromFile(const std::string& Filename,const std::string& Datatyp //Comm.barrier(); MPI_Barrier(Comm); } + +void Domain::AggregateLabels( const std::string& filename, DoubleArray &UserData ){ + + int nx = Nx; + int ny = Ny; + int nz = Nz; + + int npx = nprocx(); + int npy = nprocy(); + int npz = nprocz(); + + int ipx = iproc(); + int ipy = jproc(); + int ipz = kproc(); + + int nprocs = nprocx()*nprocy()*nprocz(); + + int full_nx = npx*(nx-2); + int full_ny = npy*(ny-2); + int full_nz = npz*(nz-2); + int local_size = (nx-2)*(ny-2)*(nz-2); + unsigned long int full_size = long(full_nx)*long(full_ny)*long(full_nz); + + double *LocalID; + LocalID = new double [local_size]; + + //printf("aggregate labels: local size=%i, global size = %i",local_size, full_size); + // assign the ID for the local sub-region + for (int k=1; kAggregateLabels(OutputFilename,PhaseField); } } diff --git a/models/IonModel.h b/models/IonModel.h index 995898bd..0f527c3a 100644 --- a/models/IonModel.h +++ b/models/IonModel.h @@ -85,6 +85,7 @@ private: char LocalRankString[8]; char LocalRankFilename[40]; char LocalRestartFile[40]; + char OutputFilename[200]; //int rank,nprocs; void LoadParams(std::shared_ptr db0);