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


C++ VertexEnumerator::getCellFlags方法代码示例

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


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

示例1: assertion

void particles::pit::adapters::MoveParticlesAndPlot2VTKGridVisualiser_0::leaveCell(
      particles::pit::Cell&           fineGridCell,
      particles::pit::Vertex * const  fineGridVertices,
      const peano::grid::VertexEnumerator&          fineGridVerticesEnumerator,
      particles::pit::Vertex * const  coarseGridVertices,
      const peano::grid::VertexEnumerator&          coarseGridVerticesEnumerator,
      particles::pit::Cell&           coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfCell
) {
  #ifdef Parallel
  if (fineGridCell.isLeaf() && !fineGridCell.isAssignedToRemoteRank()) {
  #else
  if (fineGridCell.isLeaf()) {
  #endif
    assertion( DIMENSIONS==2 || DIMENSIONS==3 );
    int vertexIndex[TWO_POWER_D];
     dfor2(i)
      tarch::la::Vector<DIMENSIONS,double> currentVertexPosition = fineGridVerticesEnumerator.getVertexPosition(i);
      assertion2 ( _vertex2IndexMap.find(currentVertexPosition) != _vertex2IndexMap.end(), currentVertexPosition, fineGridVertices[ fineGridVerticesEnumerator(i) ].toString() );
      vertexIndex[iScalar] = _vertex2IndexMap[currentVertexPosition];
    enddforx
  
    int cellIndex;
    if (DIMENSIONS==2) {
      cellIndex = _cellWriter->plotQuadrangle(vertexIndex);
    }
    if (DIMENSIONS==3) {
      cellIndex = _cellWriter->plotHexahedron(vertexIndex);
    }
    
    _cellStateWriter->plotCell(cellIndex,fineGridVerticesEnumerator.getCellFlags());
    _cellNormWriterX->plotCell(cellIndex,(fineGridCell.getMyNorm())[0]);
    _cellNormWriterY->plotCell(cellIndex,(fineGridCell.getMyNorm())[1]);
  }
}


void particles::pit::adapters::MoveParticlesAndPlot2VTKGridVisualiser_0::beginIteration(
  particles::pit::State&  solverState
) {
  assertion( _vtkWriter==0 );
  
  _vtkWriter = new tarch::plotter::griddata::unstructured::vtk::VTKTextFileWriter();
  
  _vertexWriter     = _vtkWriter->createVertexWriter();
  _cellWriter       = _vtkWriter->createCellWriter();
  
  _vertexTypeWriter               = _vtkWriter->createVertexDataWriter(particles::pit::Vertex::Records::getInsideOutsideDomainMapping()+"/Hanging=-1" ,1);
  _vertexRefinementControlWriter  = _vtkWriter->createVertexDataWriter(particles::pit::Vertex::Records::getRefinementControlMapping() ,1);
  _vertexAdjacentCellsHeight      = _vtkWriter->createVertexDataWriter( peano::grid::getCellFlagsLegend(),1);

  _cellStateWriter                = _vtkWriter->createCellDataWriter( "cell-flag(>=-1=stationary,-1=parallel-boundary,<=-2=not-stationary" ,1);
  _cellNormWriterX                = _vtkWriter->createCellDataWriter( "Norm,X-direction" ,1);
  _cellNormWriterY                = _vtkWriter->createCellDataWriter( "Norm,Y-direction" ,1);
}
开发者ID:POWER-Morzh,项目名称:particles,代码行数:55,代码来源:MoveParticlesAndPlot2VTKGridVisualiser_0.cpp


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