Go to the documentation of this file.
52 void Foam::faceZone::setFlipMap(
const bool val)
77 <<
"primitive face zone patch already calculated"
90 const faceList&
f = zoneMesh().mesh().faces();
99 patch[facei] =
f[addr[facei]].reverseFace();
103 patch[facei] =
f[addr[facei]];
117 if (masterCellsPtr_ || slaveCellsPtr_)
120 <<
"cell layers already calculated"
128 const labelList& own = zoneMesh().mesh().faceOwner();
129 const labelList& nei = zoneMesh().mesh().faceNeighbour();
133 const boolList& faceFlip = flipMap();
135 masterCellsPtr_ =
new labelList(mf.size());
138 slaveCellsPtr_ =
new labelList(mf.size());
143 const label ownCelli = own[mf[facei]];
144 const label neiCelli =
146 zoneMesh().mesh().isInternalFace(mf[facei])
151 if (!faceFlip[facei])
154 mc[facei] = neiCelli;
155 sc[facei] = ownCelli;
159 mc[facei] = ownCelli;
160 sc[facei] = neiCelli;
169 if (size() != flipMap_.size())
172 <<
"Size of addressing: " << size()
173 <<
" size of flip map: " << flipMap_.size()
180 const label nFaces = zoneMesh().mesh().faceOwner().size();
182 bool hasWarned =
false;
185 if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
188 <<
"Illegal face index " << mf[i] <<
" outside range 0.."
198 Foam::faceZone::faceZone
209 masterCellsPtr_(
nullptr),
210 slaveCellsPtr_(
nullptr),
215 Foam::faceZone::faceZone
219 const bool flipMapValue,
228 masterCellsPtr_(
nullptr),
229 slaveCellsPtr_(
nullptr),
232 flipMap_.
setSize(size(), flipMapValue);
237 Foam::faceZone::faceZone
241 const bool flipMapValue,
250 masterCellsPtr_(
nullptr),
251 slaveCellsPtr_(
nullptr),
254 flipMap_.
setSize(size(), flipMapValue);
259 Foam::faceZone::faceZone
272 masterCellsPtr_(
nullptr),
273 slaveCellsPtr_(
nullptr),
280 Foam::faceZone::faceZone
290 flipMap_(std::move(fm)),
293 masterCellsPtr_(
nullptr),
294 slaveCellsPtr_(
nullptr),
301 Foam::faceZone::faceZone
313 masterCellsPtr_(
nullptr),
314 slaveCellsPtr_(
nullptr),
321 Foam::faceZone::faceZone
330 zone(origZone, addr, index),
334 masterCellsPtr_(
nullptr),
335 slaveCellsPtr_(
nullptr),
342 Foam::faceZone::faceZone
351 zone(origZone, std::move(addr), index),
352 flipMap_(std::move(fm)),
355 masterCellsPtr_(
nullptr),
356 slaveCellsPtr_(
nullptr),
398 if (!masterCellsPtr_)
403 return *masterCellsPtr_;
414 return *slaveCellsPtr_;
425 operator()().meshEdges
427 zoneMesh().
mesh().edges(),
428 zoneMesh().
mesh().pointEdges()
453 const bool flipMapValue
458 setFlipMap(flipMapValue);
477 const bool flipMapValue
482 setFlipMap(flipMapValue);
491 boolList newFlipMap(flipMap_.size());
498 const label facei = operator[](i);
502 newAddressing[nFaces] =
faceMap[facei];
503 newFlipMap[nFaces] = flipMap_[i];
509 newFlipMap.setSize(nFaces);
511 transfer(newAddressing);
512 flipMap_.transfer(newFlipMap);
527 bool hasError =
false;
538 const label facei = operator[](i);
553 const label facei = operator[](i);
556 if (patchi != -1 && bm[patchi].coupled())
561 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
567 Pout<<
" ***Problem with faceZone " << index()
568 <<
" named " <<
name()
569 <<
". Face " << facei
570 <<
" on coupled patch "
572 <<
" is not consistent with its coupled neighbour."
581 else if (myZoneFlip[bFacei] == neiZoneFlip[bFacei])
588 Pout<<
" ***Problem with faceZone " << index()
589 <<
" named " <<
name()
590 <<
". Face " << facei
591 <<
" on coupled patch "
593 <<
" does not have consistent flipMap"
594 <<
" across coupled faces."
615 patchPtr_->movePoints(pts);
622 << nl << static_cast<const labelList&>(*
this)
632 writeEntry(this->labelsName, os);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
virtual void clearAddressing()
Clear addressing.
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
void checkAddressing() const
Check addressing.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const labelList & meshEdges() const
Return global edge index for local edges.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
label nInternalFaces() const
Number of internal faces.
Template functions to aid in the implementation of demand driven data.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual void resetAddressing(const labelUList &addr, const bool flipMapValue)
Reset addressing - use uniform flip map value.
Base class for mesh zones.
virtual void clearAddressing()
Clear addressing.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
virtual ~faceZone()
Destructor.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
void deleteDemandDrivenData(DataPtr &dataPtr)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
A subset of mesh faces organised as a primitive patch.
#define DebugInFunction
Report an information message using Foam::Info.
virtual bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
word name(const complex &c)
Return string representation of complex.
boolList flipMap_
Flip map for all faces in the zone.
void transfer(List< label > &list)
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes in topology.
const labelList & slaveCells() const
Return labels of slave cells.
const faceZoneMesh & zoneMesh() const
Return zoneMesh reference.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
void operator=(const UList< label > &a)
Assignment to UList operator. Takes linear time.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
Macros for easy insertion into run-time selection tables.
virtual void movePoints(const pointField &pts)
Correct patch after moving points.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
Begin block [isseparator].
void writeEntry(Ostream &os) const
Write the UList with its compound type.
const labelList & reverseFaceMap() const
Reverse face map.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised.
const labelList & masterCells() const
const primitiveFacePatch & operator()() const
Return reference to primitive patch.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInfo
Report an information message using Foam::Info.
void calcCellLayers() const
Calculate master and slave face layer.
const std::string patch
OpenFOAM patch number as a std::string.
List< face > faceList
A List of faces.
void calcFaceZonePatch() const
Build primitive patch.
virtual void writeDict(Ostream &os) const
Write dictionary.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void clear()
Clear the list, i.e. set size to zero.
label localID(const label globalID) const
Map storing the local index for every global index. Used to find.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void write(Ostream &os) const
Write.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void setSize(const label newSize)
Alias for resize(const label)
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
A list of faces which address into the list of points.
virtual bool checkDefinition(const bool report=false) const =0
Check zone definition. Return true if in error.