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


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

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


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

示例1: pfor

void particles::pidt::mappings::MoveParticles::touchVertexFirstTime(
  particles::pidt::Vertex&                     fineGridVertex,
  const tarch::la::Vector<DIMENSIONS,double>&  fineGridX,
  const tarch::la::Vector<DIMENSIONS,double>&  fineGridH,
  particles::pidt::Vertex * const              coarseGridVertices,
  const peano::grid::VertexEnumerator&         coarseGridVerticesEnumerator,
  particles::pidt::Cell&                       coarseGridCell,
  const tarch::la::Vector<DIMENSIONS,int>&     fineGridPositionOfVertex
) {
  logTraceInWith6Arguments( "touchVertexFirstTime(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );

  #ifdef Parallel
  if (fineGridVertex.isAdjacentToRemoteRank()) {
    fineGridVertex.particlesWereAddedToThisVertex();
  }
  else {
    fineGridVertex.noParticlesWereAddedToThisVertex();
  }
  #else
  fineGridVertex.noParticlesWereAddedToThisVertex();
  #endif

  const int vertexIndex = fineGridVertex.getVertexIndex();
  typedef std::vector<particles::pidt::records::Particle>  ParticleContainer;
  ParticleContainer& sourceVertexParticles = ParticleHeap::getInstance().getData(vertexIndex);

  pfor(i,0,static_cast<int>(sourceVertexParticles.size()),100)
    particles::pidt::records::Particle& currentParticle = sourceVertexParticles.at(i);
    assertion(
      currentParticle.getMovedParticle() == particles::pidt::records::Particle::New ||
      currentParticle.getMovedParticle() == particles::pidt::records::Particle::Moved
    );
    assertion1(
      tarch::la::allGreaterEquals(currentParticle._persistentRecords._x,0.0),
      currentParticle.toString()
    );
    assertion1(
      tarch::la::allSmallerEquals(currentParticle._persistentRecords._x,1.0),
      currentParticle.toString()
    );

    currentParticle.setMovedParticle( particles::pidt::records::Particle::NotMovedYet );
  endpfor

  logTraceOutWith1Argument( "touchVertexFirstTime(...)", fineGridVertex );
}
开发者ID:POWER-Morzh,项目名称:particles2,代码行数:46,代码来源:MoveParticles.cpp

示例2:

void peanoclaw::mappings::Cleanup::touchVertexLastTime(
    peanoclaw::Vertex&         fineGridVertex,
    const tarch::la::Vector<DIMENSIONS,double>&                    fineGridX,
    const tarch::la::Vector<DIMENSIONS,double>&                    fineGridH,
    peanoclaw::Vertex * const  coarseGridVertices,
    const peano::grid::VertexEnumerator&          coarseGridVerticesEnumerator,
    peanoclaw::Cell&           coarseGridCell,
    const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfVertex
) {
    logTraceInWith6Arguments( "touchVertexLastTime(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );
    // @todo Insert your code here
    logTraceOutWith1Argument( "touchVertexLastTime(...)", fineGridVertex );
}
开发者ID:unterweg,项目名称:peanoclaw,代码行数:13,代码来源:Cleanup.cpp

示例3:

void peanoclaw::mappings::ValidateGrid::touchVertexLastTime(
      peanoclaw::Vertex&         fineGridVertex,
      const tarch::la::Vector<DIMENSIONS,double>&                    fineGridX,
      const tarch::la::Vector<DIMENSIONS,double>&                    fineGridH,
      peanoclaw::Vertex * const  coarseGridVertices,
      const peano::grid::VertexEnumerator&          coarseGridVerticesEnumerator,
      peanoclaw::Cell&           coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfVertex
) {
  logTraceInWith6Arguments( "touchVertexLastTime(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );

  _validator.findAdjacentPatches(
    fineGridVertex,
    fineGridX,
    coarseGridVerticesEnumerator.getLevel() + 1,
    #ifdef Parallel
    tarch::parallel::Node::getInstance().getRank()
    #else
    0
    #endif
  );

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

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