Go to the documentation of this file.
30 #include "primitiveMesh.H"
52 Info<<
"void faceZone::calcFaceZonePatch() const : "
53 <<
"Calculating primitive patch"
60 <<
"primitive face zone patch already calculated"
82 patch[faceI] =
f[addr[faceI]].reverseFace();
86 patch[faceI] =
f[addr[faceI]];
92 Info<<
"void faceZone::calcFaceZonePatch() const : "
93 <<
"Finished calculating primitive patch"
103 Info<<
"void Foam::faceZone::calcCellLayers() const : "
104 <<
"calculating master cells"
110 if (masterCellsPtr_ || slaveCellsPtr_)
113 <<
"cell layers already calculated"
121 const labelList& own = zoneMesh().mesh().faceOwner();
122 const labelList& nei = zoneMesh().mesh().faceNeighbour();
126 const boolList& faceFlip = flipMap();
136 label ownCellI = own[mf[faceI]];
139 zoneMesh().mesh().isInternalFace(mf[faceI])
144 if (!faceFlip[faceI])
147 mc[faceI] = neiCellI;
148 sc[faceI] = ownCellI;
152 mc[faceI] = ownCellI;
153 sc[faceI] = neiCellI;
164 if (size() != flipMap_.size())
167 <<
"Size of addressing: " << size()
168 <<
" size of flip map: " << flipMap_.size()
175 const label nFaces = zoneMesh().mesh().faceOwner().
size();
177 bool hasWarned =
false;
180 if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
183 <<
"Illegal face index " << mf[i] <<
" outside range 0.."
207 masterCellsPtr_(NULL),
208 slaveCellsPtr_(NULL),
228 masterCellsPtr_(NULL),
229 slaveCellsPtr_(NULL),
248 masterCellsPtr_(NULL),
249 slaveCellsPtr_(NULL),
265 zone(fz, addr, index),
269 masterCellsPtr_(NULL),
270 slaveCellsPtr_(NULL),
286 zone(fz, addr, index),
290 masterCellsPtr_(NULL),
291 slaveCellsPtr_(NULL),
333 if (!masterCellsPtr_)
338 return *masterCellsPtr_;
349 return *slaveCellsPtr_;
382 operator()().meshEdges
384 zoneMesh().
mesh().edges(),
385 zoneMesh().
mesh().pointEdges()
424 boolList newFlipMap(flipMap_.size());
431 const label faceI = operator[](i);
435 newAddressing[nFaces] =
faceMap[faceI];
436 newFlipMap[nFaces] = flipMap_[i];
444 transfer(newAddressing);
445 flipMap_.transfer(newFlipMap);
460 bool hasError =
false;
471 const label faceI = operator[](i);
486 const label faceI = operator[](i);
489 if (patchI != -1 && bm[patchI].coupled())
494 if (myZoneFace[bFaceI] != neiZoneFace[bFaceI])
500 Pout<<
" ***Problem with faceZone " << index()
501 <<
" named " <<
name()
502 <<
". Face " << faceI
503 <<
" on coupled patch "
505 <<
" is not consistent with its coupled neighbour."
514 else if (myZoneFlip[bFaceI] == neiZoneFlip[bFaceI])
521 Pout<<
" ***Problem with faceZone " << index()
522 <<
" named " <<
name()
523 <<
". Face " << faceI
524 <<
" on coupled patch "
526 <<
" does not have consistent flipMap"
527 <<
" across coupled faces."
548 patchPtr_->movePoints(
p);
555 << nl << static_cast<const labelList&>(*
this)
565 writeEntry(this->labelsName, os);
566 flipMap().writeEntry(
"flipMap", os);
577 os.
check(
"Ostream& operator<<(Ostream&, const faceZone&");
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)
virtual void write(Ostream &) const
Write.
A class for handling words, derived from string.
void checkAddressing() const
Check addressing.
List< label > labelList
A List of labels.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
const labelList & meshEdges() const
Return global edge index for local edges.
#define forAll(list, i)
Loop across all elements in list.
const MeshType & mesh() const
Return the mesh reference.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Template functions to aid in the implementation of demand driven data.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual void movePoints(const pointField &)
Correct patch after moving points.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
faceZone(const faceZone &)
Disallow default bitwise copy construct.
virtual void resetAddressing(const labelUList &, const boolList &)
Reset addressing and flip map (clearing demand-driven data)
virtual void clearAddressing()
Clear addressing.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void operator=(const UList< T > &)
Assignment from UList operator. Takes linear time.
virtual ~faceZone()
Destructor.
A simple container for copying or transferring objects of type <T>.
PrimitivePatch< face, List, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
Mesh consisting of general polyhedral cells.
void deleteDemandDrivenData(DataPtr &dataPtr)
primitiveFacePatch * patchPtr_
Primitive patch made out of correctly flipped faces.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
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.
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.
const word & name() const
Return name.
virtual void updateMesh(const mapPolyMesh &)
Update for changes in topology.
Ostream & operator<<(Ostream &, const edgeMesh &)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A list of keyword definitions, which are a keyword followed by any number of values (e....
label nInternalFaces() const
Macros for easy insertion into run-time selection tables.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
label size() const
Return the number of elements in the UList.
const labelList & reverseFaceMap() const
Reverse face map.
void setSize(const label)
Reset size of List.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised. Return.
const labelList & masterCells() const
Return labels of master cells (cells next to the master face.
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.
prefixOSstream Pout(cout, "Pout")
void calcFaceZonePatch() const
Build primitive patch.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void writeDict(Ostream &) const
Write dictionary.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
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
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.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const boolList & flipMap() const
Return face flip map.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
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.