diff --git a/tests/TestBlobAnalyze.cpp b/tests/TestBlobAnalyze.cpp index 1f483d90..b09a50ae 100644 --- a/tests/TestBlobAnalyze.cpp +++ b/tests/TestBlobAnalyze.cpp @@ -149,16 +149,44 @@ int main(int argc, char **argv) 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; + if (domain.good()){ + domain >> nprocx; + domain >> nprocy; + domain >> nprocz; + domain >> nx; + domain >> ny; + domain >> nz; + domain >> nspheres; + domain >> Lx; + domain >> Ly; + domain >> Lz; + } + else if (nprocs==1){ + nprocx=nprocy=nprocz=1; + nx=ny=nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } + else if (nprocs==2){ + nprocx=nprocy=1; + nprocz=2; + nx=ny=nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } + else if (nprocs==4){ + nprocx=nprocy=2; + nprocz=1; + nx=ny=nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } + else if (nprocs==8){ + nprocx=nprocy=nprocz=2; + nx=ny=nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } } MPI_Barrier(comm); // Computational domain diff --git a/tests/TestCommD3Q19.cpp b/tests/TestCommD3Q19.cpp index 7a292f9f..943c9c26 100644 --- a/tests/TestCommD3Q19.cpp +++ b/tests/TestCommD3Q19.cpp @@ -196,17 +196,45 @@ int main(int argc, char **argv) //....................................................................... // Reading the domain information file //....................................................................... - ifstream domain("Domain.in"); - domain >> nprocx; - domain >> nprocy; - domain >> nprocz; - domain >> Nx; - domain >> Ny; - domain >> Nz; - domain >> nspheres; - domain >> Lx; - domain >> Ly; - domain >> Lz; + ifstream domain("Domain.in"); + if (domain.good()){ + domain >> nprocx; + domain >> nprocy; + domain >> nprocz; + domain >> Nx; + domain >> Ny; + domain >> Nz; + domain >> nspheres; + domain >> Lx; + domain >> Ly; + domain >> Lz; + } + else if (nprocs==1){ + nprocx=nprocy=nprocz=1; + Nx=Ny=Nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } + else if (nprocs==2){ + nprocx=nprocy=1; + nprocz=2; + Nx=Ny=Nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } + else if (nprocs==4){ + nprocx=nprocy=2; + nprocz=1; + Nx=Ny=Nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } + else if (nprocs==8){ + nprocx=nprocy=nprocz=2; + Nx=Ny=Nz=50; + nspheres=0; + Lx=Ly=Lz=1; + } //....................................................................... } // **************************************************************