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 faLaplacianScheme_H
39#define faLaplacianScheme_H
40
41#include "tmp.H"
42#include "areaFieldsFwd.H"
43#include "edgeFieldsFwd.H"
45#include "correctedLnGrad.H"
46#include "typeInfo.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54template<class Type>
55class faMatrix;
56
57class faMesh;
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61namespace fa
62{
63
64/*---------------------------------------------------------------------------*\
65 Class laplacianScheme Declaration
66\*---------------------------------------------------------------------------*/
67
68template<class Type>
70:
71 public refCount
72{
73
74protected:
75
76 // Protected data
78 const faMesh& mesh_;
81
82
83 // Private Member Functions
84
85 //- No copy construct
86 laplacianScheme(const laplacianScheme&) = delete;
87
88 //- No copy assignment
89 void operator=(const laplacianScheme&) = delete;
90
91
92public:
93
94 // Declare run-time constructor selection tables
97 (
98 tmp,
100 Istream,
101 (const faMesh& mesh, Istream& schemeData),
102 (mesh, schemeData)
103 );
104
105
106 // Constructors
107
108 //- Construct from mesh
110 :
111 mesh_(mesh),
114 {}
115
116 //- Construct from mesh and Istream
118 :
119 mesh_(mesh),
120 tinterpGammaScheme_(nullptr),
121 tlnGradScheme_(nullptr)
122 {
123 if (is.eof())
124 {
126 (
128 );
129
131 (
133 );
134 }
135 else
136 {
138 (
140 );
141
143 (
145 );
146 }
147 }
148
149
150 // Selectors
151
152 //- Return a pointer to a new laplacianScheme created on freestore
154 (
155 const faMesh& mesh,
156 Istream& schemeData
157 );
158
159
160 //- Destructor
161 virtual ~laplacianScheme();
162
163
164 // Member Functions
165
166 //- Return mesh reference
167 const faMesh& mesh() const
168 {
169 return mesh_;
170 }
173 (
174 const edgeScalarField&,
176 ) = 0;
177
179 (
180 const areaScalarField&,
182 );
185 (
187 ) = 0;
190 (
191 const edgeScalarField&,
193 ) = 0;
194
196 (
197 const areaScalarField&,
199 );
200};
201
202
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205} // End namespace fa
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208
209} // End namespace Foam
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213// Add the patch constructor functions to the hash tables
215#define makeFaLaplacianTypeScheme(SS, Type) \
216 \
217 defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
218 \
219 namespace Foam \
220 { \
221 namespace fa \
222 { \
223 laplacianScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
224 add##SS##Type##IstreamConstructorToTable_; \
225 } \
226 }
227
229#define makeFaLaplacianScheme(SS) \
230 \
231makeFaLaplacianTypeScheme(SS, scalar) \
232makeFaLaplacianTypeScheme(SS, vector) \
233makeFaLaplacianTypeScheme(SS, tensor)
234
235
236// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237
238#ifdef NoRepository
239 #include "faLaplacianScheme.C"
240#endif
241
242// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243
244#endif
245
246// ************************************************************************* //
Forwards and collection of common area field types.
bool eof() const noexcept
True if end of input seen.
Definition: IOstream.H:239
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
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Simple central-difference lnGrad scheme with non-orthogonal correction.
Abstract base class for finite area calculus laplacian schemes.
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.
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
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)