35Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
38 const polyPatch& thisPatch
46 <<
"Invalid coupleGroup patch group"
47 <<
" on patch " << thisPatch.name()
48 <<
" in region " << pbm.mesh().name()
52 const auto fnd = pbm.groupPatchIDs().cfind(
name());
60 <<
"Patch " << thisPatch.name()
61 <<
" should be in patchGroup " <<
name()
62 <<
" in region " << pbm.mesh().name()
74 if (patchIDs.size() > 2 || patchIDs.size() == 0)
77 <<
"Couple patchGroup " <<
name()
78 <<
" with contents " << patchIDs
80 <<
" on patch " << thisPatch.name()
81 <<
" region " << thisPatch.boundaryMesh().mesh().name()
87 label index = patchIDs.find(thisPatch.index());
92 <<
"Couple patchGroup " <<
name()
93 <<
" with contents " << patchIDs
94 <<
" does not contain patch " << thisPatch.name()
95 <<
" in region " << pbm.mesh().name()
102 if (patchIDs.size() == 2)
105 return patchIDs[1-index];
114 if (patchIDs.size() != 1)
117 <<
"Couple patchGroup " <<
name()
118 <<
" with contents " << patchIDs
120 <<
" should only contain a single patch"
121 <<
" when matching patch " << thisPatch.name()
122 <<
" in region " << pbm.mesh().name()
141Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
148 return findOtherPatchID(pbm.
mesh(), thisPatch);
152Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
166 label otherPatchID = -1;
172 const label
patchID = findOtherPatchID(
mesh, thisPatch);
176 if (otherPatchID != -1)
179 <<
"Couple patchGroup " <<
name()
180 <<
" should be present on only two patches"
181 <<
" in any of the meshes in " << meshSet.
sortedToc()
183 <<
" It seems to be present on patch "
185 <<
" in region " << thisMesh.
name()
186 <<
", on patch " << otherPatchID
187 <<
" in region " << otherRegion
197 if (otherPatchID == -1)
200 <<
"Couple patchGroup " <<
name()
201 <<
" not found in any of the other meshes " << meshSet.
sortedToc()
202 <<
" on patch " << thisPatch.
name()
203 <<
" region " << thisMesh.
name()
A HashTable similar to std::unordered_map.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
const word & name() const noexcept
Return the object name.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Encapsulates using "patchGroups" to specify coupled patch.
coupleGroupIdentifier()=default
Default construct.
void write(Ostream &os) const
Write the coupleGroup dictionary entry.
const word & name() const noexcept
Name of patchGroup.
bool valid() const noexcept
Is a valid patchGroup (non-empty) name.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
virtual bool write()
Write the output fields.
const word & name() const
Return reference to name.
const Time & time() const noexcept
Return time registry.
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const polyMesh & mesh() const noexcept
Return the mesh reference.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
List< label > labelList
A List of labels.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.