diff --git a/src/resources/mesh/sphere.msh b/src/resources/mesh/sphere.msh index 416c655..1c68e68 100644 Binary files a/src/resources/mesh/sphere.msh and b/src/resources/mesh/sphere.msh differ diff --git a/tests/meshIO/meshIOTest.cpp b/tests/meshIO/meshIOTest.cpp index 07eec4f..1565218 100644 --- a/tests/meshIO/meshIOTest.cpp +++ b/tests/meshIO/meshIOTest.cpp @@ -31,8 +31,8 @@ TEST_F(meshIOTest, IsLoaded) { TEST_F(meshIOTest, GetMesh) { MeshIO meshIO(EXAMPLE_FILENAME); mfem::Mesh& mesh = meshIO.GetMesh(); - EXPECT_EQ(mesh.GetNE(), 670); - EXPECT_EQ(mesh.GetNV(), 201); + EXPECT_EQ(mesh.GetNE(), 18351); + EXPECT_EQ(mesh.GetNV(), 3768); double volume = ComputeMeshVolume(mesh); - EXPECT_DOUBLE_EQ(volume, 3.9357596288315868); + EXPECT_DOUBLE_EQ(volume, 4.160516453529322); } \ No newline at end of file diff --git a/tests/poly/meson.build b/tests/poly/meson.build index 00d5d28..27eab75 100644 --- a/tests/poly/meson.build +++ b/tests/poly/meson.build @@ -11,7 +11,7 @@ foreach test_file : test_sources test_exe = executable( exe_name, test_file, - dependencies: [gtest_dep, polysolver_dep, probe_dep, quill_dep], + dependencies: [gtest_dep, polysolver_dep, probe_dep, quill_dep, config_dep], install_rpath: '@loader_path/../../src' # Ensure runtime library path resolves correctly ) diff --git a/tests/poly/polyTest.cpp b/tests/poly/polyTest.cpp index 2c4d4e5..069d99b 100644 --- a/tests/poly/polyTest.cpp +++ b/tests/poly/polyTest.cpp @@ -5,6 +5,9 @@ #include "polySolver.h" #include "probe.h" +#include "config.h" + +std::string CONFIG_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/tests/testsConfig.yaml"; class polyTest : public ::testing::Test {}; @@ -13,13 +16,16 @@ TEST_F(polyTest, DefaultConstructor) { } TEST_F(polyTest, Solve) { + Config& config = Config::getInstance(); + config.loadConfig(CONFIG_FILENAME); PolySolver polytrope(1.5, 1); EXPECT_NO_THROW(polytrope.solve()); Probe::LogManager& logManager = Probe::LogManager::getInstance(); quill::Logger* logger = logManager.newFileLogger("polyTest.log", "polyTest"); - LOG_INFO(logger, "Solving polytrope with n = 1.5, gamma = 1"); + LOG_INFO(logger, "Solving polytrope with n = 1.5"); mfem::Mesh& mesh = polytrope.getMesh(); mfem::GridFunction& solution = polytrope.getSolution(); + Probe::glVisView(solution, mesh, "Polytrope solution"); // Get the mesh radius double radius = Probe::getMeshRadius(mesh); diff --git a/tests/testsConfig.yaml b/tests/testsConfig.yaml new file mode 100644 index 0000000..efa4d1c --- /dev/null +++ b/tests/testsConfig.yaml @@ -0,0 +1,4 @@ +Probe: + GLVis: + Host: "10.17.1.5" + Port: 19916 \ No newline at end of file diff --git a/utils/meshGeneration/generateMesh.py b/utils/meshGeneration/generateMesh.py index eb76bb2..b1d1512 100644 --- a/utils/meshGeneration/generateMesh.py +++ b/utils/meshGeneration/generateMesh.py @@ -6,7 +6,7 @@ import argparse def generate_spherical_mesh(radius=1, meshSize=0.1): with pygmsh.geo.Geometry() as geo: # Create a spherical (ball) geometry centered at (0,0,0) - sphere = geo.add_ball([0, 0, 0], radius) + sphere = geo.add_ball([0, 0, 0], radius, mesh_size=0.1) # Generate a 2D mesh (i.e. surface mesh) of the sphere myMesh = geo.generate_mesh(dim=3) return myMesh diff --git a/utils/meshGeneration/sphere.msh b/utils/meshGeneration/sphere.msh index 416c655..1c68e68 100644 Binary files a/utils/meshGeneration/sphere.msh and b/utils/meshGeneration/sphere.msh differ