本文整理汇总了C++中MeshType::point方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshType::point方法的具体用法?C++ MeshType::point怎么用?C++ MeshType::point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshType
的用法示例。
在下文中一共展示了MeshType::point方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createPointNeighbors
void createPointNeighbors ( MeshType const& mesh, neighborList_Type& neighborList )
{
neighborList.resize ( mesh.numGlobalPoints() );
// generate point neighbors by watching edges
// note: this can be based also on faces or volumes
for ( UInt ie = 0; ie < mesh.numEdges(); ie++ )
{
ID id0 = mesh.edge ( ie ).point ( 0 ).id();
ID id1 = mesh.edge ( ie ).point ( 1 ).id();
ASSERT ( mesh.point ( id0 ).id() == id0 && mesh.point ( id1 ).id() == id1,
"the mesh has been reordered, the point must be found" );
neighborList[ id0 ].insert ( id1 );
neighborList[ id1 ].insert ( id0 );
}
}
示例2: 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" );
}