// Compute the signed distance from a digitized image // Two phases are present // Phase 1 has value -1 // Phase 2 has value 1 // this code uses the segmented image to generate the signed distance #include #include #include #include #include #include "common/Array.h" #include "common/Domain.h" #include "analysis/eikonal.h" int main(int argc, char **argv) { // Initialize MPI int rank, nprocs; MPI_Init(&argc,&argv); MPI_Comm comm = MPI_COMM_WORLD; MPI_Comm_rank(comm,&rank); MPI_Comm_size(comm,&nprocs); { int i,j,k,n,nn; int iproc,jproc,kproc; int nx,ny,nz; int Nx, Ny, Nz, N; int nprocx, nprocy, nprocz, nspheres; double Lx, Ly, Lz; Nx = Ny = Nz = 50; nx = ny = nz = 50; N = Nx*Ny*Nz; nprocx=nprocy=nprocz=2; Lx = Ly = Lz = 1.0; int BC=0; if (nprocs != 8){ ERROR("TestSegDist: Number of MPI processes must be equal to 8"); } if (nprocx !=2 || nprocz !=2 || nprocy !=2 ){ ERROR("TestSegDist: MPI process grid must be 2x2x2"); } // Get the rank info Domain Dm(nx,ny,nz,rank,nprocx,nprocy,nprocz,Lx,Ly,Lz,BC); for (k=0;k