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