本文整理汇总了C++中NodeSet::set_mid_region_node方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeSet::set_mid_region_node方法的具体用法?C++ NodeSet::set_mid_region_node怎么用?C++ NodeSet::set_mid_region_node使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeSet
的用法示例。
在下文中一共展示了NodeSet::set_mid_region_node方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_have_any
void NodeSetTest::test_have_any()
{
NodeSet set;
set.clear();
CPPUNIT_ASSERT( !set.have_any_corner_node() );
set.set_corner_node(0);
CPPUNIT_ASSERT( set.have_any_corner_node() );
set.clear_corner_node(0);
CPPUNIT_ASSERT( !set.have_any_corner_node() );
set.set_corner_node( NodeSet::NUM_CORNER_BITS-1 );
CPPUNIT_ASSERT( set.have_any_corner_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
CPPUNIT_ASSERT( !set.have_any_mid_edge_node() );
set.set_mid_edge_node(0);
CPPUNIT_ASSERT( set.have_any_mid_edge_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear_mid_edge_node(0);
CPPUNIT_ASSERT( !set.have_any_mid_edge_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
set.set_mid_edge_node( NodeSet::NUM_EDGE_BITS-1 );
CPPUNIT_ASSERT( set.have_any_mid_edge_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear();
CPPUNIT_ASSERT( !set.have_any_mid_face_node() );
set.set_mid_face_node(0);
CPPUNIT_ASSERT( set.have_any_mid_face_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear_mid_face_node(0);
CPPUNIT_ASSERT( !set.have_any_mid_face_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
set.set_mid_face_node( NodeSet::NUM_FACE_BITS-1 );
CPPUNIT_ASSERT( set.have_any_mid_face_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear();
CPPUNIT_ASSERT( !set.have_any_mid_region_node() );
set.set_mid_region_node(0);
CPPUNIT_ASSERT( set.have_any_mid_region_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear_mid_region_node(0);
CPPUNIT_ASSERT( !set.have_any_mid_region_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
set.set_mid_region_node( NodeSet::NUM_REGION_BITS-1 );
CPPUNIT_ASSERT( set.have_any_mid_region_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear();
}
示例2: test_set_get_clear_simple
void NodeSetTest::test_set_get_clear_simple()
{
NodeSet set;
for (unsigned i = 0; i < NodeSet::NUM_CORNER_BITS; ++i) {
CPPUNIT_ASSERT( !set.corner_node(i) );
set.set_corner_node( i );
CPPUNIT_ASSERT( set.corner_node(i) );
set.clear_corner_node( i );
CPPUNIT_ASSERT( !set.corner_node(i) );
}
for (unsigned i = 0; i < NodeSet::NUM_EDGE_BITS; ++i) {
CPPUNIT_ASSERT( !set.mid_edge_node(i) );
set.set_mid_edge_node( i );
CPPUNIT_ASSERT( set.mid_edge_node(i) );
set.clear_mid_edge_node( i );
CPPUNIT_ASSERT( !set.mid_edge_node(i) );
}
for (unsigned i = 0; i < NodeSet::NUM_FACE_BITS; ++i) {
CPPUNIT_ASSERT( !set.mid_face_node(i) );
set.set_mid_face_node( i );
CPPUNIT_ASSERT( set.mid_face_node(i) );
set.clear_mid_face_node( i );
CPPUNIT_ASSERT( !set.mid_face_node(i) );
}
for (unsigned i = 0; i < NodeSet::NUM_REGION_BITS; ++i) {
CPPUNIT_ASSERT( !set.mid_region_node(i) );
set.set_mid_region_node( i );
CPPUNIT_ASSERT( set.mid_region_node(i) );
set.clear_mid_region_node( i );
CPPUNIT_ASSERT( !set.mid_region_node(i) );
}
}
示例3: test_num_nodes
void NodeSetTest::test_num_nodes()
{
NodeSet set;
set.clear();
set.set_corner_node(1);
CPPUNIT_ASSERT_EQUAL( 1u, set.num_nodes() );
set.set_corner_node(3);
CPPUNIT_ASSERT_EQUAL( 2u, set.num_nodes() );
set.set_mid_region_node(0);
CPPUNIT_ASSERT_EQUAL( 3u, set.num_nodes() );
set.set_mid_edge_node(1);
set.set_mid_edge_node(2);
CPPUNIT_ASSERT_EQUAL( 5u, set.num_nodes() );
set.set_all_nodes(HEXAHEDRON);
CPPUNIT_ASSERT_EQUAL( 27u, set.num_nodes() );
set.clear();
set.set_all_nodes(TETRAHEDRON);
CPPUNIT_ASSERT_EQUAL( 15u, set.num_nodes() );
set.clear();
set.set_all_nodes(TRIANGLE);
CPPUNIT_ASSERT_EQUAL( 7u, set.num_nodes() );
set.clear();
set.set_all_nodes(QUADRILATERAL);
CPPUNIT_ASSERT_EQUAL( 9u, set.num_nodes() );
set.clear();
set.set_all_nodes(PYRAMID);
CPPUNIT_ASSERT_EQUAL( 19u, set.num_nodes() );
set.clear();
set.set_all_nodes(PRISM);
CPPUNIT_ASSERT_EQUAL( 21u, set.num_nodes() );
}
示例4: test_clear
void NodeSetTest::test_clear()
{
NodeSet set;
set.set_corner_node(1);
set.clear();
CPPUNIT_ASSERT( !set.get_bits() );
set.set_mid_edge_node(2);
set.clear();
CPPUNIT_ASSERT( !set.get_bits() );
set.set_mid_region_node();
set.clear();
CPPUNIT_ASSERT( !set.get_bits() );
}
示例5: test_set_node
void NodeSetTest::test_set_node()
{
NodeSet set;
for (unsigned i = 0; i < NodeSet::NUM_CORNER_BITS; ++i) {
set.set_corner_node( i );
CPPUNIT_ASSERT_EQUAL( 1u << (NodeSet::CORNER_OFFSET + i), set.get_bits() );
set.clear();
}
for (unsigned i = 0; i < NodeSet::NUM_EDGE_BITS; ++i) {
set.set_mid_edge_node( i );
CPPUNIT_ASSERT_EQUAL( 1u << (NodeSet::EDGE_OFFSET + i), set.get_bits() );
set.clear();
}
for (unsigned i = 0; i < NodeSet::NUM_FACE_BITS; ++i) {
set.set_mid_face_node( i );
CPPUNIT_ASSERT_EQUAL( 1u << (NodeSet::FACE_OFFSET + i), set.get_bits() );
set.clear();
}
for (unsigned i = 0; i < NodeSet::NUM_REGION_BITS; ++i) {
set.set_mid_region_node( i );
CPPUNIT_ASSERT_EQUAL( 1u << (NodeSet::REGION_OFFSET + i), set.get_bits() );
set.clear();
}
}
示例6: sample_points
NodeSet LinearTetrahedron::sample_points( NodeSet ) const
{
NodeSet result;
result.set_mid_region_node();
return result;
}