Go to the documentation of this file.
52 void Foam::faceZone::setFlipMap(
const bool val)
80 <<
"primitive face zone patch already calculated"
93 const faceList&
f = zoneMesh().mesh().faces();
102 patch[facei] =
f[addr[facei]].reverseFace();
106 patch[facei] =
f[addr[facei]];
126 if (masterCellsPtr_ || slaveCellsPtr_)
129 <<
"cell layers already calculated"
137 const labelList& own = zoneMesh().mesh().faceOwner();
138 const labelList& nei = zoneMesh().mesh().faceNeighbour();
142 const boolList& faceFlip = flipMap();
144 masterCellsPtr_ =
new labelList(mf.size());
147 slaveCellsPtr_ =
new labelList(mf.size());
152 const label ownCelli = own[mf[facei]];
153 const label neiCelli =
155 zoneMesh().mesh().isInternalFace(mf[facei])
160 if (!faceFlip[facei])
163 mc[facei] = neiCelli;
164 sc[facei] = ownCelli;
168 mc[facei] = ownCelli;
169 sc[facei] = neiCelli;
178 if (size() != flipMap_.size())
181 <<
"Size of addressing: " << size()
182 <<
" size of flip map: " << flipMap_.size()
189 const label nFaces = zoneMesh().mesh().faceOwner().size();
191 bool hasWarned =
false;
194 if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
197 <<
"Illegal face index " << mf[i] <<
" outside range 0.."
207 Foam::faceZone::faceZone
218 masterCellsPtr_(
nullptr),
219 slaveCellsPtr_(
nullptr),
224 Foam::faceZone::faceZone
228 const bool flipMapValue,
237 masterCellsPtr_(
nullptr),
238 slaveCellsPtr_(
nullptr),
241 flipMap_.
setSize(size(), flipMapValue);
246 Foam::faceZone::faceZone
250 const bool flipMapValue,
259 masterCellsPtr_(
nullptr),
260 slaveCellsPtr_(
nullptr),
263 flipMap_.
setSize(size(), flipMapValue);
268 Foam::faceZone::faceZone
281 masterCellsPtr_(
nullptr),
282 slaveCellsPtr_(
nullptr),
289 Foam::faceZone::faceZone
299 flipMap_(std::move(fm)),
302 masterCellsPtr_(
nullptr),
303 slaveCellsPtr_(
nullptr),
310 Foam::faceZone::faceZone
322 masterCellsPtr_(
nullptr),
323 slaveCellsPtr_(
nullptr),
330 Foam::faceZone::faceZone
339 zone(origZone, addr, index),
343 masterCellsPtr_(
nullptr),
344 slaveCellsPtr_(
nullptr),
351 Foam::faceZone::faceZone
360 zone(origZone, std::move(addr), index),
361 flipMap_(std::move(fm)),
364 masterCellsPtr_(
nullptr),
365 slaveCellsPtr_(
nullptr),
407 if (!masterCellsPtr_)
412 return *masterCellsPtr_;
423 return *slaveCellsPtr_;
434 operator()().meshEdges
436 zoneMesh().
mesh().edges(),
437 zoneMesh().
mesh().pointEdges()
462 const bool flipMapValue
467 setFlipMap(flipMapValue);
486 const bool flipMapValue
491 setFlipMap(flipMapValue);
500 boolList newFlipMap(flipMap_.size());
507 const label facei = operator[](i);
511 newAddressing[nFaces] =
faceMap[facei];
512 newFlipMap[nFaces] = flipMap_[i];
518 newFlipMap.setSize(nFaces);
520 transfer(newAddressing);
521 flipMap_.transfer(newFlipMap);
536 bool hasError =
false;
547 const label facei = operator[](i);
562 const label facei = operator[](i);
565 if (patchi != -1 && bm[patchi].coupled())
570 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
576 Pout<<
" ***Problem with faceZone " << index()
577 <<
" named " <<
name()
578 <<
". Face " << facei
579 <<
" on coupled patch "
581 <<
" is not consistent with its coupled neighbour."
590 else if (myZoneFlip[bFacei] == neiZoneFlip[bFacei])
597 Pout<<
" ***Problem with faceZone " << index()
598 <<
" named " <<
name()
599 <<
". Face " << facei
600 <<
" on coupled patch "
602 <<
" does not have consistent flipMap"
603 <<
" across coupled faces."
624 patchPtr_->movePoints(pts);
631 << nl << static_cast<const labelList&>(*
this)
641 writeEntry(this->labelsName, os);
int debug
Static debugging option.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
virtual void clearAddressing()
Clear addressing.
#define InfoInFunction
Report an information message using Foam::Info.
label ListType::const_reference val
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< face, List, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
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
An Ostream wrapper for parallel output to std::cout.
virtual ~faceZone()
Destructor.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A subset of mesh faces organised as a primitive patch.
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.
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.
Ostream & operator<<(Ostream &, const boundaryPatch &)
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.