Loading...
Searching...
No Matches
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 "areaFieldsFwd.H"
41#include "edgeFieldsFwd.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49// Forward Declarations
50class faMesh;
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace fa
55{
56
57/*---------------------------------------------------------------------------*\
58 Class lnGradScheme Declaration
59\*---------------------------------------------------------------------------*/
60
61template<class Type>
62class lnGradScheme
63:
64 public refCount
65{
66 // Private Data
67
68 //- Hold reference to mesh
69 const faMesh& mesh_;
70
71
72public:
74 // Declare run-time constructor selection tables
75
77 (
78 tmp,
80 Mesh,
81 (const faMesh& mesh, Istream& schemeData),
82 (mesh, schemeData)
83 );
84
85
86 // Generated Methods
87
88 //- No copy construct
89 lnGradScheme(const lnGradScheme&) = delete;
90
91 //- No copy assignment
92 void operator=(const lnGradScheme&) = delete;
94
95 // Constructors
96
97 //- Construct from mesh
99 :
100 mesh_(mesh)
101 {}
102
103
104 // Selectors
105
106 //- Return new tmp interpolation scheme
108 (
109 const faMesh& mesh,
110 Istream& schemeData
111 );
112
113
114 //- Destructor
115 virtual ~lnGradScheme();
116
117
118 // Member Functions
119
120 //- Return mesh reference
121 const faMesh& mesh() const noexcept { return mesh_; }
122
123 //- Return the lnGrad of the given cell field
124 // with the given weighting factors
126 lnGrad
127 (
130 const word& snGradName = "lnGrad"
131 );
132
133 //- Return the interpolation weighting factors for the given field
135 (
137 ) const = 0;
138
139 //- Return true if this scheme uses an explicit correction
140 virtual bool corrected() const { return false; }
141
142 //- Return the explicit correction to the lnGrad
143 // for the given field
146 {
147 return nullptr;
149
150 //- Return the lnGrad of the given cell field
151 // with explicit correction
154
155 //- Return the lnGrad of the given tmp cell field
156 // with explicit correction
158 lnGrad
159 (
161 ) const;
162};
163
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167} // End namespace fa
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175// Add the patch constructor functions to the hash tables
176
177#define makeLnGradTypeScheme(SS, Type) \
178 \
179 defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
180 \
181 namespace Foam \
182 { \
183 namespace fa \
184 { \
185 lnGradScheme<Type>::addMeshConstructorToTable<SS<Type>> \
186 add##SS##Type##MeshConstructorToTable_; \
187 } \
188 }
189
190#define makeLnGradScheme(SS) \
191 \
192makeLnGradTypeScheme(SS, scalar) \
193makeLnGradTypeScheme(SS, vector) \
194makeLnGradTypeScheme(SS, tensor)
195
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199#ifdef NoRepository
200 #include "lnGradScheme.C"
201#endif
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205#endif
206
207// ************************************************************************* //
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:60
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
virtual ~lnGradScheme()
Destructor.
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
lnGradScheme(const lnGradScheme &)=delete
No copy construct.
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.
declareRunTimeSelectionTable(tmp, lnGradScheme, Mesh,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
lnGradScheme(const faMesh &mesh)
Construct from mesh.
const faMesh & mesh() const noexcept
Return mesh reference.
static tmp< lnGradScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > correction(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the explicit correction to the lnGrad.
virtual tmp< edgeScalarField > deltaCoeffs(const GeometricField< Type, faPatchField, areaMesh > &) const =0
Return the interpolation weighting factors for the given field.
void operator=(const lnGradScheme &)=delete
No copy assignment.
constexpr refCount() noexcept
Default construct, initializing count to 0.
Definition refCount.H:63
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Forwards for edge field types.
Namespace for finite-area.
Definition limitHeight.C:30
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265
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).