Go to the documentation of this file.
35 Foam::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 HashTable<labelList>::const_iterator fnd =
53 pbm.groupPatchIDs().find(
name());
57 if (&
mesh == &thisPatch.boundaryMesh().mesh())
61 <<
"Patch " << thisPatch.name()
62 <<
" should be in patchGroup " <<
name()
63 <<
" in region " << pbm.mesh().name()
73 if (&
mesh == &thisPatch.boundaryMesh().mesh())
75 if (patchIDs.size() > 2 || patchIDs.size() == 0)
78 <<
"Couple patchGroup " <<
name()
79 <<
" with contents " << patchIDs
81 <<
" on patch " << thisPatch.name()
82 <<
" region " << thisPatch.boundaryMesh().mesh().name()
88 label index = patchIDs.find(thisPatch.index());
93 <<
"Couple patchGroup " <<
name()
94 <<
" with contents " << patchIDs
95 <<
" does not contain patch " << thisPatch.name()
96 <<
" in region " << pbm.mesh().name()
103 if (patchIDs.size() == 2)
106 return patchIDs[1-index];
115 if (patchIDs.size() != 1)
118 <<
"Couple patchGroup " <<
name()
119 <<
" with contents " << patchIDs
120 <<
" in region " <<
mesh.name()
121 <<
" should only contain a single patch"
122 <<
" when matching patch " << thisPatch.name()
123 <<
" in region " << pbm.mesh().name()
142 name_(patchGroupName)
150 dict.readIfPresent(
"coupleGroup", name_);
156 Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
163 return findOtherPatchID(pbm.
mesh(), thisPatch);
167 Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
181 label otherPatchID = -1;
191 if (otherPatchID != -1)
194 <<
"Couple patchGroup " <<
name()
195 <<
" should be present on only two patches"
196 <<
" in any of the meshes in " << meshSet.
sortedToc()
198 <<
" It seems to be present on patch "
200 <<
" in region " << thisMesh.
name()
201 <<
", on patch " << otherPatchID
202 <<
" in region " << otherRegion
212 if (otherPatchID == -1)
215 <<
"Couple patchGroup " <<
name()
216 <<
" not found in any of the other meshes " << meshSet.
sortedToc()
217 <<
" on patch " << thisPatch.
name()
218 <<
" region " << thisMesh.
name()
Encapsulates using patchGroups to specify coupled patch.
List< label > labelList
A List of labels.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const Time & time() const
Return time.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
const word & name() const
Name of patchGroup.
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
const polyMesh & mesh() const
Return the mesh reference.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool valid() const
Is a valid patchGroup.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A HashTable similar to std::unordered_map.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
forAllConstIters(mixture.phases(), phase)
void write(Ostream &os) const
Write the data as a dictionary.
coupleGroupIdentifier()
Construct null.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const word & name() const
Return the patch name.
Ostream & operator<<(Ostream &, const boundaryPatch &)
const word & name() const
Return reference to name.