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.groupPatchIDs().find(
name());
52 if (fnd == pbm.groupPatchIDs().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",
""))
151 Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
158 return findOtherPatchID(pbm.
mesh(), thisPatch);
162 Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
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");
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 word & name() const
Return name.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void write(Ostream &) const
Write the data as a dictionary.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool valid() const
Is a valid patchGroup.
A class for handling words, derived from string.
friend class const_iterator
Declare friendship with the const_iterator.
const polyMesh & mesh() const
Return the mesh reference.
List< label > labelList
A List of labels.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Encapsulates using patchGroups to specify coupled patch.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const Time & time() const
Return time.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
const word & name() const
Name of patchGroup.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Ostream & operator<<(Ostream &, const ensightPart &)
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
coupleGroupIdentifier()
Construct null.
HashTable< const Type * > lookupClass(const bool strict=false) const
Lookup and return all objects of the given Type.