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