d2dt2Scheme.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) 2011-2019 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::fv::d2dt2Scheme
26 
27 Description
28  Abstract base class for d2dt2 schemes.
29 
30 SourceFiles
31  d2dt2Scheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef d2dt2Scheme_H
36 #define d2dt2Scheme_H
37 
38 #include "tmp.H"
39 #include "dimensionedType.H"
40 #include "volFieldsFwd.H"
41 #include "surfaceFieldsFwd.H"
42 #include "typeInfo.H"
43 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 template<class Type>
51 class fvMatrix;
52 
53 class fvMesh;
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class d2dt2Scheme Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
65 class d2dt2Scheme
66 :
67  public tmp<d2dt2Scheme<Type>>::refCount
68 {
69 
70 protected:
71 
72  // Protected data
73 
74  const fvMesh& mesh_;
75 
76 
77 public:
78 
79  //- Runtime type information
80  virtual const word& type() const = 0;
81 
82 
83  // Declare run-time constructor selection tables
84 
86  (
87  tmp,
89  Istream,
90  (const fvMesh& mesh, Istream& schemeData),
91  (mesh, schemeData)
92  );
93 
94 
95  // Constructors
96 
97  //- Construct from mesh
98  d2dt2Scheme(const fvMesh& mesh)
99  :
100  mesh_(mesh)
101  {}
102 
103  //- Construct from mesh and Istream
104  d2dt2Scheme(const fvMesh& mesh, Istream&)
105  :
106  mesh_(mesh)
107  {}
108 
109  //- Disallow default bitwise copy construction
110  d2dt2Scheme(const d2dt2Scheme&);
111 
112 
113  // Selectors
114 
115  //- Return a pointer to a new d2dt2Scheme created on freestore
116  static tmp<d2dt2Scheme<Type>> New
117  (
118  const fvMesh& mesh,
119  Istream& schemeData
120  );
121 
122 
123  //- Destructor
124  virtual ~d2dt2Scheme();
125 
126 
127  // Member Functions
128 
129  //- Return mesh reference
130  const fvMesh& mesh() const
131  {
132  return mesh_;
133  }
134 
136  (
138  ) = 0;
139 
141  (
142  const volScalarField&,
144  ) = 0;
145 
147  (
149  ) = 0;
150 
152  (
153  const dimensionedScalar&,
155  ) = 0;
156 
158  (
159  const volScalarField&,
161  ) = 0;
162 
163 
164  // Member Operators
165 
166  //- Disallow default bitwise assignment
167  void operator=(const d2dt2Scheme&) = delete;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace fv
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 // Add the patch constructor functions to the hash tables
183 #define makeFvD2dt2TypeScheme(SS, Type) \
184  defineNamedTemplateTypeNameAndDebug(Foam::fv::SS<Foam::Type>, 0); \
185  \
186  namespace Foam \
187  { \
188  namespace fv \
189  { \
190  d2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type>> \
191  add##SS##Type##IstreamConstructorToTable_; \
192  } \
193  }
195 #define makeFvD2dt2Scheme(SS) \
196  \
197 makeFvD2dt2TypeScheme(SS, scalar) \
198 makeFvD2dt2TypeScheme(SS, vector) \
199 makeFvD2dt2TypeScheme(SS, sphericalTensor) \
200 makeFvD2dt2TypeScheme(SS, symmTensor) \
201 makeFvD2dt2TypeScheme(SS, tensor)
202 
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #ifdef NoRepository
207  #include "d2dt2Scheme.C"
208 #endif
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
virtual const word & type() const =0
Runtime type information.
Reference counter for various OpenFOAM components.
Definition: refCount.H:49
Abstract base class for d2dt2 schemes.
Definition: d2dt2Scheme.H:64
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Generic GeometricField class.
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcD2dt2(const GeometricField< Type, fvPatchField, volMesh > &)=0
d2dt2Scheme(const fvMesh &mesh)
Construct from mesh.
Definition: d2dt2Scheme.H:97
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
const fvMesh & mesh() const
Return mesh reference.
Definition: d2dt2Scheme.H:129
declareRunTimeSelectionTable(tmp, d2dt2Scheme, Istream,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
virtual ~d2dt2Scheme()
Destructor.
Definition: d2dt2Scheme.C:90
Abstract base class for finite volume calculus d2dt2 schemes.
static tmp< d2dt2Scheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new d2dt2Scheme created on freestore.
Definition: d2dt2Scheme.C:46
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual tmp< fvMatrix< Type > > fvmD2dt2(const GeometricField< Type, fvPatchField, volMesh > &)=0
const fvMesh & mesh_
Definition: d2dt2Scheme.H:73
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:53
void operator=(const d2dt2Scheme &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.