32 Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
35 const polyPatch& thisPatch
38 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
43 <<
"Invalid coupleGroup patch group"
44 <<
" on patch " << thisPatch.name()
45 <<
" in region " << pbm.mesh().name()
50 pbm.groupPatchIndices().find(
name());
52 if (fnd == pbm.groupPatchIndices().end())
54 if (&mesh == &thisPatch.boundaryMesh().mesh())
58 <<
"Patch " << thisPatch.name()
59 <<
" should be in patchGroup " <<
name()
60 <<
" in region " << pbm.mesh().name()
70 if (&mesh == &thisPatch.boundaryMesh().mesh())
72 if (patchIDs.size() > 2 || patchIDs.size() == 0)
75 <<
"Couple patchGroup " <<
name()
76 <<
" with contents " << patchIDs
78 <<
" on patch " << thisPatch.name()
79 <<
" region " << thisPatch.boundaryMesh().mesh().name()
90 <<
"Couple patchGroup " <<
name()
91 <<
" with contents " << patchIDs
92 <<
" does not contain patch " << thisPatch.name()
93 <<
" in region " << pbm.mesh().name()
100 if (patchIDs.size() == 2)
103 return patchIDs[1-index];
112 if (patchIDs.size() != 1)
115 <<
"Couple patchGroup " <<
name()
116 <<
" with contents " << patchIDs
117 <<
" in region " << mesh.name()
118 <<
" should only contain a single patch"
119 <<
" when matching patch " << thisPatch.name()
120 <<
" in region " << pbm.mesh().name()
145 name_(
dict.lookupOrDefault<
word>(
"coupleGroup",
""))
158 return findOtherPatchID(pbm.
mesh(), thisPatch);
170 const Time& runTime = thisMesh.
time();
176 label otherPatchID = -1;
182 label patchID = findOtherPatchID(mesh, thisPatch);
186 if (otherPatchID != -1)
189 <<
"Couple patchGroup " <<
name()
190 <<
" should be present on only two patches"
191 <<
" in any of the meshes in " << meshSet.
sortedToc()
193 <<
" It seems to be present on patch "
195 <<
" in region " << thisMesh.
name()
196 <<
", on patch " << otherPatchID
197 <<
" in region " << otherRegion
198 <<
" and on patch " << patchID
199 <<
" in region " << mesh.
name()
202 otherPatchID = patchID;
203 otherRegion = mesh.
name();
207 if (otherPatchID == -1)
210 <<
"Couple patchGroup " <<
name()
211 <<
" not found in any of the other meshes " << meshSet.
sortedToc()
212 <<
" on patch " << thisPatch.
name()
213 <<
" region " << thisMesh.
name()
235 os.
check(
"Ostream& operator<<(Ostream& os, const coupleGroupIdentifier& p");
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
An STL-conforming hash table.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
friend class const_iterator
Declare friendship with the const_iterator.
const word & name() const
Return 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,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Encapsulates using patchGroups to specify coupled patch.
void write(Ostream &) const
Write the data as a dictionary.
bool valid() const
Is a valid patchGroup.
const word & name() const
Name of patchGroup.
coupleGroupIdentifier()
Construct null.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const Time & time() const
Return time.
HashTable< const Type * > lookupClass(const bool strict=false) const
Lookup and return all objects of the given Type.
const word & name() const
Return name.
const polyMesh & mesh() const
Return the mesh reference.
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
Return boundaryMesh reference.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(const PtrList< ModelType > &l)
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.
word name(const bool)
Return a word representation of a bool.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)