59 <<
"primitive face zone patch already calculated" 72 const faceList&
f = meshZones().mesh().faces();
81 patch[facei] = f[addr[facei]].reverseFace();
85 patch[facei] = f[addr[facei]];
105 if (masterCellsPtr_ || slaveCellsPtr_)
108 <<
"cell layers already calculated" 116 const labelList& own = meshZones().mesh().faceOwner();
117 const labelList& nei = meshZones().mesh().faceNeighbour();
121 const boolList& faceFlip = flipMap();
131 label ownCelli = own[mf[facei]];
134 meshZones().mesh().isInternalFace(mf[facei])
139 if (!faceFlip[facei])
142 mc[facei] = neiCelli;
143 sc[facei] = ownCelli;
147 mc[facei] = ownCelli;
148 sc[facei] = neiCelli;
157 if (size() != flipMap_.size())
160 <<
"Size of addressing: " << size()
161 <<
" size of flip map: " << flipMap_.size()
168 const label nFaces = meshZones().mesh().faceOwner().
size();
170 bool hasWarned =
false;
173 if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
176 <<
"Illegal face index " << mf[i] <<
" outside range 0.." 195 zone(name, addr, index),
199 masterCellsPtr_(
nullptr),
200 slaveCellsPtr_(
nullptr),
216 zone(name, move(addr), index),
220 masterCellsPtr_(
nullptr),
221 slaveCellsPtr_(
nullptr),
236 zone(name, dict, this->labelsName, index),
237 flipMap_(dict.
lookup(
"flipMap")),
240 masterCellsPtr_(
nullptr),
241 slaveCellsPtr_(
nullptr),
257 zone(fz, addr, index),
261 masterCellsPtr_(
nullptr),
262 slaveCellsPtr_(
nullptr),
278 zone(fz, move(addr), index),
282 masterCellsPtr_(
nullptr),
283 slaveCellsPtr_(
nullptr),
325 if (!masterCellsPtr_)
330 return *masterCellsPtr_;
341 return *slaveCellsPtr_;
352 operator()().meshEdges
354 meshZones().
mesh().edges(),
355 meshZones().
mesh().pointEdges()
394 boolList newFlipMap(flipMap_.size());
401 const label facei = operator[](i);
403 if (faceMap[facei] >= 0)
405 newAddressing[nFaces] = faceMap[facei];
406 newFlipMap[nFaces] = flipMap_[i];
412 newFlipMap.setSize(nFaces);
414 transfer(newAddressing);
415 flipMap_.transfer(newFlipMap);
430 bool hasError =
false;
441 const label facei = operator[](i);
456 const label facei = operator[](i);
459 if (patchi != -1 && bm[patchi].coupled())
464 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
470 Pout<<
" ***Problem with faceZone " << index()
471 <<
" named " <<
name()
472 <<
". Face " << facei
473 <<
" on coupled patch " 475 <<
" is not consistent with its coupled neighbour." 484 else if (myZoneFlip[bFacei] == neiZoneFlip[bFacei])
491 Pout<<
" ***Problem with faceZone " << index()
492 <<
" named " <<
name()
493 <<
". Face " << facei
494 <<
" on coupled patch " 496 <<
" does not have consistent flipMap" 497 <<
" across coupled faces." 518 patchPtr_->movePoints(p);
525 << nl << static_cast<const labelList&>(*this)
556 flipMap_ = move(zn.flipMap_);
565 os.
check(
"Ostream& operator<<(Ostream&, const faceZone&");
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual void clearAddressing()
Clear addressing.
#define forAll(list, i)
Loop across all elements in list.
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 word & name() const
Return name.
label localID(const label globalID) const
Map storing the local index for every global index. Used to find.
virtual void writeDict(Ostream &) const
Write dictionary.
void calcFaceZonePatch() const
Build primitive patch.
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 bool check(const char *operation) const
Check IOstream status for given operation.
label nInternalFaces() const
virtual ~faceZone()
Destructor.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & masterCells() const
Return labels of master cells (cells next to the master face.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised. Return.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
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.
void calcCellLayers() const
Calculate master and slave face layer.
A list of faces which address into the list of points.
A class for handling words, derived from string.
virtual bool checkDefinition(const bool report=false) const =0
Check zone definition. Return true if in error.
void operator=(const faceZone &)
Assignment to zone, clearing demand-driven data.
List< label > labelList
A List of labels.
const labelList & meshEdges() const
Return global edge index for local edges.
void checkAddressing() const
Check addressing.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
virtual void write(Ostream &) const
Write.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
faceZone(const word &name, const labelUList &addr, const boolList &fm, const label index, const meshFaceZones &mz)
Construct from components.
defineTypeNameAndDebug(combustionModel, 0)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
const labelList & slaveCells() const
Return labels of slave cells.
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 to UList operator. Takes linear time.
boolList flipMap_
Flip map for all faces in the zone. Set to true if the.
void setSize(const label)
Reset size of List.
Template functions to aid in the implementation of demand driven data.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
virtual void updateMesh(const mapPolyMesh &)
Update for changes in topology.
Ostream & operator<<(Ostream &, const ensightPart &)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
virtual bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
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.
const meshFaceZones & meshZones() const
Return meshZones reference.
void deleteDemandDrivenData(DataPtr &dataPtr)
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
void operator=(const zone &)
Assignment operator.
const primitiveFacePatch & operator()() const
Return reference to primitive patch.
const labelList & reverseFaceMap() const
Reverse face map.
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.