void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs) { // Receive and initialise processorPolyPatch data processorPolyPatch::calcGeometry(pBufs); if (Pstream::parRun()) { // Where do we store the calculated transformation? // - on the processor patch? // - on the underlying cyclic patch? // - or do we not auto-calculate the transformation but // have option of reading it. // Update underlying cyclic halves. Need to do both since only one // half might be present as a processorCyclic. coupledPolyPatch& pp = const_cast<coupledPolyPatch&>(referPatch()); pp.calcGeometry ( *this, faceCentres(), faceAreas(), faceCellCentres(), neighbFaceCentres(), neighbFaceAreas(), neighbFaceCellCentres() ); if (isA<cyclicPolyPatch>(pp)) { const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp); const_cast<cyclicPolyPatch&>(cpp.neighbPatch()).calcGeometry ( *this, neighbFaceCentres(), neighbFaceAreas(), neighbFaceCellCentres(), faceCentres(), faceAreas(), faceCellCentres() ); } } }
int Foam::processorCyclicPolyPatch::tag() const { if (tag_ == -1) { // Get unique tag to use for all comms. Make sure that both sides // use the same tag const cyclicPolyPatch& cycPatch = refCast<const cyclicPolyPatch> ( referPatch() ); if (owner()) { tag_ = Hash<word>()(cycPatch.name()) % 32768u; } else { tag_ = Hash<word>()(cycPatch.neighbPatch().name()) % 32768u; } if (tag_ == Pstream::msgType() || tag_ == -1) { FatalErrorIn("processorCyclicPolyPatch::tag() const") << "Tag calculated from cyclic patch name " << tag_ << " is the same as the current message type " << Pstream::msgType() << " or -1" << nl << "Please set a non-conflicting, unique, tag by hand" << " using the 'tag' entry" << exit(FatalError); } if (debug) { Pout<< "processorCyclicPolyPatch " << name() << " uses tag " << tag_ << endl; } } return tag_; }