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


C++ MeshType::point方法代码示例

本文整理汇总了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 );
    }
}
开发者ID:Danniel-UCAS,项目名称:lifev,代码行数:17,代码来源:NeighborMarker.hpp

示例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" );
}
开发者ID:lssfau,项目名称:walberla,代码行数:42,代码来源:MeshBlockExclusionTest.cpp


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