Loading...
Searching...
No Matches
faLaplacianScheme.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::laplacianScheme
28
29Description
30 Abstract base class for finite area calculus laplacian schemes.
31
32SourceFiles
33 faLaplacianScheme.C
34 faLaplacianSchemes.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_faLaplacianScheme_H
39#define Foam_faLaplacianScheme_H
40
41#include "areaFieldsFwd.H"
42#include "edgeFieldsFwd.H"
43#include "correctedLnGrad.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
52template<class Type> class faMatrix;
53class faMesh;
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace fa
58{
59
60/*---------------------------------------------------------------------------*\
61 Class laplacianScheme Declaration
62\*---------------------------------------------------------------------------*/
63
64template<class Type>
66:
67 public refCount
69protected:
71 // Protected Data
72
73 const faMesh& mesh_;
74
77
79public:
80
81 // Declare run-time constructor selection tables
82
84 (
85 tmp,
87 Istream,
88 (const faMesh& mesh, Istream& schemeData),
89 (mesh, schemeData)
90 );
91
92
93 // Generated Methods
94
95 //- No copy construct
96 laplacianScheme(const laplacianScheme&) = delete;
97
98 //- No copy assignment
99 void operator=(const laplacianScheme&) = delete;
100
101
102 // Constructors
103
104 //- Construct from mesh
107 mesh_(mesh),
110 {}
111
112 //- Construct from mesh and Istream
114 :
115 mesh_(mesh)
117 if (is.eof())
118 {
119 tinterpGammaScheme_.reset
120 (
121 new linearEdgeInterpolation<scalar>(mesh)
122 );
123
124 tlnGradScheme_.reset
125 (
126 new correctedLnGrad<Type>(mesh)
127 );
128 }
129 else
130 {
131 tinterpGammaScheme_.reset
132 (
133 edgeInterpolationScheme<scalar>::New(mesh, is)
134 );
135
136 tlnGradScheme_.reset
137 (
138 lnGradScheme<Type>::New(mesh, is)
139 );
140 }
141 }
142
143
144 // Selectors
145
146 //- Return a pointer to a new laplacianScheme created on freestore
148 (
149 const faMesh& mesh,
150 Istream& schemeData
151 );
152
153
154 //- Destructor
155 virtual ~laplacianScheme();
156
157
158 // Member Functions
159
160 //- Return mesh reference
161 const faMesh& mesh() const
162 {
163 return mesh_;
164 }
165
167 (
168 const edgeScalarField&,
170 ) = 0;
171
173 (
174 const areaScalarField&,
176 );
177
179 (
181 ) = 0;
182
184 (
185 const edgeScalarField&,
187 ) = 0;
188
190 (
191 const areaScalarField&,
193 );
194};
195
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199} // End namespace fa
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203} // End namespace Foam
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207// Add the patch constructor functions to the hash tables
208
209#define makeFaLaplacianTypeScheme(SS, Type) \
210 \
211 defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
212 \
213 namespace Foam \
214 { \
215 namespace fa \
216 { \
217 laplacianScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
218 add##SS##Type##IstreamConstructorToTable_; \
219 } \
220 }
221
222
223#define makeFaLaplacianScheme(SS) \
224 \
225makeFaLaplacianTypeScheme(SS, scalar) \
226makeFaLaplacianTypeScheme(SS, vector) \
227makeFaLaplacianTypeScheme(SS, tensor)
228
229
230// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231
232#ifdef NoRepository
233 #include "faLaplacianScheme.C"
234#endif
235
236// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237
238#endif
239
240// ************************************************************************* //
Forwards and collection of common area field types.
Generic GeometricField class.
bool eof() const noexcept
True if end of input seen.
Definition IOstream.H:289
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition faMatrix.H:108
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
Simple central-difference lnGrad scheme with non-orthogonal correction.
declareRunTimeSelectionTable(tmp, laplacianScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
virtual tmp< faMatrix< Type > > famLaplacian(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &)=0
laplacianScheme(const faMesh &mesh)
Construct from mesh.
laplacianScheme(const faMesh &mesh, Istream &is)
Construct from mesh and Istream.
laplacianScheme(const laplacianScheme &)=delete
No copy construct.
void operator=(const laplacianScheme &)=delete
No copy assignment.
virtual ~laplacianScheme()
Destructor.
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facLaplacian(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &)=0
tmp< edgeInterpolationScheme< scalar > > tinterpGammaScheme_
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facLaplacian(const GeometricField< Type, faPatchField, areaMesh > &)=0
const faMesh & mesh() const
Return mesh reference.
tmp< lnGradScheme< Type > > tlnGradScheme_
static tmp< laplacianScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new laplacianScheme created on freestore.
Central-differencing interpolation scheme class.
constexpr refCount() noexcept
Default construct, initializing count to 0.
Definition refCount.H:63
A class for managing temporary objects.
Definition tmp.H:75
dynamicFvMesh & mesh
Forwards for edge field types.
Namespace for finite-area.
Definition limitHeight.C:30
Namespace for OpenFOAM.
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
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).