本文整理汇总了C++中MeshType::n_vertices方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshType::n_vertices方法的具体用法?C++ MeshType::n_vertices怎么用?C++ MeshType::n_vertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshType
的用法示例。
在下文中一共展示了MeshType::n_vertices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
void test(const shared_ptr< DistanceOctree< MeshType > > & distanceOctree, const MeshType & mesh, const AABB & domainAABB, Vector3<uint_t> numBlocks)
{
Vector3<real_t> blockSize(domainAABB.xSize() / real_c(numBlocks[0]),
domainAABB.ySize() / real_c(numBlocks[1]),
domainAABB.zSize() / real_c(numBlocks[2]));
real_t maxError = blockSize.min() / real_t(10);
SetupBlockForest setupBlockforest;
setupBlockforest.addRootBlockExclusionFunction(F(distanceOctree, maxError));
setupBlockforest.addWorkloadMemorySUIDAssignmentFunction(blockforest::uniformWorkloadAndMemoryAssignment);
setupBlockforest.init(domainAABB, numBlocks[0], numBlocks[1], numBlocks[2], false, false, false);
WALBERLA_LOG_DEVEL(setupBlockforest.toString());
std::vector< Vector3<real_t> > vertexPositions;
vertexPositions.reserve(mesh.n_vertices());
for (auto vIt = mesh.vertices_begin(); vIt != mesh.vertices_end(); ++vIt)
{
vertexPositions.push_back(toWalberla(mesh.point(*vIt)));
}
std::vector< const blockforest::SetupBlock* > setupBlocks;
setupBlockforest.getBlocks(setupBlocks);
// Check wether all vertices are located in allocated blocks
std::vector< Vector3<real_t> > uncoveredVertices(vertexPositions);
for (auto bIt = setupBlocks.begin(); bIt != setupBlocks.end(); ++bIt)
{
const AABB & aabb = (*bIt)->getAABB();
uncoveredVertices.erase(std::remove_if(uncoveredVertices.begin(), uncoveredVertices.end(), PointInAABB(aabb)), uncoveredVertices.end());
}
WALBERLA_CHECK(uncoveredVertices.empty(), "Not all vertices of the mesh are located in allocated blocks!");
//setupBlockforest.assignAllBlocksToRootProcess();
//setupBlockforest.writeVTKOutput( "setupblockforest" );
}