docs(tests/meshIO): added comments to meshIO tests

This commit is contained in:
2025-02-16 15:20:24 -05:00
parent 2f753c6ea0
commit 4158c893d4

View File

@@ -6,6 +6,16 @@
std::string EXAMPLE_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/src/resources/mesh/sphere.msh"; std::string EXAMPLE_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/src/resources/mesh/sphere.msh";
double ComputeMeshVolume(mfem::Mesh &mesh)
{
double totalVolume = 0.0;
for (int i = 0; i < mesh.GetNE(); i++) // Loop over all elements
{
totalVolume += mesh.GetElementVolume(i);
}
return totalVolume;
}
class meshIOTest : public ::testing::Test {}; class meshIOTest : public ::testing::Test {};
@@ -23,4 +33,6 @@ TEST_F(meshIOTest, GetMesh) {
mfem::Mesh& mesh = meshIO.GetMesh(); mfem::Mesh& mesh = meshIO.GetMesh();
EXPECT_EQ(mesh.GetNE(), 670); EXPECT_EQ(mesh.GetNE(), 670);
EXPECT_EQ(mesh.GetNV(), 201); EXPECT_EQ(mesh.GetNV(), 201);
double volume = ComputeMeshVolume(mesh);
EXPECT_DOUBLE_EQ(volume, 3.9357596288315868);
} }