35Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
38 const polyPatch& thisPatch
41 const polyBoundaryMesh&
pbm =
mesh.boundaryMesh();
46 <<
"Invalid coupleGroup patch group"
47 <<
" on patch " << thisPatch.name()
48 <<
" in region " <<
pbm.mesh().name()
52 const auto fnd =
pbm.groupPatchIDs().cfind(
name());
56 if (&
mesh == &thisPatch.boundaryMesh().mesh())
60 <<
"Patch " << thisPatch.name()
61 <<
" should be in patchGroup " <<
name()
62 <<
" in region " <<
pbm.mesh().name()
72 if (&
mesh == &thisPatch.boundaryMesh().mesh())
77 <<
"Couple patchGroup " <<
name()
80 <<
" on patch " << thisPatch.name()
81 <<
" region " << thisPatch.boundaryMesh().mesh().name()
87 label index =
patchIDs.find(thisPatch.index());
92 <<
"Couple patchGroup " <<
name()
94 <<
" does not contain patch " << thisPatch.name()
95 <<
" in region " <<
pbm.mesh().name()
117 <<
"Couple patchGroup " <<
name()
119 <<
" in region " <<
mesh.name()
120 <<
" should only contain a single patch"
121 <<
" when matching patch " << thisPatch.name()
122 <<
" in region " <<
pbm.mesh().name()
135 dict.readIfPresent(
"coupleGroup", name_);
141Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
148 return findOtherPatchID(
pbm.mesh(), thisPatch);
152Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
164 label otherPatchID = -1;
168 const label
patchID = findOtherPatchID(
mesh, thisPatch);
172 if (otherPatchID != -1)
175 <<
"Couple patchGroup " <<
name()
176 <<
" should be present on only two patches"
177 <<
" in any of the meshes in "
179 <<
" It seems to be present on patch "
181 <<
" in region " << thisMesh.
name()
182 <<
", on patch " << otherPatchID
183 <<
" in region " << otherRegion
185 <<
" in region " <<
mesh.name() <<
endl
189 otherRegion =
mesh.name();
193 if (otherPatchID == -1)
196 <<
"Couple patchGroup " <<
name()
197 <<
" not found in any of the other meshes "
199 <<
" on patch " << thisPatch.
name()
200 <<
" region " << thisMesh.
name()
212 os.writeEntry(
"coupleGroup", name_);
const polyBoundaryMesh & pbm
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,...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Encapsulates using "patchGroups" to specify coupled patch.
bool good() const noexcept
The patchGroup has a non-empty name.
coupleGroupIdentifier()=default
Default construct.
void write(Ostream &os) const
Write the coupleGroup dictionary entry.
const word & name() const noexcept
Name of patchGroup.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
wordList sortedNames() const
The sorted names of all objects.
const Time & time() const noexcept
Return time registry.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const noexcept
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.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).