Loading...
Searching...
No Matches
GAMGInterfaceField.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) 2011-2013 OpenFOAM Foundation
9 Copyright (C) 2019,2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::GAMGInterfaceField
29
30Description
31 Abstract base class for GAMG agglomerated interface fields.
32
33SourceFiles
34 GAMGInterfaceField.C
35 GAMGInterfaceFieldNew.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef GAMGInterfaceField_H
40#define GAMGInterfaceField_H
41
42#include "lduInterfaceField.H"
43#include "GAMGInterface.H"
44#include "autoPtr.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class GAMGInterfaceField Declaration
53\*---------------------------------------------------------------------------*/
54
55class GAMGInterfaceField
56:
58{
59 // Private data
60
61 //- Local reference cast into the interface
62 const GAMGInterface& interface_;
63
64
65 // Private Member Functions
66
67 //- No copy construct
68 GAMGInterfaceField(const GAMGInterfaceField&) = delete;
69
70 //- No copy assignment
71 void operator=(const GAMGInterfaceField&) = delete;
72
73
74public:
75
76 //- Runtime type information
77 TypeName("GAMGInterfaceField");
78
79
80 // Declare run-time constructor selection tables
81
83 (
84 autoPtr,
85 GAMGInterfaceField,
87 (
88 const GAMGInterface& GAMGCp,
89 const lduInterfaceField& fineInterface
90 ),
91 (GAMGCp, fineInterface)
92 );
93
95 (
96 autoPtr,
97 GAMGInterfaceField,
99 (
100 const GAMGInterface& GAMGCp,
101 const bool doTransform,
102 const int rank
103 ),
104 (GAMGCp, doTransform, rank)
105 );
106
108 (
109 autoPtr,
110 GAMGInterfaceField,
111 Istream,
112 (
113 const GAMGInterface& GAMGCp,
114 Istream& is
115 ),
116 (GAMGCp, is)
117 );
118
119
120 // Selectors
121
122 //- Return a pointer to a new interface created on freestore given
123 // the fine interface
125 (
126 const GAMGInterface& GAMGCp,
127 const lduInterfaceField& fineInterface
128 );
129
130 //- Return a pointer to a new interface created on freestore given
131 // the fine interface
133 (
134 const GAMGInterface& GAMGCp,
135 const bool doTransform,
136 const int rank
137 );
138
139 //- Return a pointer to a new interface created on freestore given
140 // the fine interface and stream
142 (
143 const word& patchFieldType,
144 const GAMGInterface& GAMGCp,
145 Istream& is
146 );
147
148
149 // Constructors
150
151 //- Construct from GAMG interface and fine level interface field
152 GAMGInterfaceField
153 (
154 const GAMGInterface& GAMGCp,
155 const lduInterfaceField&
156 )
157 :
158 lduInterfaceField(GAMGCp),
159 interface_(GAMGCp)
160 {}
161
162 //- Construct from GAMG interface and fine level interface field
164 (
165 const GAMGInterface& GAMGCp,
166 const bool doTransform,
167 const int rank
168 )
169 :
170 lduInterfaceField(GAMGCp),
171 interface_(GAMGCp)
172 {}
173
174 //- Construct from GAMG interface and fine level interface field
176 (
177 const GAMGInterface& GAMGCp,
178 Istream& is
180 :
181 lduInterfaceField(GAMGCp),
182 interface_(GAMGCp)
183 {}
184
185 //- Construct by assembling and return a clone.
187 (
188 const GAMGInterface& GAMGCp,
189 const UPtrList<lduInterfaceField>& other // other
190 ) const = 0;
191
192
193 //- Destructor
194 virtual ~GAMGInterfaceField() = default;
195
196
197 // Member Functions
198
199 // Access
200
201 //- Return interface
202 const GAMGInterface& interface() const
203 {
204 return interface_;
205 }
207
208 // I/O
209
210 //- Write to stream
211 virtual void write(Ostream&) const = 0;
212};
213
214
215// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217} // End namespace Foam
218
219// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220
221#endif
222
223// ************************************************************************* //
Abstract base class for GAMG agglomerated interface fields.
virtual void write(Ostream &) const =0
Write to stream.
GAMGInterfaceField(const GAMGInterface &GAMGCp, const bool doTransform, const int rank)
Construct from GAMG interface and fine level interface field.
GAMGInterfaceField(const GAMGInterface &GAMGCp, const lduInterfaceField &)
Construct from GAMG interface and fine level interface field.
declareRunTimeSelectionTable(autoPtr, GAMGInterfaceField, lduInterfaceField,(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterface),(GAMGCp, fineInterface))
declareRunTimeSelectionTable(autoPtr, GAMGInterfaceField, lduInterface,(const GAMGInterface &GAMGCp, const bool doTransform, const int rank),(GAMGCp, doTransform, rank))
const GAMGInterface & interface() const
Return interface.
virtual autoPtr< GAMGInterfaceField > clone(const GAMGInterface &GAMGCp, const UPtrList< lduInterfaceField > &other) const =0
Construct by assembling and return a clone.
virtual ~GAMGInterfaceField()=default
Destructor.
TypeName("GAMGInterfaceField")
Runtime type information.
static autoPtr< GAMGInterfaceField > New(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterface)
Return a pointer to a new interface created on freestore given.
GAMGInterfaceField(const GAMGInterface &GAMGCp, Istream &is)
Construct from GAMG interface and fine level interface field.
declareRunTimeSelectionTable(autoPtr, GAMGInterfaceField, Istream,(const GAMGInterface &GAMGCp, Istream &is),(GAMGCp, is))
Abstract base class for GAMG agglomerated interfaces.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
lduInterfaceField(const lduInterfaceField &)=delete
No copy construct.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
runTime write()
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68