本文整理汇总了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 );
}
示例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 );
}
示例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 );
}
示例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(...)" );
}