// Unit test for TwoPhase averaging class #include #include #include #include #include #include #include "analysis/TwoPhase.h" #include "common/MPI_Helpers.h" #include "common/Communication.h" #include "IO/Mesh.h" #include "IO/Writer.h" #include "ProfilerApp.h" int main(int argc, char **argv) { // Initialize MPI Utilities::startup( argc, argv ); Utilities::MPI comm( MPI_COMM_WORLD ); int rank = comm.getRank(); int nprocs = comm.getSize(); { // Limit scope so Domain can free it's communicator printf("Running two-phase averaging test on %i processors \n",nprocs); int npx,npy,npz; int i,j,k,n; int Nx,Ny,Nz; double Lx,Ly,Lz; Nx=Ny=Nz=40; Lx=Ly=Lz=1.0; int BC=0; // periodic boundary condition // Set the number of processors in each direction if ( nprocs==4 ) { npx=npy=2; npz=1; } else if ( nprocs==8 ) { npx=npy=npz=2; } else { npx=npy=1; npz=nprocs; } Domain Dm(Nx,Ny,Nz,rank,npx,npy,npz,Lx,Ly,Lz,BC); for (i=0; i