faDdtScheme.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) 2016-2017 Wikki Ltd
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::DdtScheme
28 
29 Description
30  Abstract base class for finite volume calculus ddt schemes.
31 
32 SourceFiles
33  faDdtScheme.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef faDdtScheme_H
38 #define faDdtScheme_H
39 
40 #include "tmp.H"
41 #include "dimensionedType.H"
42 #include "areaFieldsFwd.H"
43 #include "edgeFieldsFwd.H"
44 #include "typeInfo.H"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 template<class Type>
53 class faMatrix;
54 
55 class faMesh;
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace fa
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class faDdtScheme Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<class Type>
67 class faDdtScheme
68 :
69  public refCount
70 {
71 
72 protected:
73 
74  // Protected data
75 
76  const faMesh& mesh_;
77 
78 
79  // Private Member Functions
80 
81  //- No copy construct
82  faDdtScheme(const faDdtScheme&) = delete;
83 
84  //- No copy assignment
85  void operator=(const faDdtScheme&) = 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 faMesh& mesh, Istream& schemeData),
102  (mesh, schemeData)
103  );
104 
105 
106  // Constructors
107 
108  //- Construct from mesh
109  faDdtScheme(const faMesh& mesh)
110  :
111  mesh_(mesh)
112  {}
113 
114  //- Construct from mesh and Istream
115  faDdtScheme(const faMesh& mesh, Istream&)
116  :
117  mesh_(mesh)
118  {}
119 
120 
121  // Selectors
122 
123  //- Return a pointer to a new faDdtScheme created on freestore
124  static tmp<faDdtScheme<Type>> New
125  (
126  const faMesh& mesh,
127  Istream& schemeData
128  );
129 
130 
131  //- Destructor
132  virtual ~faDdtScheme();
133 
134 
135  // Member Functions
136 
137  //- Return mesh reference
138  const faMesh& mesh() const
139  {
140  return mesh_;
141  }
142 
144  (
145  const dimensioned<Type>
146  ) = 0;
147 
149  (
150  const dimensioned<Type>
151  ) = 0;
152 
154  (
156  ) = 0;
157 
159  (
161  ) = 0;
162 
164  (
165  const dimensionedScalar&,
167  ) = 0;
168 
170  (
171  const dimensionedScalar&,
173  ) = 0;
174 
176  (
177  const areaScalarField&,
179  ) = 0;
180 
182  (
183  const areaScalarField&,
185  ) = 0;
186 
187  virtual tmp<faMatrix<Type>> famDdt
188  (
190  ) = 0;
191 
192  virtual tmp<faMatrix<Type>> famDdt
193  (
194  const dimensionedScalar&,
196  ) = 0;
197 
198  virtual tmp<faMatrix<Type>> famDdt
199  (
200  const areaScalarField&,
202  ) = 0;
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace fa
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 // Add the patch constructor functions to the hash tables
217 
218 #define makeFaDdtTypeScheme(SS, Type) \
219  \
220  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
221  \
222  namespace Foam \
223  { \
224  namespace fa \
225  { \
226  faDdtScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
227  add##SS##Type##IstreamConstructorToTable_; \
228  } \
229  }
230 
231 
232 #define makeFaDdtScheme(SS) \
233  \
234 makeFaDdtTypeScheme(SS, scalar) \
235 makeFaDdtTypeScheme(SS, vector) \
236 makeFaDdtTypeScheme(SS, tensor)
237 
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #ifdef NoRepository
242  #include "faDdtScheme.C"
243 #endif
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
Foam::fa::faDdtScheme::mesh_
const faMesh & mesh_
Definition: faDdtScheme.H:75
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fa::faDdtScheme::New
static tmp< faDdtScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new faDdtScheme created on freestore.
Definition: faDdtScheme.C:46
typeInfo.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
faDdtScheme.C
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
Foam::fa::faDdtScheme::type
virtual const word & type() const =0
Runtime type information.
Foam::fa::faDdtScheme::faDdtScheme
faDdtScheme(const faDdtScheme &)=delete
No copy construct.
Foam::fa::faDdtScheme::facDdt
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facDdt(const dimensioned< Type >)=0
Foam::fa::faDdtScheme::facDdt0
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facDdt0(const dimensioned< Type >)=0
Foam::fa::faDdtScheme::declareRunTimeSelectionTable
declareRunTimeSelectionTable(tmp, faDdtScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
Foam::fa::faDdtScheme::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: faDdtScheme.H:137
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
areaFieldsFwd.H
Forwards and collection of common area field types.
Foam::fa::faDdtScheme
Definition: faDdtScheme.H:66
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
tmp.H
Foam::fa::faDdtScheme::faDdtScheme
faDdtScheme(const faMesh &mesh)
Construct from mesh.
Definition: faDdtScheme.H:108
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::fa::faDdtScheme::famDdt
virtual tmp< faMatrix< Type > > famDdt(const GeometricField< Type, faPatchField, areaMesh > &)=0
Foam::fa::faDdtScheme::faDdtScheme
faDdtScheme(const faMesh &mesh, Istream &)
Construct from mesh and Istream.
Definition: faDdtScheme.H:114
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::fa::faDdtScheme::operator=
void operator=(const faDdtScheme &)=delete
No copy assignment.
Foam::fa::faDdtScheme::~faDdtScheme
virtual ~faDdtScheme()
Destructor.
Definition: faDdtScheme.C:89
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
edgeFieldsFwd.H
Forwards for edge field types.
dimensionedType.H