docs(tests/meshIO): added comments to meshIO tests
This commit is contained in:
@@ -6,6 +6,16 @@
|
||||
|
||||
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 {};
|
||||
|
||||
@@ -23,4 +33,6 @@ TEST_F(meshIOTest, GetMesh) {
|
||||
mfem::Mesh& mesh = meshIO.GetMesh();
|
||||
EXPECT_EQ(mesh.GetNE(), 670);
|
||||
EXPECT_EQ(mesh.GetNV(), 201);
|
||||
double volume = ComputeMeshVolume(mesh);
|
||||
EXPECT_DOUBLE_EQ(volume, 3.9357596288315868);
|
||||
}
|
||||
Reference in New Issue
Block a user