limitedSurfaceInterpolationScheme.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::limitedSurfaceInterpolationScheme
28
29Group
30 grpFvLimitedSurfaceInterpolationSchemes
31
32Description
33 Abstract base class for limited surface interpolation schemes.
34
35SourceFiles
36 limitedSurfaceInterpolationScheme.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef limitedSurfaceInterpolationScheme_H
41#define limitedSurfaceInterpolationScheme_H
42
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class limitedSurfaceInterpolationScheme Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class Type>
56:
58{
59 // Private Member Functions
60
61 //- No copy construct
63 (
65 ) = delete;
66
67 //- No copy assignment
68 void operator=(const limitedSurfaceInterpolationScheme&) = delete;
69
70
71protected:
72
73 // Protected data
76
77
78public:
79
80 //- Runtime type information
81 TypeName("limitedSurfaceInterpolationScheme");
82
83
84 // Declare run-time constructor selection tables
87 (
88 tmp,
90 Mesh,
91 (
92 const fvMesh& mesh,
93 Istream& schemeData
94 ),
95 (mesh, schemeData)
96 );
99 (
100 tmp,
102 MeshFlux,
103 (
104 const fvMesh& mesh,
105 const surfaceScalarField& faceFlux,
106 Istream& schemeData
107 ),
108 (mesh, faceFlux, schemeData)
109 );
110
111
112 // Constructors
113
114 //- Construct from mesh and faceFlux
116 (
117 const fvMesh& mesh,
118 const surfaceScalarField& faceFlux
119 )
120 :
122 faceFlux_(faceFlux)
123 {}
124
125
126 //- Construct from mesh and Istream.
127 // The name of the flux field is read from the Istream and looked-up
128 // from the mesh objectRegistry
130 (
131 const fvMesh& mesh,
132 Istream& is
133 )
134 :
137 (
138 mesh.lookupObject<surfaceScalarField>
139 (
140 word(is)
141 )
142 )
143 {}
144
145
146 // Selectors
147
148 //- Return new tmp interpolation scheme
150 (
151 const fvMesh& mesh,
152 Istream& schemeData
153 );
154
155 //- Return new tmp interpolation scheme
157 (
158 const fvMesh& mesh,
159 const surfaceScalarField& faceFlux,
160 Istream& schemeData
161 );
162
163
164 //- Destructor
166
167
168 // Member Functions
169
170 //- Return the interpolation weighting factors
172 (
174 ) const = 0;
175
176 //- Return the interpolation weighting factors for the given field,
177 // by limiting the given weights with the given limiter
179 (
181 const surfaceScalarField& CDweights,
183 ) const;
184
185 //- Return the interpolation weighting factors for the given field
187 (
189 ) const;
190
191 //- Return the interpolation weighting factors
193 flux
194 (
196 ) const;
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206// Add the patch constructor functions to the hash tables
208#define makelimitedSurfaceInterpolationTypeScheme(SS, Type) \
209 \
210defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
211 \
212surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
213 add##SS##Type##MeshConstructorToTable_; \
214 \
215surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
216 add##SS##Type##MeshFluxConstructorToTable_; \
217 \
218limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
219 add##SS##Type##MeshConstructorToLimitedTable_; \
220 \
221limitedSurfaceInterpolationScheme<Type>:: \
222 addMeshFluxConstructorToTable<SS<Type>> \
223 add##SS##Type##MeshFluxConstructorToLimitedTable_;
225#define makelimitedSurfaceInterpolationScheme(SS) \
226 \
227makelimitedSurfaceInterpolationTypeScheme(SS, scalar) \
228makelimitedSurfaceInterpolationTypeScheme(SS, vector) \
229makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
230makelimitedSurfaceInterpolationTypeScheme(SS, symmTensor) \
231makelimitedSurfaceInterpolationTypeScheme(SS, tensor)
232
233
234// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235
236#ifdef NoRepository
238#endif
239
240// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241
242#endif
243
244// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class for limited surface interpolation schemes.
limitedSurfaceInterpolationScheme(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from mesh and faceFlux.
static tmp< limitedSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const =0
Return the interpolation weighting factors.
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &, const surfaceScalarField &CDweights, tmp< surfaceScalarField > tLimiter) const
Return the interpolation weighting factors for the given field,.
declareRunTimeSelectionTable(tmp, limitedSurfaceInterpolationScheme, MeshFlux,(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
declareRunTimeSelectionTable(tmp, limitedSurfaceInterpolationScheme, Mesh,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
TypeName("limitedSurfaceInterpolationScheme")
Runtime type information.
Abstract base class for surface interpolation schemes.
const fvMesh & mesh() const
Return mesh reference.
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.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73