Preventing errors if unit tests do not have a valid Domain.in file
This commit is contained in:
parent
3de7b47867
commit
a043dd82c2
@ -149,6 +149,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (rank==0){
|
||||
ifstream domain("Domain.in");
|
||||
if (domain.good()){
|
||||
domain >> nprocx;
|
||||
domain >> nprocy;
|
||||
domain >> nprocz;
|
||||
@ -159,6 +160,33 @@ int main(int argc, char **argv)
|
||||
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
|
||||
|
@ -197,6 +197,7 @@ int main(int argc, char **argv)
|
||||
// Reading the domain information file
|
||||
//.......................................................................
|
||||
ifstream domain("Domain.in");
|
||||
if (domain.good()){
|
||||
domain >> nprocx;
|
||||
domain >> nprocy;
|
||||
domain >> nprocz;
|
||||
@ -207,6 +208,33 @@ int main(int argc, char **argv)
|
||||
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;
|
||||
}
|
||||
//.......................................................................
|
||||
}
|
||||
// **************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user