本文整理汇总了C++中MutableMesh::ReIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ MutableMesh::ReIndex方法的具体用法?C++ MutableMesh::ReIndex怎么用?C++ MutableMesh::ReIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MutableMesh
的用法示例。
在下文中一共展示了MutableMesh::ReIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestDeleteFirstOrder
void TestDeleteFirstOrder() throw(Exception)
{
#ifdef CHASTE_VTK
VtkMeshReader<1,3> mesh_reader("lung/test/data/TestSubject002MajorAirways.vtu");
MutableMesh<1,3> mesh;
mesh.ConstructFromMeshReader(mesh_reader);
//Assign valid radii
for(unsigned node_index = 0; node_index < mesh.GetNumNodes(); ++node_index)
{
mesh.GetNode(node_index)->AddNodeAttribute(1.0);
}
TS_ASSERT_EQUALS(mesh.GetNumNodes(), 12065u);
TS_ASSERT_EQUALS(mesh.GetNumElements(), 12064u);
MajorAirwaysCentreLinesCleaner cleaner(mesh, 0u);
cleaner.CleanUsingHorsfieldOrder(1u);
NodeMap node_map(mesh.GetNumAllNodes());
mesh.ReIndex(node_map);
//Confirmed visually to be correct
TS_ASSERT_EQUALS(mesh.GetNumNodes(), 3683u);
TS_ASSERT_EQUALS(mesh.GetNumElements(), 3682u);
// Uncomment to visualise
// VtkMeshWriter<1,3> mesh_writer("TestMajorAirwaysCentreLinesCleaner", "Novartis002Trimmed");
// mesh_writer.WriteFilesUsingMesh(mesh);
#endif //CHASTE_VTK
}
示例2: TestDeleteOrderSimpleMesh
void TestDeleteOrderSimpleMesh() throw(Exception)
{
TrianglesMeshReader<1,3> mesh_reader("lung/test/airway_generation/data/test_major_airways_mesh");
MutableMesh<1,3> mesh;
mesh.ConstructFromMeshReader(mesh_reader);
//Assign valid radii
for(unsigned node_index = 0; node_index < mesh.GetNumNodes(); ++node_index)
{
mesh.GetNode(node_index)->rGetNodeAttributes()[0] = 1.0;
}
TS_ASSERT_EQUALS(mesh.GetNumNodes(), 6u);
TS_ASSERT_EQUALS(mesh.GetNumElements(), 5u);
MajorAirwaysCentreLinesCleaner cleaner(mesh, 0u);
cleaner.CleanUsingHorsfieldOrder(1u);
NodeMap node_map(mesh.GetNumAllNodes());
mesh.ReIndex(node_map);
TS_ASSERT_EQUALS(mesh.GetNumNodes(), 2u);
TS_ASSERT_EQUALS(mesh.GetNumElements(), 1u);
TS_ASSERT_DELTA(mesh.GetNode(0u)->rGetLocation()[0], 0.0, 1e-6);
TS_ASSERT_DELTA(mesh.GetNode(0u)->rGetLocation()[1], 0.0, 1e-6);
TS_ASSERT_DELTA(mesh.GetNode(0u)->rGetLocation()[2], -2.0, 1e-6);
TS_ASSERT_DELTA(mesh.GetNode(1u)->rGetLocation()[0], 0.0, 1e-6);
TS_ASSERT_DELTA(mesh.GetNode(1u)->rGetLocation()[1], 0.0, 1e-6);
TS_ASSERT_DELTA(mesh.GetNode(1u)->rGetLocation()[2], 0.0, 1e-6);
}