Skip to content

Commit 666171e

Browse files
committed
Add an Exodus IGA unit test with multiple blocks
This small mesh file was enough to trigger the bug I just fixed.
1 parent eafb114 commit 666171e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tests/mesh/mesh_input.C

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public:
6767
#endif // !LIBMESH_USE_COMPLEX_NUMBERS
6868

6969
CPPUNIT_TEST( testExodusFileMappingsPlateWithHole);
70+
CPPUNIT_TEST( testExodusFileMappingsTwoBlocks);
7071
CPPUNIT_TEST( testExodusFileMappingsCyl3d);
7172
#endif // LIBMESH_HAVE_EXODUS_API
7273

@@ -712,8 +713,13 @@ public:
712713
{
713714
auto locator = mesh.sub_point_locator();
714715

715-
const std::set<subdomain_id_type> manifold_subdomain { 0 };
716-
const std::set<subdomain_id_type> nodeelem_subdomain { 1 };
716+
// A multiblock Exodus file will have a subdomain for each block;
717+
// we stick the nodeelem subdomain at the end.
718+
const subdomain_id_type nodeelems = mesh.n_subdomains()-1;
719+
const std::set<subdomain_id_type> nodeelem_subdomain { nodeelems };
720+
std::set<subdomain_id_type> manifold_subdomain;
721+
for (auto i : make_range(nodeelems))
722+
manifold_subdomain.insert(i);
717723

718724
for (auto & elem : mesh.element_ptr_range())
719725
{
@@ -999,6 +1005,14 @@ public:
9991005
1.791640772215248, 1.413679237529376});
10001006
}
10011007

1008+
void testExodusFileMappingsTwoBlocks ()
1009+
{
1010+
testExodusFileMappings("meshes/two_quads_two_blocks.e",
1011+
// Regression values for sin_x_plus_cos_y
1012+
{2.03496953073072, 1.97996853164955,
1013+
1.18462134113435, 1.03085301158959});
1014+
}
1015+
10021016
void testExodusFileMappingsCyl3d ()
10031017
{
10041018
testExodusFileMappings("meshes/PressurizedCyl3d_Patch1_8Elem.e",
4.09 KB
Binary file not shown.

0 commit comments

Comments
 (0)