49 void Foam::faceZone::calcFaceZonePatch()
const
53 Info<<
"void faceZone::calcFaceZonePatch() const : "
54 <<
"Calculating primitive patch"
62 "void faceZone::calcFaceZonePatch() const"
63 ) <<
"primitive face zone patch already calculated"
85 patch[faceI] = f[addr[faceI]].reverseFace();
89 patch[faceI] = f[addr[faceI]];
95 Info<<
"void faceZone::calcFaceZonePatch() const : "
96 <<
"Finished calculating primitive patch"
104 if (!faceLookupMapPtr_)
109 return *faceLookupMapPtr_;
113 void Foam::faceZone::calcFaceLookupMap()
const
117 Info<<
"void faceZone::calcFaceLookupMap() const : "
118 <<
"Calculating face lookup map"
122 if (faceLookupMapPtr_)
126 "void faceZone::calcFaceLookupMap() const"
127 ) <<
"face lookup map already calculated"
133 faceLookupMapPtr_ =
new Map<label>(2*addr.size());
134 Map<label>& flm = *faceLookupMapPtr_;
138 flm.insert(addr[faceI], faceI);
143 Info<<
"void faceZone::calcFaceLookupMap() const : "
144 <<
"Finished calculating face lookup map"
150 void Foam::faceZone::calcCellLayers()
const
154 Info<<
"void Foam::faceZone::calcCellLayers() const : "
155 <<
"calculating master cells"
161 if (masterCellsPtr_ || slaveCellsPtr_)
164 <<
"cell layers already calculated"
172 const labelList& own = zoneMesh().mesh().faceOwner();
173 const labelList& nei = zoneMesh().mesh().faceNeighbour();
177 const boolList& faceFlip = flipMap();
179 masterCellsPtr_ =
new labelList(mf.size());
182 slaveCellsPtr_ =
new labelList(mf.size());
187 label ownCellI = own[mf[faceI]];
190 zoneMesh().mesh().isInternalFace(mf[faceI])
195 if (!faceFlip[faceI])
198 mc[faceI] = neiCellI;
199 sc[faceI] = ownCellI;
203 mc[faceI] = ownCellI;
204 sc[faceI] = neiCellI;
213 void Foam::faceZone::checkAddressing()
const
215 if (size() != flipMap_.size())
217 FatalErrorIn(
"void Foam::faceZone::checkAddressing() const")
218 <<
"Different sizes of the addressing and flipMap arrays. "
219 <<
"Size of addressing: " << size()
220 <<
" size of flip map: " << flipMap_.size()
229 Foam::faceZone::faceZone
244 masterCellsPtr_(NULL),
245 slaveCellsPtr_(NULL),
247 faceLookupMapPtr_(NULL)
253 Foam::faceZone::faceZone
268 masterCellsPtr_(NULL),
269 slaveCellsPtr_(NULL),
271 faceLookupMapPtr_(NULL)
278 Foam::faceZone::faceZone
288 flipMap_(dict.
lookup(
"flipMap")),
292 masterCellsPtr_(NULL),
293 slaveCellsPtr_(NULL),
295 faceLookupMapPtr_(NULL)
303 Foam::faceZone::faceZone
318 masterCellsPtr_(NULL),
319 slaveCellsPtr_(NULL),
321 faceLookupMapPtr_(NULL)
327 Foam::faceZone::faceZone
342 masterCellsPtr_(NULL),
343 slaveCellsPtr_(NULL),
345 faceLookupMapPtr_(NULL)
367 if (flmIter == flm.
end())
397 if (!masterCellsPtr_)
402 return *masterCellsPtr_;
413 return *slaveCellsPtr_;
446 operator()().meshEdges
448 zoneMesh().
mesh().edges(),
449 zoneMesh().
mesh().pointEdges()
487 boolList newFlipMap(flipMap_.size());
494 label faceI = operator[](i);
496 if (faceMap[faceI] >= 0)
498 newAddressing[nFaces] = faceMap[faceI];
499 newFlipMap[nFaces] = flipMap_[i];
505 newFlipMap.setSize(nFaces);
507 transfer(newAddressing);
508 flipMap_.transfer(newFlipMap);
516 bool boundaryError =
false;
520 if (addr[i] < 0 || addr[i] >= zoneMesh().
mesh().faces().size())
522 boundaryError =
true;
528 "bool faceZone::checkDefinition("
529 "const bool report) const"
530 ) <<
"Zone " <<
name()
531 <<
" contains invalid face label " << addr[i] <<
nl
532 <<
"Valid face labels are 0.."
533 << zoneMesh().mesh().faces().size()-1 <<
endl;
537 return boundaryError;
546 bool boundaryError =
false;
557 label faceI = operator[](i);
572 label faceI = operator[](i);
576 if (patchI != -1 && bm[patchI].coupled())
581 if (myZoneFace[bFaceI] != neiZoneFace[bFaceI])
583 boundaryError =
true;
587 Pout<<
" ***Problem with faceZone " << index()
588 <<
" named " <<
name()
589 <<
". Face " << faceI
590 <<
" on coupled patch "
592 <<
" is not consistent with its coupled neighbour."
596 else if (myZoneFlip[bFaceI] == neiZoneFlip[bFaceI])
599 boundaryError =
true;
603 Pout<<
" ***Problem with faceZone " << index()
604 <<
" named " <<
name()
605 <<
". Face " << faceI
606 <<
" on coupled patch "
608 <<
" does not have consistent flipMap"
609 <<
" across coupled faces."
625 patchPtr_->movePoints(p);
632 << nl << static_cast<const labelList&>(*this)
642 writeEntry(
"faceLabels", os);
654 os.
check(
"Ostream& operator<<(Ostream& f, const faceZone& p");