44 void Foam::faceZone::calcFaceZonePatch()
const
54 <<
"primitive face zone patch already calculated"
77 patch[facei] =
f[addr[facei]].reverseFace();
81 patch[facei] =
f[addr[facei]];
89 patch[facei] =
f[addr[facei]];
100 void Foam::faceZone::checkAddressing()
const
102 if (oriented_ && size() != flipMap_.size())
105 <<
"Size of addressing: " << size()
106 <<
" size of flip map: " << flipMap_.size()
113 const label nFaces = zones().mesh().faceOwner().size();
115 bool hasWarned =
false;
118 if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces))
121 <<
"Illegal face index " << mf[i] <<
" outside range 0.."
129 void Foam::faceZone::reset(
const Map<bool>& newIndices)
136 indices.
setSize(newIndices.size());
137 flipMap_.setSize(newIndices.size());
141 forAll(sortedNewIndices, i)
143 indices[i] = sortedNewIndices[i].key();
144 flipMap_[i] = sortedNewIndices[i]();
149 void Foam::faceZone::reset(
const labelHashSet& newIndices)
166 const bool moveUpdate,
167 const bool topoUpdate
185 const bool moveUpdate,
186 const bool topoUpdate
204 const bool moveUpdate,
205 const bool topoUpdate
223 const bool moveUpdate,
224 const bool topoUpdate
245 flipMap_(
dict.lookupOrDefault(
"flipMap",
boolList::null())),
438 zones().
mesh().edges(),
439 zones().
mesh().pointEdges()
486 zones().
mesh().faces().size(),
497 bool hasError =
false;
511 const label facei = operator[](i);
524 const label facei = operator[](i);
544 const label facei = operator[](i);
552 if (myZoneFace[bFacei] != neiZoneFace[bFacei])
558 Pout<<
" ***Problem with faceZone " <<
name()
559 <<
". Face " << facei
560 <<
" on coupled patch "
562 <<
" is not consistent with its coupled neighbour."
571 else if (oriented_ && myZoneFlip[bFacei] == neiZoneFlip[bFacei])
578 Pout<<
" ***Problem with faceZone " <<
name()
579 <<
". Face " << facei
580 <<
" on coupled patch "
582 <<
" does not have consistent flipMap"
583 <<
" across coupled faces."
605 <<
"Attempt to insert oriented faces into the unoriented faceZone "
611 indices.
insert(newIndices);
621 <<
"Attempt to insert unoriented faces into the oriented faceZone "
627 indices.
insert(newIndices);
635 Swap(oriented_, fz.oriented_);
636 flipMap_.swap(fz.flipMap_);
660 if (
faceMap[facei] >= 0 && i != -1)
665 flipFaceFlux.
found(facei)
672 forAll(reverseFaceMap, facei)
674 const label i = localIndex(facei);
675 if (reverseFaceMap[facei] >= 0 && i != -1)
679 reverseFaceMap[facei],
680 flipFaceFlux.
found(reverseFaceMap[facei])
687 reset(newIndicesMap);
701 patchPtr_->clearGeom();
723 oriented_ = zn.oriented_;
726 flipMap_ = zn.flipMap_;
734 oriented_ = zn.oriented_;
737 flipMap_ = move(zn.flipMap_);
#define forAll(list, i)
Loop across all elements in list.
bool insert(const Key &key)
Insert a new entry.
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 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.
void topoChange(const labelList &map, const labelList &reverseMap)
Update the addressing using the maps provided.
bool checkDefinition(const label maxSize, const bool report=false) const
Check zone definition with max size given. Return true if in error.
void clearAddressing()
Clear addressing.
void operator=(const Zone &)
Assignment operator.
const faceZoneList & zones() const
Return ZonesType reference.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Named list of face indices representing a sub-set of the mesh faces.
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
void swap(faceZone &)
Swap two faceZones.
void operator=(const faceZone &)
Assignment to zone, clearing demand-driven data.
faceZone(const word &name, const labelUList &addr, const boolList &fm, const faceZoneList &mz, const bool moveUpdate=false, const bool topoUpdate=false)
Construct from components.
const primitiveFacePatch & patch() const
Return reference to primitive patch.
autoPtr< faceZone > clone() const
Construct and return a clone.
void topoChange(const polyTopoChangeMap &)
Update zone using the given map.
void resetAddressing(const labelUList &, const boolList &)
Reset addressing and flip map (clearing demand-driven data)
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
void writeDict(Ostream &) const
Write dictionary.
void insert(const Map< bool > &newIndices)
Insert given indices and corresponding face flips into zone.
void clearAddressing()
Clear addressing.
void movePoints(const pointField &)
Correct patch after moving points.
bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised. Return.
const labelList & meshEdges() const
Return global edge index for local edges.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Motion of the mesh specified as a list of pointMeshMovers.
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.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)