当前位置: 首页>>代码示例>>C++>>正文


C++ NodeSet::set_all_nodes方法代码示例

本文整理汇总了C++中NodeSet::set_all_nodes方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeSet::set_all_nodes方法的具体用法?C++ NodeSet::set_all_nodes怎么用?C++ NodeSet::set_all_nodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NodeSet的用法示例。


在下文中一共展示了NodeSet::set_all_nodes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test_clear_all

void NodeSetTest::test_clear_all()
{
  const EntityTopology type = HEXAHEDRON;
  NodeSet set;
  set.set_all_nodes( type );
  set.clear_all_corner_nodes();
  CPPUNIT_ASSERT( check_all( type, set, 0, false ) );
  CPPUNIT_ASSERT( check_all( type, set, 1, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 2, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 3, true ) );
  set.set_all_nodes( type );
  set.clear_all_mid_edge_nodes();
  CPPUNIT_ASSERT( check_all( type, set, 0, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 1, false ) );
  CPPUNIT_ASSERT( check_all( type, set, 2, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 3, true ) );
  set.set_all_nodes( type );
  set.clear_all_mid_face_nodes();
  CPPUNIT_ASSERT( check_all( type, set, 0, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 1, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 2, false ) );
  CPPUNIT_ASSERT( check_all( type, set, 3, true ) );
  set.set_all_nodes( type );
  set.clear_all_mid_region_nodes();
  CPPUNIT_ASSERT( check_all( type, set, 0, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 1, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 2, true ) );
  CPPUNIT_ASSERT( check_all( type, set, 3, false ) );
}
开发者ID:haripandey,项目名称:trilinos,代码行数:29,代码来源:NodeSetTest.cpp

示例2: test_clear_node

void NodeSetTest::test_clear_node()
{
  const EntityTopology type = HEXAHEDRON;
  NodeSet set;
  NodeSet::BitSet expected;
  for (unsigned i = 0; i < TopologyInfo::corners(type); ++i) {
    set.set_all_nodes(type);
    expected = set.get_bits() & ~(1u << (NodeSet::CORNER_OFFSET + i));
    set.clear_corner_node( i );
    CPPUNIT_ASSERT_EQUAL( expected, set.get_bits() );
  }
  for (unsigned i = 0; i < TopologyInfo::edges(type); ++i) {
    set.set_all_nodes(type);
    expected = set.get_bits() & ~(1u << (NodeSet::EDGE_OFFSET + i));
    set.clear_mid_edge_node( i );
    CPPUNIT_ASSERT_EQUAL( expected, set.get_bits() );
  }
  for (unsigned i = 0; i < TopologyInfo::faces(type); ++i) {
    set.set_all_nodes(type);
    expected = set.get_bits() & ~(1u << (NodeSet::FACE_OFFSET + i));
    set.clear_mid_face_node( i );
    CPPUNIT_ASSERT_EQUAL( expected, set.get_bits() );
  }

  set.set_all_nodes(type);
  expected = set.get_bits() & ~(1u << (NodeSet::REGION_OFFSET));
  set.clear_mid_region_node( 0 );
  CPPUNIT_ASSERT_EQUAL( expected, set.get_bits() );
}
开发者ID:haripandey,项目名称:trilinos,代码行数:29,代码来源:NodeSetTest.cpp

示例3: test_num_before

void NodeSetTest::test_num_before()
{
  const EntityTopology type = HEXAHEDRON;
  NodeSet set;
  set.clear();
  set.set_mid_face_node( 2 );
  CPPUNIT_ASSERT_EQUAL( 0u, set.num_before_mid_face( 2 ) );
  CPPUNIT_ASSERT_EQUAL( 1u, set.num_before_mid_face( 3 ) );
  set.set_corner_node( 0 );
  CPPUNIT_ASSERT_EQUAL( 1u, set.num_before_mid_face( 2 ) );
  CPPUNIT_ASSERT_EQUAL( 2u, set.num_before_mid_face( 3 ) );
  CPPUNIT_ASSERT_EQUAL( 0u, set.num_before_corner( 0 ) );
  CPPUNIT_ASSERT_EQUAL( 1u, set.num_before_corner( 1 ) );
  set.set_all_corner_nodes( type );
  CPPUNIT_ASSERT_EQUAL( TopologyInfo::corners(type), set.num_before_mid_edge(0) );
  CPPUNIT_ASSERT_EQUAL( TopologyInfo::corners(type)-1, set.num_before_corner(TopologyInfo::corners(type)-1) );
  CPPUNIT_ASSERT_EQUAL( 0u, set.num_before_corner(0) );
  CPPUNIT_ASSERT_EQUAL( 1u, set.num_before_corner(1) );
  CPPUNIT_ASSERT_EQUAL( 2u, set.num_before_corner(2) );
  CPPUNIT_ASSERT_EQUAL( 3u, set.num_before_corner(3) );
  CPPUNIT_ASSERT_EQUAL( 4u, set.num_before_corner(4) );
  
  const unsigned total_nodes = 27;
  set.set_all_nodes( type );
  CPPUNIT_ASSERT_EQUAL( total_nodes - 1, set.num_before_mid_region( 0 ) );
  set.clear_mid_edge_node( 0 );
  CPPUNIT_ASSERT_EQUAL( total_nodes - 2, set.num_before_mid_region( 0 ) );
  set.clear_mid_edge_node( 1 );
  CPPUNIT_ASSERT_EQUAL( total_nodes - 3, set.num_before_mid_region( 0 ) );
}
开发者ID:haripandey,项目名称:trilinos,代码行数:30,代码来源:NodeSetTest.cpp

示例4: 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() );
}
开发者ID:haripandey,项目名称:trilinos,代码行数:31,代码来源:NodeSetTest.cpp


注:本文中的NodeSet::set_all_nodes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。