lnGradScheme.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-------------------------------------------------------------------------------
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::fa::lnGradScheme
28
29Description
30 Abstract base class for lnGrad schemes.
31
32SourceFiles
33 lnGradScheme.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef lnGradScheme_H
38#define lnGradScheme_H
39
40#include "tmp.H"
41#include "areaFieldsFwd.H"
42#include "edgeFieldsFwd.H"
43#include "typeInfo.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51class faMesh;
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace fa
56{
57
58/*---------------------------------------------------------------------------*\
59 Class lnGradScheme Declaration
60\*---------------------------------------------------------------------------*/
61
62template<class Type>
63class lnGradScheme
64:
65 public refCount
66{
67 // Private data
68
69 //- Hold reference to mesh
70 const faMesh& mesh_;
71
72
73 // Private Member Functions
74
75 //- No copy assignment
76 void operator=(const lnGradScheme&) = delete;
77
78
79public:
80
81 // Declare run-time constructor selection tables
84 (
85 tmp,
87 Mesh,
88 (const faMesh& mesh, Istream& schemeData),
89 (mesh, schemeData)
90 );
91
92
93 // Constructors
94
95 //- Construct from mesh
97 :
98 mesh_(mesh)
99 {}
100
101
102 // Selectors
103
104 //- Return new tmp interpolation scheme
106 (
107 const faMesh& mesh,
108 Istream& schemeData
109 );
110
111
112 //- Destructor
113 virtual ~lnGradScheme();
114
115
116 // Member Functions
117
118 //- Return mesh reference
119 const faMesh& mesh() const
120 {
121 return mesh_;
122 }
123
124 //- Return the lnGrad of the given cell field
125 // with the given weighting factors
127 lnGrad
128 (
131 const word& snGradName = "lnGrad"
132 );
133
134 //- Return the interpolation weighting factors for the given field
136 (
138 ) const = 0;
139
140 //- Return true if this scheme uses an explicit correction
141 virtual bool corrected() const
142 {
143 return false;
144 }
145
146 //- Return the explicit correction to the lnGrad
147 // for the given field
150 {
151 return nullptr;
152 }
153
154 //- Return the lnGrad of the given cell field
155 // with explicit correction
158
159 //- Return the lnGrad of the given tmp cell field
160 // with explicit correction
162 lnGrad
163 (
165 ) const;
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace fa
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175} // End namespace Foam
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179// Add the patch constructor functions to the hash tables
181#define makeLnGradTypeScheme(SS, Type) \
182 \
183 defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
184 \
185 namespace Foam \
186 { \
187 namespace fa \
188 { \
189 lnGradScheme<Type>::addMeshConstructorToTable<SS<Type>> \
190 add##SS##Type##MeshConstructorToTable_; \
191 } \
192 }
194#define makeLnGradScheme(SS) \
195 \
196makeLnGradTypeScheme(SS, scalar) \
197makeLnGradTypeScheme(SS, vector) \
198makeLnGradTypeScheme(SS, tensor)
199
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#ifdef NoRepository
204 #include "lnGradScheme.C"
205#endif
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208
209#endif
210
211// ************************************************************************* //
Forwards and collection of common area field types.
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Abstract base class for lnGrad schemes.
Definition: lnGradScheme.H:65
virtual ~lnGradScheme()
Destructor.
Definition: lnGradScheme.C:92
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: lnGradScheme.H:140
static tmp< GeometricField< Type, faePatchField, edgeMesh > > lnGrad(const GeometricField< Type, faPatchField, areaMesh > &, const tmp< edgeScalarField > &, const word &snGradName="lnGrad")
Return the lnGrad of the given cell field.
Definition: lnGradScheme.C:101
declareRunTimeSelectionTable(tmp, lnGradScheme, Mesh,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
lnGradScheme(const faMesh &mesh)
Construct from mesh.
Definition: lnGradScheme.H:95
static tmp< lnGradScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: lnGradScheme.C:49
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > correction(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the explicit correction to the lnGrad.
Definition: lnGradScheme.H:148
virtual tmp< edgeScalarField > deltaCoeffs(const GeometricField< Type, faPatchField, areaMesh > &) const =0
Return the interpolation weighting factors for the given field.
const faMesh & mesh() const
Return mesh reference.
Definition: lnGradScheme.H:118
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Forwards for edge field types.
Namespace for OpenFOAM.
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)