diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 462f1af1..680b270d 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -55,6 +55,7 @@ ADD_LBPM_TEST( TestForceD3Q19 ) ADD_LBPM_TEST( TestMomentsD3Q19 ) ADD_LBPM_TEST( TestInterfaceSpeed ../example/Bubble/input.db) ADD_LBPM_TEST( TestSphereCurvature ) +ADD_LBPM_TEST( TestTriNormal ) #ADD_LBPM_TEST_1_2_4( TestTwoPhase ) ADD_LBPM_TEST_1_2_4( TestBlobIdentify ) #ADD_LBPM_TEST_PARALLEL( TestTwoPhase 8 ) diff --git a/tests/TestTriNormal.cpp b/tests/TestTriNormal.cpp new file mode 100644 index 00000000..955aa707 --- /dev/null +++ b/tests/TestTriNormal.cpp @@ -0,0 +1,92 @@ +#include +#include +#include "analysis/Minkowski.h" +#include "common/Domain.h" +#include "common/SpherePack.h" + +using namespace std; + +/* + * Compare the measured and analytical curvature for a sphere + * + */ + +std::shared_ptr loadInputs( ) +{ + //auto db = std::make_shared( "Domain.in" ); + auto db = std::make_shared(); + db->putScalar( "BC", 0 ); + db->putVector( "nproc", { 1, 1, 1 } ); + db->putVector( "n", { 16, 16, 16 } ); + db->putScalar( "nspheres", 1 ); + db->putVector( "L", { 1, 1, 1 } ); + return db; +} + +int main(int argc, char **argv) +{ + MPI_Init(&argc,&argv); + MPI_Comm comm = MPI_COMM_WORLD; + int rank = MPI_WORLD_RANK(); + int nprocs = MPI_WORLD_SIZE(); + int toReturn = 0; + { + int i,j,k; + + // Load inputs + auto db = loadInputs( ); + int Nx = db->getVector( "n" )[0]; + int Ny = db->getVector( "n" )[1]; + int Nz = db->getVector( "n" )[2]; + std::shared_ptr Dm = std::shared_ptr(new Domain(db,comm)); + + Nx+=2; Ny+=2; Nz+=2; + DoubleArray SDs(Nx,Ny,Nz); + DoubleArray SDs_x(Nx,Ny,Nz); + DoubleArray SDs_y(Nx,Ny,Nz); + DoubleArray SDs_y(Nx,Ny,Nz); + + printf("Set distance map \n"); + for (k=0; k