refactor(sphere.msh): increased base resolution of spherical mesh

This commit is contained in:
2025-02-24 12:38:47 -05:00
parent de5c84f668
commit dfb65c1082
7 changed files with 16 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -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
)

View File

@@ -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);

4
tests/testsConfig.yaml Normal file
View File

@@ -0,0 +1,4 @@
Probe:
GLVis:
Host: "10.17.1.5"
Port: 19916