Go to the documentation of this file.
52 void Foam::faceZone::setFlipMap(
const bool val)
55 if (flipMap_.size() == this->size())
63 flipMap_.
resize(this->size(), val);
70 void Foam::faceZone::calcFaceZonePatch()
const
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]];
111 void Foam::faceZone::calcCellLayers()
const
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;
167 void Foam::faceZone::checkAddressing()
const
171 if (addr.size() != flipMap_.size())
174 <<
"Size of addressing: " << addr.size()
175 <<
" size of flip map: " << flipMap_.size()
180 const label nFaces = zoneMesh().mesh().faceOwner().size();
182 for (
const label facei : addr)
184 if (facei < 0 || facei >= nFaces)
187 <<
"Illegal face index " << facei
188 <<
" outside range 0.." << nFaces-1 <<
endl;
197 Foam::faceZone::faceZone
208 masterCellsPtr_(nullptr),
209 slaveCellsPtr_(nullptr),
214 Foam::faceZone::faceZone
218 const bool flipMapValue,
227 masterCellsPtr_(nullptr),
228 slaveCellsPtr_(nullptr),
231 flipMap_.
resize(size(), flipMapValue);
236 Foam::faceZone::faceZone
240 const bool flipMapValue,
249 masterCellsPtr_(nullptr),
250 slaveCellsPtr_(nullptr),
253 flipMap_.
resize(size(), flipMapValue);
258 Foam::faceZone::faceZone
271 masterCellsPtr_(nullptr),
272 slaveCellsPtr_(nullptr),
279 Foam::faceZone::faceZone
289 flipMap_(std::move(fm)),
292 masterCellsPtr_(nullptr),
293 slaveCellsPtr_(nullptr),
300 Foam::faceZone::faceZone
312 masterCellsPtr_(nullptr),
313 slaveCellsPtr_(nullptr),
320 Foam::faceZone::faceZone
329 zone(origZone, addr, index),
333 masterCellsPtr_(nullptr),
334 slaveCellsPtr_(nullptr),
341 Foam::faceZone::faceZone
350 zone(origZone, std::move(addr), index),
351 flipMap_(std::move(fm)),
354 masterCellsPtr_(nullptr),
355 slaveCellsPtr_(nullptr),
391 if (!masterCellsPtr_)
396 return *masterCellsPtr_;
407 return *slaveCellsPtr_;
418 operator()().meshEdges
420 zoneMesh().
mesh().edges(),
421 zoneMesh().
mesh().pointEdges()
446 const bool flipMapValue
451 setFlipMap(flipMapValue);
470 const bool flipMapValue
475 setFlipMap(flipMapValue);
484 boolList newFlipMap(flipMap_.size());
492 const label facei = addr[i];
496 newAddressing[nFaces] =
faceMap[facei];
497 newFlipMap[nFaces] = flipMap_[i];
502 newAddressing.setSize(nFaces);
503 newFlipMap.setSize(nFaces);
505 transfer(newAddressing);
506 flipMap_.transfer(newFlipMap);
521 bool hasError =
false;
535 const label facei = addr[i];
550 const label facei = addr[i];
553 if (patchi != -1 && bm[patchi].
coupled())
558 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
564 Pout<<
" ***Problem with faceZone " << index()
565 <<
" named " <<
name()
566 <<
". Face " << facei
567 <<
" on coupled patch "
569 <<
" is not consistent with its coupled neighbour."
578 else if (myZoneFlip[bFacei] == neiZoneFlip[bFacei])
585 Pout<<
" ***Problem with faceZone " << index()
586 <<
" named " <<
name()
587 <<
". Face " << facei
588 <<
" on coupled patch "
590 <<
" does not have consistent flipMap"
591 <<
" across coupled faces."
612 patchPtr_->movePoints(pts);
619 << nl << static_cast<const labelList&>(*
this)
630 writeEntry(this->labelsName,
os);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
virtual void clearAddressing()
static const char *const labelsName
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void resize(const label len)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const labelList & meshEdges() const
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
Template functions to aid in the implementation of demand driven data.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual void resetAddressing(const labelUList &addr, const bool flipMapValue)
Base class for mesh zones.
List< bool > boolList
A List of bools.
virtual void clearAddressing()
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
virtual Ostream & beginBlock(const keyType &kw)
Mesh consisting of general polyhedral cells.
void deleteDemandDrivenData(DataPtr &dataPtr)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
Generic templated field type.
A subset of mesh faces organised as a primitive patch.
virtual bool checkDefinition(const bool report=false) const
void setSize(const label n)
void transfer(List< T > &list)
virtual void updateMesh(const mapPolyMesh &mpm)
const labelList & slaveCells() const
label nBoundaryFaces() const noexcept
label whichPatch(const label faceIndex) const
void operator=(const UList< T > &a)
Lookup type of boundary radiation properties.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual Ostream & endBlock()
virtual bool check(const char *operation) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
virtual bool write(const token &tok)=0
virtual void movePoints(const pointField &pts)
label whichFace(const label globalCellID) const
errorManip< error > abort(error &err)
void writeEntry(Ostream &os) const
const labelList & reverseFaceMap() const
const word & name() const noexcept
virtual bool checkParallelSync(const bool report=false) const
const labelList & masterCells() const
bool isInternalFace(const label faceIndex) const noexcept
const primitiveFacePatch & operator()() const
#define FatalErrorInFunction
void write(Ostream &os) const
List< face > faceList
A List of faces.
virtual void writeDict(Ostream &os) const
label nInternalFaces() const noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
fileName::Type type(const fileName &name, const bool followLink=true)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label localID(const label globalID) const
Ostream & writeEntry(const keyType &key, const T &value)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
word name(const expressions::valueTypeCode typeCode)
virtual void write(Ostream &os) const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
A list of faces which address into the list of points.
virtual bool checkDefinition(const bool report=false) const =0