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


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

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


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

示例1: logTraceIn

void peanoclaw::mappings::ValidateGrid::mergeWithMaster(
  const peanoclaw::Cell&           workerGridCell,
  peanoclaw::Vertex * const        workerGridVertices,
 const peano::grid::VertexEnumerator& workerEnumerator,
  peanoclaw::Cell&                 fineGridCell,
  peanoclaw::Vertex * const        fineGridVertices,
  const peano::grid::VertexEnumerator&                fineGridVerticesEnumerator,
  peanoclaw::Vertex * const        coarseGridVertices,
  const peano::grid::VertexEnumerator&                coarseGridVerticesEnumerator,
  peanoclaw::Cell&                 coarseGridCell,
  const tarch::la::Vector<DIMENSIONS,int>&                             fineGridPositionOfCell,
  int                                                                  worker,
  const peanoclaw::State&          workerState,
  peanoclaw::State&                masterState
) {
  logTraceIn( "mergeWithMaster(...)" );

  std::vector<PatchDescription> remoteData = PatchDescriptionHeap::getInstance().receiveData(
    worker,
    fineGridVerticesEnumerator.getVertexPosition(0),
    fineGridVerticesEnumerator.getLevel(),
    peano::heap::MasterWorkerCommunication
  );

  std::vector<PatchDescription>& localData = PatchDescriptionHeap::getInstance().getData(_patchDescriptionsIndex);
  localData.insert(localData.end(), remoteData.begin(), remoteData.end());

  logInfo("mergeWithMaster(...)", "Merged " << remoteData.size() << " patches: " << PatchDescriptionHeap::getInstance().getData(_patchDescriptionsIndex).size() << " entries.");

  logTraceOut( "mergeWithMaster(...)" );
}
开发者ID:unterweg,项目名称:peanoclaw,代码行数:31,代码来源:ValidateGrid.cpp

示例2:

void peanoclaw::mappings::ValidateGrid::destroyCell(
      const peanoclaw::Cell&           fineGridCell,
      peanoclaw::Vertex * const        fineGridVertices,
      const peano::grid::VertexEnumerator&                fineGridVerticesEnumerator,
      peanoclaw::Vertex * const        coarseGridVertices,
      const peano::grid::VertexEnumerator&                coarseGridVerticesEnumerator,
      peanoclaw::Cell&                 coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                             fineGridPositionOfCell
) {
  logTraceInWith4Arguments( "destroyCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );

  //TODO unterweg debug
//  std::cout<< "Destroying cell " << fineGridVerticesEnumerator.getVertexPosition(0) << ", "
//      << fineGridVerticesEnumerator.getCellSize()
//      << ", index=" << fineGridCell.getCellDescriptionIndex()
//      #ifdef Parallel
//      << ", rank=" << tarch::parallel::Node::getInstance().getRank()
//      #endif
//      << std::endl;

  _validator.deletePatchIfNotRemote(
    fineGridVerticesEnumerator.getVertexPosition(0),
    fineGridVerticesEnumerator.getLevel()
  );

  logTraceOutWith1Argument( "destroyCell(...)", fineGridCell );
}
开发者ID:unterweg,项目名称:peanoclaw,代码行数:27,代码来源:ValidateGrid.cpp

示例3: logInfo

void peanoclaw::mappings::ValidateGrid::createCell(
      peanoclaw::Cell&                 fineGridCell,
      peanoclaw::Vertex * const        fineGridVertices,
      const peano::grid::VertexEnumerator&                fineGridVerticesEnumerator,
      peanoclaw::Vertex * const        coarseGridVertices,
      const peano::grid::VertexEnumerator&                coarseGridVerticesEnumerator,
      peanoclaw::Cell&                 coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                             fineGridPositionOfCell
) {
  logTraceInWith4Arguments( "createCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );

  //TODO unterweg debug
  logInfo("", "Creating cell " << fineGridVerticesEnumerator.getVertexPosition(0) << ", "
      << fineGridVerticesEnumerator.getCellSize()
      << ", index=" << fineGridCell.getCellDescriptionIndex()
      << ",level=" << fineGridVerticesEnumerator.getLevel()
      );

  logTraceOutWith1Argument( "createCell(...)", fineGridCell );
}
开发者ID:unterweg,项目名称:peanoclaw,代码行数:20,代码来源:ValidateGrid.cpp

示例4: switchToAndAddVirtualSubgrid

void peanoclaw::interSubgridCommunication::GridLevelTransfer::stepDown(
  Patch*                               coarseSubgrid,
  Patch&                               fineSubgrid,
  peanoclaw::Vertex * const            fineGridVertices,
  const peano::grid::VertexEnumerator& fineGridVerticesEnumerator,
  bool                                 isInitializing,
  bool                                 isPeanoCellLeaf
) {

  //Switch to virtual subgrid if necessary
  if(shouldBecomeVirtualSubgrid(
      fineSubgrid,
      fineGridVertices,
      fineGridVerticesEnumerator,
      isInitializing,
      isPeanoCellLeaf
  )) {
    switchToAndAddVirtualSubgrid(fineSubgrid);
  } else if(fineSubgrid.isVirtual()) {
    //Switch to non-virtual if still virtual
    fineSubgrid.switchToNonVirtual();
  }

  //Prepare flags for subgrid
  if(!fineSubgrid.isLeaf()) {
    fineSubgrid.setWillCoarsen(peano::grid::aspects::VertexStateAnalysis::doesOneVertexCarryRefinementFlag
      (
        fineGridVertices,
        fineGridVerticesEnumerator,
        peanoclaw::records::Vertex::Erasing
      )
    );
  }
  fineSubgrid.getTimeIntervals().resetMinimalNeighborTimeConstraint();
  fineSubgrid.getTimeIntervals().resetMaximalNeighborTimeInterval();
  fineSubgrid.resetNeighboringGhostlayerBounds();
  fineSubgrid.getTimeIntervals().resetMinimalFineGridTimeInterval();

  //Get data from neighbors:
  //  - Ghostlayers data
  //  - Ghostlayer bounds
  //  - Neighbor times
  for(int i = 0; i < TWO_POWER_D; i++) {
    assertion1(fineSubgrid.getCellDescriptionIndex() != -1, fineSubgrid);
    fineGridVertices[fineGridVerticesEnumerator(i)].setAdjacentCellDescriptionIndex(i, fineSubgrid.getCellDescriptionIndex());
    fineGridVertices[fineGridVerticesEnumerator(i)].fillAdjacentGhostLayers(
      fineGridVerticesEnumerator.getLevel(),
      _useDimensionalSplitting,
      _numerics,
      fineGridVerticesEnumerator.getVertexPosition(peano::utils::dDelinearised(i, 2)),
      _subgridStatistics,
//      fineGridVerticesEnumerator.getVertexPosition(i),
      i
    );
  }

  //Data from coarse patch:
  // -> Update minimal time constraint of coarse neighbors
  if(coarseSubgrid != 0) {
    //Patch coarsePatch(coarseCellDescriptionIndex);
    if(coarseSubgrid->getTimeIntervals().shouldFineGridsSynchronize()) {
      //Set time constraint of fine grid to time of coarse grid to synch
      //on that time.
      fineSubgrid.getTimeIntervals().updateMinimalNeighborTimeConstraint(
        coarseSubgrid->getTimeIntervals().getCurrentTime() + coarseSubgrid->getTimeIntervals().getTimestepSize(),
        coarseSubgrid->getCellDescriptionIndex()
      );
    }
  }
}
开发者ID:unterweg,项目名称:peanoclaw,代码行数:70,代码来源:GridLevelTransfer.cpp

示例5: logTraceOut

void peanoclaw::mappings::ValidateGrid::prepareSendToMaster(
  peanoclaw::Cell&                       localCell,
  peanoclaw::Vertex *                    vertices,
  const peano::grid::VertexEnumerator&       verticesEnumerator, 
  const peanoclaw::Vertex * const        coarseGridVertices,
  const peano::grid::VertexEnumerator&       coarseGridVerticesEnumerator,
  const peanoclaw::Cell&                 coarseGridCell,
  const tarch::la::Vector<DIMENSIONS,int>&   fineGridPositionOfCell
) {
  logTraceInWith2Arguments( "prepareSendToMaster(...)", localCell, verticesEnumerator.toString() );

  //Assemble vector to send to master
  std::vector<PatchDescription>& workerAndLocalData = PatchDescriptionHeap::getInstance().getData(_patchDescriptionsIndex);
  std::vector<PatchDescription> localData = _validator.getAllPatches();
  for(int i = 0; i < (int)localData.size(); i++) {

    //TODO unterweg debug
//    assertion(localData[i].getIsReferenced());

    workerAndLocalData.push_back(localData[i]);
  }

//  for(size_t i = 0; i < PatchDescriptionHeap::getInstance().getData(_patchDescriptionsIndex).size(); i++) {
//    //TODO unterweg debug
////    logError("", "Prepare Send to " << tarch::parallel::NodePool::getInstance().getMasterRank() << " -- " << i << ": " << PatchDescriptionHeap::getInstance().getData(_patchDescriptionsIndex)[i].toString());
//    assertion(PatchDescriptionHeap::getInstance().getData(_patchDescriptionsIndex)[i].getIsReferenced());
//  }

  //Add non-referenced patches
//  int index = 0;
//  int numberOfEntries = 0;
//  while(numberOfEntries < CellDescriptionHeap::getInstance().getNumberOfAllocatedEntries()) {
//    if(CellDescriptionHeap::getInstance().isValidIndex(index)) {
//      if(_descriptions.find(index) == _descriptions.end()) {
//        //Found non-referenced patch
//        CellDescription& cellDescription = CellDescriptionHeap::getInstance().getData(index).at(0);
//        PatchDescription patchDescription;
//        patchDescription.setPosition(cellDescription.getPosition());
//        patchDescription.setSize(cellDescription.getSize());
//        patchDescription.setLevel(cellDescription.getLevel());
//        patchDescription.setIsRemote(cellDescription.getIsRemote());
//        patchDescription.setIsReferenced(false);
//        patchDescription.setCellDescriptionIndex(index);
//        patchDescription.setRank(tarch::parallel::Node::getInstance().getRank());
//        descriptionVector.push_back(patchDescription);
//      }
//      numberOfEntries++;
//    }
//    index++;
//  }

  //Send
  PatchDescriptionHeap::getInstance().sendData(
    _patchDescriptionsIndex,
    tarch::parallel::NodePool::getInstance().getMasterRank(),
    verticesEnumerator.getVertexPosition(0),
    verticesEnumerator.getLevel(),
    peano::heap::MasterWorkerCommunication
  );

  #ifdef Parallel
  PatchDescriptionHeap::getInstance().finishedToSendSynchronousData();
  #endif

  logTraceOut( "prepareSendToMaster(...)" );
}
开发者ID:unterweg,项目名称:peanoclaw,代码行数:66,代码来源:ValidateGrid.cpp


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