Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f4ca315

Browse files
committed
Unit test is_internal
1 parent eb2d9e1 commit f4ca315

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

tests/geom/elem_test.C

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,30 @@ public:
635635
test_n_refinements(2);
636636
}
637637

638+
void test_is_internal()
639+
{
640+
LOG_UNIT_TEST;
641+
642+
for (const auto & elem :
643+
this->_mesh->active_local_element_ptr_range())
644+
for (const auto nd : elem->node_index_range())
645+
{
646+
if ((elem->type() == EDGE3 || elem->type() == EDGE4) && nd >= 2)
647+
CPPUNIT_ASSERT(elem->is_internal(nd));
648+
else if (elem->type() == HEX27 && nd == 26)
649+
CPPUNIT_ASSERT(elem->is_internal(nd));
650+
else if (elem->type() == PRISM21 && nd == 20)
651+
CPPUNIT_ASSERT(elem->is_internal(nd));
652+
else if (elem->type() == QUAD9 && nd == 8)
653+
CPPUNIT_ASSERT(elem->is_internal(nd));
654+
else if (elem->type() == TRI7 && nd == 6)
655+
CPPUNIT_ASSERT(elem->is_internal(nd));
656+
else
657+
CPPUNIT_ASSERT(!elem->is_internal(nd));
658+
}
659+
}
660+
661+
638662
};
639663

640664
#define ELEMTEST \
@@ -650,8 +674,9 @@ public:
650674
CPPUNIT_TEST( test_center_node_on_side ); \
651675
CPPUNIT_TEST( test_side_type ); \
652676
CPPUNIT_TEST( test_elem_side_builder ); \
653-
CPPUNIT_TEST( test_refinement); \
654-
CPPUNIT_TEST( test_double_refinement);
677+
CPPUNIT_TEST( test_refinement ); \
678+
CPPUNIT_TEST( test_double_refinement ); \
679+
CPPUNIT_TEST( test_is_internal )
655680

656681
#define INSTANTIATE_ELEMTEST(elemtype) \
657682
class ElemTest_##elemtype : public ElemTest<elemtype> { \

0 commit comments

Comments
 (0)