Merge branch 'Crusher' of github.com:JamesEMcClure/LBPM-WIA into Crusher

This commit is contained in:
James E McClure 2022-02-09 16:11:34 -05:00
commit 05712e6a16
2 changed files with 44 additions and 0 deletions

View File

@ -45,6 +45,7 @@ ADD_LBPM_EXECUTABLE( TestIonModel )
ADD_LBPM_EXECUTABLE( TestNernstPlanck ) ADD_LBPM_EXECUTABLE( TestNernstPlanck )
ADD_LBPM_EXECUTABLE( TestPNP_Stokes ) ADD_LBPM_EXECUTABLE( TestPNP_Stokes )
ADD_LBPM_EXECUTABLE( TestMixedGrad ) ADD_LBPM_EXECUTABLE( TestMixedGrad )
ADD_LBPM_EXECUTABLE( TestCrusher )

43
tests/TestCrusher.cpp Normal file
View File

@ -0,0 +1,43 @@
#include <stdio.h>
#include <iostream>
#include "common/ScaLBL.h"
#include "common/MPI.h"
int main(int argc, char **argv)
{
Utilities::startup( argc, argv, true );
Utilities::MPI comm( MPI_COMM_WORLD );
int rank = comm.getRank();
{
auto filename = argv[1];
auto input_db = std::make_shared<Database>( filename );
auto db = input_db->getDatabase( "Domain" );
auto Dm = std::shared_ptr<Domain>(new Domain(db,comm));
int Nx = db->getVector<int>( "n" )[0] + 2;
int Ny = db->getVector<int>( "n" )[1] + 2;
int Nz = db->getVector<int>( "n" )[2] + 2;
char LocalRankString[8];
sprintf(LocalRankString,"%05d",rank);
char LocalRankFilename[40];
sprintf(LocalRankFilename,"ID.%05i",rank);
auto id = new char[Nx*Ny*Nz];
for (int k=0;k<Nz;k++){
for (int j=0;j<Ny;j++){
for (int i=0;i<Nx;i++){
int n = k*Nx*Ny+j*Nx+i;
id[n] = 1;
Dm->id[n] = id[n];
}
}
}
Dm->CommInit();
std::cout << "step 1" << std::endl << std::flush;
}
std::cout << "step 2" << std::endl << std::flush;
comm.barrier();
std::cout << "step 3" << std::endl << std::flush;
Utilities::shutdown();
std::cout << "step 4" << std::endl << std::flush;
return 0;
}