59 <<
"primitive face zone patch already calculated"
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 = zones().mesh().faceOwner();
117 const labelList& nei = zones().mesh().faceNeighbour();
121 const boolList& faceFlip = flipMap();
131 label ownCelli = own[mf[facei]];
134 zones().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 = zones().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.."
191 flipMap_.setSize(newIndices.
size());
195 forAll(sortedNewIndices, i)
197 indices[i] = sortedNewIndices[i].key();
198 flipMap_[i] = sortedNewIndices[i]();
216 masterCellsPtr_(nullptr),
217 slaveCellsPtr_(nullptr),
235 masterCellsPtr_(nullptr),
236 slaveCellsPtr_(nullptr),
251 flipMap_(
dict.lookup(
"flipMap")),
253 masterCellsPtr_(nullptr),
254 slaveCellsPtr_(nullptr),
272 masterCellsPtr_(nullptr),
273 slaveCellsPtr_(nullptr),
291 masterCellsPtr_(nullptr),
292 slaveCellsPtr_(nullptr),
311 return zones_.mesh().faceCentres();
328 if (!masterCellsPtr_)
333 return *masterCellsPtr_;
344 return *slaveCellsPtr_;
357 zones().mesh().edges(),
358 zones().mesh().pointEdges()
396 zones().mesh().faces().size(),
404 const polyMesh& mesh = zones().mesh();
407 bool hasError =
false;
418 const label facei = operator[](i);
433 const label facei = operator[](i);
441 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
447 Pout<<
" ***Problem with faceZone " <<
name()
448 <<
". Face " << facei
449 <<
" on coupled patch "
451 <<
" is not consistent with its coupled neighbour."
460 else if (myZoneFlip[bFacei] == neiZoneFlip[bFacei])
467 Pout<<
" ***Problem with faceZone " <<
name()
468 <<
". Face " << facei
469 <<
" on coupled patch "
471 <<
" does not have consistent flipMap"
472 <<
" across coupled faces."
492 indices.
insert(newIndices);
514 if (
faceMap[facei] >= 0 && i != -1)
519 flipFaceFlux.
found(facei)
526 forAll(reverseFaceMap, facei)
528 const label i = localIndex(facei);
529 if (reverseFaceMap[facei] >= 0 && i != -1)
533 reverseFaceMap[facei],
534 flipFaceFlux.
found(reverseFaceMap[facei])
549 patchPtr_->clearGeom();
578 flipMap_ = move(zn.flipMap_);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
List< const_iterator > sorted() const
Return a sorted list of constant iterators.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
const word & name() const
Return name.
label size() const
Return the number of elements in the UList.
void size(const label)
Override size to be inconsistent with allocated storage.
void operator=(const UList< label > &)
Assignment to UList operator. Takes linear time.
void setSize(const label)
Reset size of List.
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of faces which address into the list of points.
const MeshType & mesh() const
Return the mesh reference.
void swap(Zone &)
Swap two zones.
bool checkDefinition(const label maxSize, const bool report=false) const
Check zone definition with max size given. Return true if in error.
virtual void clearAddressing()
Clear addressing.
void operator=(const Zone &)
Assignment operator.
const faceZoneList & zones() const
Return ZonesType reference.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A subset of mesh faces organised as a primitive patch.
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
const boolList & flipMap() const
Return face flip map.
void swap(faceZone &)
Swap two faceZones.
const pointField & meshCentres() const
Return the mesh face centres.
void operator=(const faceZone &)
Assignment to zone, clearing demand-driven data.
boolList flipMap_
Flip map for all faces in the zone. Set to true if the.
const primitiveFacePatch & patch() const
Return reference to primitive patch.
const labelList & masterCells() const
Return labels of master cells (cells next to the master face.
virtual void topoChange(const polyTopoChangeMap &)
Update zone using the given map.
virtual void resetAddressing(const labelUList &, const boolList &)
Reset addressing and flip map (clearing demand-driven data)
void calcCellLayers() const
Calculate master and slave face layer.
void calcFaceZonePatch() const
Build primitive patch.
void checkAddressing() const
Check addressing.
faceZone(const word &name, const labelUList &addr, const boolList &fm, const faceZoneList &mz)
Construct from components.
void reset(const Map< bool > &indices)
Reset the indices and flipMap from the given map.
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
virtual void writeDict(Ostream &) const
Write dictionary.
void insert(const Map< bool > &newIndices)
Insert given indices and corresponding face flips into zone.
virtual void clearAddressing()
Clear addressing.
virtual ~faceZone()
Destructor.
virtual void movePoints(const pointField &)
Correct patch after moving points.
primitiveFacePatch * patchPtr_
Primitive patch made out of correctly flipped faces.
bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised. Return.
const labelList & slaveCells() const
Return labels of slave cells.
const labelList & meshEdges() const
Return global edge index for local edges.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelHashSet & flipFaceFlux() const
Map of flipped face flux faces.
const labelList & reverseFaceMap() const
Reverse face map.
const labelList & faceMap() const
Old face map.
label nInternalFaces() const
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
Zone< faceZone, faceZoneList > faceZoneType
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
defineTypeNameAndDebug(combustionModel, 0)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
prefixOSstream Pout(cout, "Pout")
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
defineTemplateRunTimeSelectionTable(fvLabelFieldSource, null)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.