divScheme.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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fv::divScheme
28
29Group
30 grpFvDivSchemes
31
32Description
33 Abstract base class for div schemes.
34
35SourceFiles
36 divScheme.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef divScheme_H
41#define divScheme_H
42
43#include "tmp.H"
44#include "volFieldsFwd.H"
45#include "surfaceFieldsFwd.H"
46#include "linear.H"
47#include "typeInfo.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55template<class Type>
56class fvMatrix;
57
58class fvMesh;
59
60// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61
62namespace fv
63{
64
65/*---------------------------------------------------------------------------*\
66 Class divScheme Declaration
67\*---------------------------------------------------------------------------*/
68
69template<class Type>
70class divScheme
71:
72 public refCount
73{
74
75protected:
76
77 // Protected data
79 const fvMesh& mesh_;
81
82
83 // Private Member Functions
84
85 //- No copy construct
86 divScheme(const divScheme&) = delete;
87
88 //- No copy assignment
89 void operator=(const divScheme&) = delete;
90
91
92public:
93
94 //- Runtime type information
95 virtual const word& type() const = 0;
96
97
98 // Declare run-time constructor selection tables
101 (
102 tmp,
103 divScheme,
104 Istream,
105 (const fvMesh& mesh, Istream& schemeData),
106 (mesh, schemeData)
107 );
108
109
110 // Constructors
111
112 //- Construct from mesh
113 divScheme(const fvMesh& mesh)
114 :
115 mesh_(mesh),
116 tinterpScheme_(new linear<Type>(mesh))
117 {}
118
119 //- Construct from mesh and Istream
120 divScheme(const fvMesh& mesh, Istream& is)
121 :
122 mesh_(mesh),
124 {}
125
126
127 // Selectors
128
129 //- Return a pointer to a new divScheme created on freestore
131 (
132 const fvMesh& mesh,
133 Istream& schemeData
134 );
135
136
137 //- Destructor
138 virtual ~divScheme() = default;
139
140
141 // Member Functions
142
143 //- Return mesh reference
144 const fvMesh& mesh() const
145 {
146 return mesh_;
147 }
148
149 virtual tmp
150 <
153 > fvcDiv
154 (
156 ) = 0;
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace fv
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166} // End namespace Foam
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170// Add the patch constructor functions to the hash tables
172#define makeFvDivTypeScheme(SS, Type) \
173 defineNamedTemplateTypeNameAndDebug(Foam::fv::SS<Foam::Type>, 0); \
174 \
175 namespace Foam \
176 { \
177 namespace fv \
178 { \
179 divScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
180 add##SS##Type##IstreamConstructorToTable_; \
181 } \
182 }
184#define makeFvDivScheme(SS) \
185 \
186makeFvDivTypeScheme(SS, vector) \
187makeFvDivTypeScheme(SS, sphericalTensor) \
188makeFvDivTypeScheme(SS, symmTensor) \
189makeFvDivTypeScheme(SS, tensor)
190
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194#ifdef NoRepository
195 #include "divScheme.C"
196#endif
197
198// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199
200#endif
201
202// ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
Abstract base class for div schemes.
Definition: divScheme.H:72
const fvMesh & mesh_
Definition: divScheme.H:78
divScheme(const divScheme &)=delete
No copy construct.
tmp< surfaceInterpolationScheme< Type > > tinterpScheme_
Definition: divScheme.H:79
void operator=(const divScheme &)=delete
No copy assignment.
declareRunTimeSelectionTable(tmp, divScheme, Istream,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
virtual ~divScheme()=default
Destructor.
const fvMesh & mesh() const
Return mesh reference.
Definition: divScheme.H:143
divScheme(const fvMesh &mesh, Istream &is)
Construct from mesh and Istream.
Definition: divScheme.H:119
static tmp< divScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new divScheme created on freestore.
Definition: divScheme.C:50
virtual tmp< GeometricField< typename innerProduct< vector, Type >::type, fvPatchField, volMesh > > fvcDiv(const GeometricField< Type, fvPatchField, volMesh > &)=0
virtual const word & type() const =0
Runtime type information.
divScheme(const fvMesh &mesh)
Construct from mesh.
Definition: divScheme.H:112
Central-differencing interpolation scheme class.
Definition: linear.H:58
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
Abstract base class for surface interpolation schemes.
A class for managing temporary objects.
Definition: tmp.H:65
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:54
type
Volume classification types.
Definition: volumeType.H:66
A class for handling words, derived from Foam::string.
Definition: word.H:68
Abstract base class for finite volume calculus div schemes.
Namespace for OpenFOAM.
labelList fv(nPoints)
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)