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 -------------------------------------------------------------------------------
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::GAMGInterfaceField
29 
30 Description
31  Abstract base class for GAMG agglomerated interface fields.
32 
33 SourceFiles
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 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class GAMGInterfaceField Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public lduInterfaceField
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 
74 public:
75 
76  //- Runtime type information
77  TypeName("GAMGInterfaceField");
78 
79 
80  // Declare run-time constructor selection tables
81 
83  (
84  autoPtr,
87  (
88  const GAMGInterface& GAMGCp,
89  const lduInterfaceField& fineInterface
90  ),
91  (GAMGCp, fineInterface)
92  );
93 
95  (
96  autoPtr,
99  (
100  const GAMGInterface& GAMGCp,
101  const bool doTransform,
102  const int rank
103  ),
104  (GAMGCp, doTransform, rank)
105  );
106 
108  (
109  autoPtr,
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
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
179  )
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  }
206 
207 
208  // I/O
209 
210  //- Write to stream
211  virtual void write(Ostream&) const = 0;
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
virtual autoPtr< GAMGInterfaceField > clone(const GAMGInterface &GAMGCp, const UPtrList< lduInterfaceField > &other) const =0
Construct by assembling and return a clone.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
declareRunTimeSelectionTable(autoPtr, GAMGInterfaceField, lduInterfaceField,(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterface),(GAMGCp, fineInterface))
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
A class for handling words, derived from Foam::string.
Definition: word.H:63
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: HashTable.H:106
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
static autoPtr< GAMGInterfaceField > New(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterface)
Return a pointer to a new interface created on freestore given.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:50
lduInterfaceField(const lduInterfaceField &)=delete
No copy construct.
TypeName("GAMGInterfaceField")
Runtime type information.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
Definition: exprTraits.C:70
const GAMGInterface & interface() const
Return interface.
Abstract base class for GAMG agglomerated interface fields.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual void write(Ostream &) const =0
Write to stream.
virtual ~GAMGInterfaceField()=default
Destructor.
Namespace for OpenFOAM.