58 <<
"primitive face zone patch already calculated" 71 const faceList&
f = zoneMesh().mesh().faces();
80 patch[facei] = f[addr[facei]].reverseFace();
84 patch[facei] = f[addr[facei]];
104 if (masterCellsPtr_ || slaveCellsPtr_)
107 <<
"cell layers already calculated" 115 const labelList& own = zoneMesh().mesh().faceOwner();
116 const labelList& nei = zoneMesh().mesh().faceNeighbour();
120 const boolList& faceFlip = flipMap();
130 label ownCelli = own[mf[facei]];
133 zoneMesh().mesh().isInternalFace(mf[facei])
138 if (!faceFlip[facei])
141 mc[facei] = neiCelli;
142 sc[facei] = ownCelli;
146 mc[facei] = ownCelli;
147 sc[facei] = neiCelli;
156 if (size() != flipMap_.size())
159 <<
"Size of addressing: " << size()
160 <<
" size of flip map: " << flipMap_.size()
167 const label nFaces = zoneMesh().mesh().faceOwner().
size();
169 bool hasWarned =
false;
172 if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
175 <<
"Illegal face index " << mf[i] <<
" outside range 0.." 185 Foam::faceZone::faceZone
194 zone(name, addr, index),
198 masterCellsPtr_(NULL),
199 slaveCellsPtr_(NULL),
206 Foam::faceZone::faceZone
215 zone(name, addr, index),
219 masterCellsPtr_(NULL),
220 slaveCellsPtr_(NULL),
227 Foam::faceZone::faceZone
235 zone(name, dict, this->labelsName, index),
236 flipMap_(dict.
lookup(
"flipMap")),
239 masterCellsPtr_(NULL),
240 slaveCellsPtr_(NULL),
247 Foam::faceZone::faceZone
256 zone(fz, addr, index),
260 masterCellsPtr_(NULL),
261 slaveCellsPtr_(NULL),
268 Foam::faceZone::faceZone
277 zone(fz, addr, index),
281 masterCellsPtr_(NULL),
282 slaveCellsPtr_(NULL),
324 if (!masterCellsPtr_)
329 return *masterCellsPtr_;
340 return *slaveCellsPtr_;
351 operator()().meshEdges
353 zoneMesh().
mesh().edges(),
354 zoneMesh().
mesh().pointEdges()
393 boolList newFlipMap(flipMap_.size());
400 const label facei = operator[](i);
402 if (faceMap[facei] >= 0)
404 newAddressing[nFaces] = faceMap[facei];
405 newFlipMap[nFaces] = flipMap_[i];
411 newFlipMap.setSize(nFaces);
413 transfer(newAddressing);
414 flipMap_.transfer(newFlipMap);
429 bool hasError =
false;
440 const label facei = operator[](i);
455 const label facei = operator[](i);
458 if (patchi != -1 && bm[patchi].coupled())
463 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
469 Pout<<
" ***Problem with faceZone " << index()
470 <<
" named " <<
name()
471 <<
". Face " << facei
472 <<
" on coupled patch " 474 <<
" is not consistent with its coupled neighbour." 483 else if (myZoneFlip[bFacei] == neiZoneFlip[bFacei])
490 Pout<<
" ***Problem with faceZone " << index()
491 <<
" named " <<
name()
492 <<
". Face " << facei
493 <<
" on coupled patch " 495 <<
" does not have consistent flipMap" 496 <<
" across coupled faces." 517 patchPtr_->movePoints(p);
524 << nl << static_cast<const labelList&>(*this)
534 writeEntry(this->labelsName, os);
546 os.
check(
"Ostream& operator<<(Ostream&, const faceZone&");
A simple container for copying or transferring objects of type <T>.
virtual void clearAddressing()
Clear addressing.
#define forAll(list, i)
Loop across all elements in list.
const labelList & slaveCells() const
Return labels of slave cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void resetAddressing(const labelUList &, const boolList &)
Reset addressing and flip map (clearing demand-driven data)
const labelList & meshEdges() const
Return global edge index for local edges.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual ~faceZone()
Destructor.
void checkAddressing() const
Check addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void write(Ostream &) const
Write.
void writeEntry(Ostream &) const
Write the UList as a dictionary entry.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual void movePoints(const pointField &)
Correct patch after moving points.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
A list of faces which address into the list of points.
const labelList & reverseFaceMap() const
Reverse face map.
A class for handling words, derived from string.
label localID(const label globalID) const
Map storing the local index for every global index. Used to find.
virtual bool checkDefinition(const bool report=false) const =0
Check zone definition. Return true if in error.
List< label > labelList
A List of labels.
void calcFaceZonePatch() const
Build primitive patch.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised. Return.
errorManip< error > abort(error &err)
const faceZoneMesh & zoneMesh() const
Return zoneMesh reference.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual void writeDict(Ostream &) const
Write dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
PrimitivePatch< face, List, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
virtual bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
word name(const complex &)
Return a string representation of a complex.
virtual void clearAddressing()
Clear addressing.
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
void operator=(const UList< label > &)
Assignment from UList operator. Takes linear time.
void setSize(const label)
Reset size of List.
Template functions to aid in the implementation of demand driven data.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#define WarningInFunction
Report a warning using Foam::Warning.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
virtual void updateMesh(const mapPolyMesh &)
Update for changes in topology.
Ostream & operator<<(Ostream &, const ensightPart &)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
void calcCellLayers() const
Calculate master and slave face layer.
void deleteDemandDrivenData(DataPtr &dataPtr)
const labelList & masterCells() const
Return labels of master cells (cells next to the master face.
label nInternalFaces() const
const primitiveFacePatch & operator()() const
Return reference to primitive patch.
const word & name() const
Return name.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
#define InfoInFunction
Report an information message using Foam::Info.