laplacianScheme.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::laplacianScheme
28
29Group
30 grpFvLaplacianSchemes
31
32Description
33 Abstract base class for laplacian schemes.
34
35SourceFiles
36 laplacianScheme.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef laplacianScheme_H
41#define laplacianScheme_H
42
43#include "tmp.H"
44#include "volFieldsFwd.H"
45#include "surfaceFieldsFwd.H"
46#include "linear.H"
47#include "correctedSnGrad.H"
48#include "typeInfo.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56template<class Type>
57class fvMatrix;
58
59class fvMesh;
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace fv
64{
65
66/*---------------------------------------------------------------------------*\
67 Class laplacianScheme Declaration
68\*---------------------------------------------------------------------------*/
69
70template<class Type, class GType>
72:
73 public refCount
74{
75
76protected:
77
78 // Protected data
80 const fvMesh& mesh_;
83
84
85private:
86
87 // Private Member Functions
88
89 //- No copy construct
90 laplacianScheme(const laplacianScheme&) = delete;
91
92 //- No copy assignment
93 void operator=(const laplacianScheme&) = delete;
94
95
96public:
97
98 //- Runtime type information
99 virtual const word& type() const = 0;
100
101
102 // Declare run-time constructor selection tables
105 (
106 tmp,
108 Istream,
109 (const fvMesh& mesh, Istream& schemeData),
110 (mesh, schemeData)
111 );
112
113
114 // Constructors
115
116 //- Construct from mesh
118 :
119 mesh_(mesh),
120 tinterpGammaScheme_(new linear<GType>(mesh)),
122 {}
123
124 //- Construct from mesh and Istream
126 :
127 mesh_(mesh),
128 tinterpGammaScheme_(nullptr),
129 tsnGradScheme_(nullptr)
130 {
132 (
134 );
135
137 (
139 );
140 }
141
142 //- Construct from mesh, interpolation and snGradScheme schemes
144 (
145 const fvMesh& mesh,
147 const tmp<snGradScheme<Type>>& sngs
148 )
149 :
150 mesh_(mesh),
152 tsnGradScheme_(sngs)
153 {}
154
155
156 // Selectors
157
158 //- Return a pointer to a new laplacianScheme created on freestore
160 (
161 const fvMesh& mesh,
162 Istream& schemeData
163 );
164
165
166 //- Destructor
167 virtual ~laplacianScheme() = default;
168
169
170 // Member Functions
171
172 //- Return mesh reference
173 const fvMesh& mesh() const
174 {
175 return mesh_;
176 }
179 (
182 ) = 0;
183
185 (
188 );
191 (
193 ) = 0;
196 (
199 ) = 0;
200
202 (
205 );
206};
207
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211} // End namespace fv
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215} // End namespace Foam
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219// Add the patch constructor functions to the hash tables
221#define makeFvLaplacianTypeScheme(SS, GType, Type) \
222 typedef Foam::fv::SS<Foam::Type, Foam::GType> SS##Type##GType; \
223 defineNamedTemplateTypeNameAndDebug(SS##Type##GType, 0); \
224 \
225 namespace Foam \
226 { \
227 namespace fv \
228 { \
229 typedef SS<Type, GType> SS##Type##GType; \
230 \
231 laplacianScheme<Type, GType>:: \
232 addIstreamConstructorToTable<SS<Type, GType>> \
233 add##SS##Type##GType##IstreamConstructorToTable_; \
234 } \
235 }
236
238#define makeFvLaplacianScheme(SS) \
239 \
240makeFvLaplacianTypeScheme(SS, scalar, scalar) \
241makeFvLaplacianTypeScheme(SS, symmTensor, scalar) \
242makeFvLaplacianTypeScheme(SS, tensor, scalar) \
243makeFvLaplacianTypeScheme(SS, scalar, vector) \
244makeFvLaplacianTypeScheme(SS, symmTensor, vector) \
245makeFvLaplacianTypeScheme(SS, tensor, vector) \
246makeFvLaplacianTypeScheme(SS, scalar, sphericalTensor) \
247makeFvLaplacianTypeScheme(SS, symmTensor, sphericalTensor) \
248makeFvLaplacianTypeScheme(SS, tensor, sphericalTensor) \
249makeFvLaplacianTypeScheme(SS, scalar, symmTensor) \
250makeFvLaplacianTypeScheme(SS, symmTensor, symmTensor) \
251makeFvLaplacianTypeScheme(SS, tensor, symmTensor) \
252makeFvLaplacianTypeScheme(SS, scalar, tensor) \
253makeFvLaplacianTypeScheme(SS, symmTensor, tensor) \
254makeFvLaplacianTypeScheme(SS, tensor, tensor)
255
256// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257
258#ifdef NoRepository
259 #include "laplacianScheme.C"
260#endif
261
262// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263
264#endif
265
266// ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Surface gradient scheme with full explicit non-orthogonal correction.
Abstract base class for laplacian schemes.
virtual tmp< fvMatrix< Type > > fvmLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)=0
declareRunTimeSelectionTable(tmp, laplacianScheme, Istream,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< Type, fvPatchField, volMesh > &)=0
tmp< snGradScheme< Type > > tsnGradScheme_
laplacianScheme(const fvMesh &mesh, const tmp< surfaceInterpolationScheme< GType > > &igs, const tmp< snGradScheme< Type > > &sngs)
Construct from mesh, interpolation and snGradScheme schemes.
tmp< surfaceInterpolationScheme< GType > > tinterpGammaScheme_
virtual ~laplacianScheme()=default
Destructor.
static tmp< laplacianScheme< Type, GType > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new laplacianScheme created on freestore.
const fvMesh & mesh() const
Return mesh reference.
laplacianScheme(const fvMesh &mesh, Istream &is)
Construct from mesh and Istream.
laplacianScheme(const fvMesh &mesh)
Construct from mesh.
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)=0
virtual const word & type() const =0
Runtime type information.
Abstract base class for runtime selected snGrad surface normal gradient schemes.
Definition: snGradScheme.H:79
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
A class for handling words, derived from Foam::string.
Definition: word.H:68
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)