coupleGroupIdentifier.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::coupleGroupIdentifier
26 
27 Description
28  Encapsulates using patchGroups to specify coupled patch
29 
30 SourceFiles
31  coupleGroupIdentifierI.H
32  coupleGroupIdentifier.C
33  coupleGroupIdentifierIO.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef coupleGroupIdentifier_H
38 #define coupleGroupIdentifier_H
39 
40 #include "word.H"
41 #include "label.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class dictionary;
50 class polyMesh;
51 class polyPatch;
52 class Ostream;
53 
54 // Forward declaration of friend functions and operators
55 class coupleGroupIdentifier;
56 Ostream& operator<<(Ostream&, const coupleGroupIdentifier&);
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class coupleGroupIdentifier Declaration
61 \*---------------------------------------------------------------------------*/
62 
64 {
65  // Private Data
66 
67  //- Name of patchGroup
68  word name_;
69 
70 
71  // Private Member Functions
72 
73  //- Find other patch in specified mesh. Returns index of patch or -1.
74  label findOtherPatchID(const polyMesh&, const polyPatch&) const;
75 
76 
77 public:
78 
79  // Constructors
80 
81  //- Construct null
83 
84  //- Construct from components
85  coupleGroupIdentifier(const word& patchGroupName);
86 
87  //- Construct from dictionary
89 
90 
91  // Member Functions
92 
93  //- Name of patchGroup
94  inline const word& name() const;
95 
96  //- Is a valid patchGroup
97  inline bool valid() const;
98 
99  //- Find other patch in same region. Returns index of patch or -1.
100  label findOtherPatchID(const polyPatch&) const;
101 
102  //- Find other patch and region. Returns index of patch and sets
103  // otherRegion to name of region. Fatal error if patch not found
104  label findOtherPatchID(const polyPatch&, word&) const;
105 
106  //- Write the data as a dictionary
107  void write(Ostream&) const;
108 
109 
110  // IOstream Operators
111 
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #include "coupleGroupIdentifierI.H"
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void write(Ostream &) const
Write the data as a dictionary.
bool valid() const
Is a valid patchGroup.
A class for handling words, derived from string.
Definition: word.H:59
Encapsulates using patchGroups to specify coupled patch.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
friend Ostream & operator<<(Ostream &, const coupleGroupIdentifier &)
const word & name() const
Name of patchGroup.
Ostream & operator<<(Ostream &, const ensightPart &)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Namespace for OpenFOAM.