faD2dt2Scheme.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) 2017 Volkswagen AG
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fa::faD2dt2Scheme
28 
29 Description
30  Abstract base class for d2dt2 schemes.
31 
32 SourceFiles
33  faD2dt2Scheme.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef faD2dt2Scheme_H
38 #define faD2dt2Scheme_H
39 
40 #include "dimensionedType.H"
41 #include "areaFieldsFwd.H"
42 #include "edgeFieldsFwd.H"
43 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward Declarations
51 template<class Type>
52 class faMatrix;
53 
54 class faMesh;
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace fa
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class faD2dt2Scheme Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Type>
66 class faD2dt2Scheme
67 :
68  public refCount
69 {
70 protected:
71 
72  // Protected Data
73 
74  //- Reference to mesh
75  const faMesh& mesh_;
76 
77 
78 public:
79 
80  //- Runtime type information
81  virtual const word& type() const = 0;
82 
83 
84  // Declare run-time constructor selection tables
85 
87  (
88  tmp,
90  Istream,
91  (const faMesh& mesh, Istream& schemeData),
92  (mesh, schemeData)
93  );
94 
95 
96  // Generated Methods
97 
98  //- No copy construct
99  faD2dt2Scheme(const faD2dt2Scheme&) = delete;
100 
101  //- No copy assignment
102  void operator=(const faD2dt2Scheme&) = delete;
103 
104 
105  // Constructors
106 
107  //- Construct from mesh
108  faD2dt2Scheme(const faMesh& mesh)
109  :
110  mesh_(mesh)
111  {}
112 
113  //- Construct from mesh and Istream
114  faD2dt2Scheme(const faMesh& mesh, Istream&)
115  :
116  mesh_(mesh)
117  {}
118 
119 
120  // Selectors
122  //- Return a pointer to a new d2dt2Scheme created on freestore
124  (
125  const faMesh& mesh,
126  Istream& schemeData
127  );
128 
129 
130  //- Destructor
131  virtual ~faD2dt2Scheme();
132 
133 
134  // Member Functions
135 
136  //- Return mesh reference
137  const faMesh& mesh() const noexcept { return mesh_; }
138 
140  (
141  const dimensioned<Type>
142  ) = 0;
143 
145  (
147  ) = 0;
148 
150  (
151  const dimensionedScalar&,
153  ) = 0;
154 
156  (
157  const areaScalarField&,
159  ) = 0;
160 
162  (
164  ) = 0;
165 
167  (
168  const dimensionedScalar&,
170  ) = 0;
171 
173  (
174  const areaScalarField&,
176  ) = 0;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace fa
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 // Add the patch constructor functions to the hash tables
191 
192 #define makeFaD2dt2TypeScheme(SS, Type) \
193  \
194  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
195  \
196  namespace Foam \
197  { \
198  namespace fa \
199  { \
200  faD2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type>> \
201  add##SS##Type##IstreamConstructorToTable_; \
202  } \
203  }
204 
206 #define makeFaD2dt2Scheme(SS) \
207  \
208 makeFaD2dt2TypeScheme(SS, scalar) \
209 makeFaD2dt2TypeScheme(SS, vector) \
210 makeFaD2dt2TypeScheme(SS, tensor)
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #ifdef NoRepository
216 # include "faD2dt2Scheme.C"
217 #endif
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:133
const faMesh & mesh_
Reference to mesh.
Definition: faD2dt2Scheme.H:72
Abstract base class for d2dt2 schemes.
Definition: faD2dt2Scheme.H:61
const faMesh & mesh() const noexcept
Return mesh reference.
virtual const word & type() const =0
Runtime type information.
Reference counter for various OpenFOAM components.
Definition: refCount.H:44
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Generic GeometricField class.
Generic dimensioned Type class.
faD2dt2Scheme(const faD2dt2Scheme &)=delete
No copy construct.
void operator=(const faD2dt2Scheme &)=delete
No copy assignment.
Forwards for edge field types.
A class for handling words, derived from Foam::string.
Definition: word.H:63
declareRunTimeSelectionTable(tmp, faD2dt2Scheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facD2dt2(const dimensioned< Type >)=0
const direction noexcept
Definition: Scalar.H:258
static tmp< faD2dt2Scheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new d2dt2Scheme created on freestore.
Definition: faD2dt2Scheme.C:38
virtual ~faD2dt2Scheme()
Destructor.
Definition: faD2dt2Scheme.C:80
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< faMatrix< Type > > famD2dt2(const GeometricField< Type, faPatchField, areaMesh > &)=0
Forwards and collection of common area field types.
Namespace for OpenFOAM.