diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c80ca533..fc3738d2 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -43,8 +43,8 @@ ADD_LBPM_TEST( TestFluxBC ) ADD_LBPM_TEST( TestMap ) ADD_LBPM_TEST( TestMRT ) ADD_LBPM_TEST( TestColorGrad ) -ADD_LBPM_TEST( TestBubbleDFH ) ADD_LBPM_TEST( TestColorGradDFH ) +ADD_LBPM_TEST( TestBubbleDFH ../example/Piston/input.db) ADD_LBPM_TEST( TestColorMassBounceback ) ADD_LBPM_TEST( TestPressVel ../example/Piston/input.db) ADD_LBPM_TEST( TestPoiseuille ../example/Piston/input.db) diff --git a/tests/TestBubbleDFH.cpp b/tests/TestBubbleDFH.cpp index b8819c30..9716df80 100644 --- a/tests/TestBubbleDFH.cpp +++ b/tests/TestBubbleDFH.cpp @@ -20,17 +20,6 @@ using namespace std; -std::shared_ptr loadInputs( int nprocs ) -{ - auto db = std::make_shared(); - db->putScalar( "BC", 0 ); - db->putVector( "nproc", { 1, 1, 1 } ); - db->putVector( "n", { 100, 100, 100 } ); - db->putScalar( "nspheres", 1 ); - db->putVector( "L", { 1, 1, 1 } ); - return db; -} - //************************************************************************* // Implementation of Two-Phase Immiscible LBM //************************************************************************* @@ -44,11 +33,9 @@ int main(int argc, char **argv) MPI_Comm_dup(MPI_COMM_WORLD,&comm); int rank = comm_rank(comm); int nprocs = comm_size(comm); + int check=0; { // Limit scope so variables that contain communicators will free before MPI_Finialize - - // parallel domain size (# of sub-domains) - int nprocx,nprocy,nprocz; - + int i,j,k,n,Np; if (rank == 0){ printf("********************************************************\n"); printf("Running DFH/Color LBM \n"); @@ -98,19 +85,19 @@ int main(int argc, char **argv) string FILENAME; // Color Model parameters - int timestepMax = domain_db->getScalar( "timestepMax" ); - double tauA = domain_db->getScalar( "tauA" ); - double tauB = domain_db->getScalar( "tauB" ); - double rhoA = domain_db->getScalar( "rhoA" ); - double rhoB = domain_db->getScalar( "rhoB" ); - double Fx = domain_db->getVector( "F" )[0]; - double Fy = domain_db->getVector( "F" )[1]; - double Fz = domain_db->getVector( "F" )[2]; - double alpha = domain_db->getScalar( "alpha" ); - double beta = domain_db->getScalar( "beta" ); - bool Restart = domain_db->getScalar( "Restart" ); - double din = domain_db->getScalar( "din" ); - double dout = domain_db->getScalar( "dout" );; + int timestepMax = color_db->getScalar( "timestepMax" ); + double tauA = color_db->getScalar( "tauA" ); + double tauB = color_db->getScalar( "tauB" ); + double rhoA = color_db->getScalar( "rhoA" ); + double rhoB = color_db->getScalar( "rhoB" ); + double Fx = color_db->getVector( "F" )[0]; + double Fy = color_db->getVector( "F" )[1]; + double Fz = color_db->getVector( "F" )[2]; + double alpha = color_db->getScalar( "alpha" ); + double beta = color_db->getScalar( "beta" ); + bool Restart = color_db->getScalar( "Restart" ); + double din = color_db->getScalar( "din" ); + double dout = color_db->getScalar( "dout" );; double inletA=1.f; double inletB=0.f; double outletA=0.f; @@ -118,16 +105,16 @@ int main(int argc, char **argv) double flux = 10.f; // Read domain values - auto L = domain_db->getVector( "L" ); + auto L = domain_db->getVector( "L" ); auto size = domain_db->getVector( "n" ); auto nproc = domain_db->getVector( "nproc" ); int BoundaryCondition = domain_db->getScalar( "BC" ); int Nx = size[0]; int Ny = size[1]; int Nz = size[2]; - int Lx = L[0]; - int Ly = L[1]; - int Lz = L[2]; + double Lx = L[0]; + double Ly = L[1]; + double Lz = L[2]; int nprocx = nproc[0]; int nprocy = nproc[1]; int nprocz = nproc[2]; @@ -195,21 +182,6 @@ int main(int argc, char **argv) //....................................................................... if (rank == 0) printf("Read input media... \n"); //....................................................................... - for (i=0; i Averages( new TwoPhase(Dm) ); - // TwoPhase Averages(Dm); - Dm.CommInit(comm); - - // Mask that excludes the solid phase - Domain Mask(Nx,Ny,Nz,rank,nprocx,nprocy,nprocz,Lx,Ly,Lz,BoundaryCondition); - MPI_Barrier(comm); - - Nx+=2; Ny+=2; Nz += 2; - int N = Nx*Ny*Nz; - //....................................................................... - if (rank == 0) printf("Read input media... \n"); - //....................................................................... - //....................................................................... // Filenames used char LocalRankString[8]; @@ -250,10 +222,10 @@ int main(int argc, char **argv) } } // Initialize the bubble - for (k=0;kUpdateMeshValues(); // this computes the gradient of distance field (among other things) double count_wet=0.f; + double cns,bns,cws,bws; + cns=bns=bws=cws=1.0; for (k=1; k analysis_db; + //std::shared_ptr analysis_db; runAnalysis analysis( analysis_db, rank_info, ScaLBL_Comm, Dm, Np, pBC, beta, Map ); - analysis.createThreads( analysis_method, 4 ); + //analysis.createThreads( analysis_method, 4 ); while (timestep < timestepMax && err > tol ) { //if ( rank==0 ) { printf("Running timestep %i (%i MB)\n",timestep+1,(int)(Utilities::getMemoryUsage()/1048576)); } PROFILE_START("Update"); @@ -599,6 +571,7 @@ int main(int argc, char **argv) } // Limit scope so variables that contain communicators will free before MPI_Finialize MPI_Comm_free(&comm); MPI_Finalize(); + return check; }