multivariateScheme.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::multivariateScheme
28
29Description
30 Generic multi-variate discretisation scheme class which may be instantiated
31 for any of the NVD, CNVD or NVDV schemes.
32
33SourceFiles
34 multivariateScheme.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef multivariateScheme_H
39#define multivariateScheme_H
40
42#include "surfaceFields.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class multivariateScheme Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class Type, class Scheme>
55:
57 public Scheme::LimiterType
58{
59 // Private data
60
61 const surfaceScalarField& faceFlux_;
62 surfaceScalarField weights_;
63
64
65 // Private Member Functions
66
67 //- No copy construct
69
70 //- No copy assignment
71 void operator=(const multivariateScheme&) = delete;
72
73
74public:
75
76 //- Runtime type information
77 TypeName("multivariateScheme");
78
79
80 // Constructors
81
82 //- Construct for field, faceFlux and Istream
84 (
85 const fvMesh& mesh,
88 const surfaceScalarField& faceFlux,
89 Istream& schemeData
90 );
91
92
93 // Member Operators
94
95 //- surfaceInterpolationScheme sub-class returned by operator(field)
96 // which is used as the interpolation scheme for the field
97 class fieldScheme
98 :
101 {
102 // Private data
103
104 const surfaceScalarField& weights_;
105
106 public:
107
108 // Constructors
111 (
114 )
115 :
118 weights_(weights)
119 {}
120
121
122 // Member Functions
123
124 //- Return the interpolation weighting factors
126 (
128 ) const
129 {
130 return weights_;
131 }
132 };
135 (
137 ) const
138 {
140 (
141 new fieldScheme(field, weights_)
142 );
143 }
144};
145
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149} // End namespace Foam
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153// Add the patch constructor functions to the hash tables
155#define makeLimitedMultivariateSurfaceInterpolationScheme(SS, LIMITER) \
156typedef multivariateScheme \
157< \
158 scalar, \
159 LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
160> \
161 multivariateScheme##LIMITER##_; \
162 defineTemplateTypeNameAndDebugWithName \
163 ( \
164 multivariateScheme##LIMITER##_, \
165 #SS, \
166 0 \
167 ); \
168 \
169multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
170< \
171 multivariateScheme \
172 < \
173 scalar, \
174 LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
175 > \
176> \
177 addMultivariate##SS##ConstructorToTable_;
178
180#define makeLLimitedMultivariateSurfaceInterpolationScheme\
181( \
182 SS, \
183 LLIMITER, \
184 LIMITER, \
185 NVDTVD, \
186 LIMFUNC \
187) \
188typedef multivariateScheme \
189< \
190 scalar, \
191 LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
192> \
193 multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
194 defineTemplateTypeNameAndDebugWithName \
195 ( \
196 multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, \
197 #SS, \
198 0 \
199 ); \
200 \
201multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
202< \
203 multivariateScheme \
204 < \
205 scalar, \
206 LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
207 > \
208> \
209 addMultivariate##SS##ConstructorToTable_;
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213#ifdef NoRepository
214 #include "multivariateScheme.C"
215#endif
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219#endif
220
221// ************************************************************************* //
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
surfaceInterpolationScheme sub-class returned by operator(field)
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
fieldScheme(const GeometricField< Type, fvPatchField, volMesh > &field, const surfaceScalarField &weights)
Generic multi-variate discretisation scheme class which may be instantiated for any of the NVD,...
TypeName("multivariateScheme")
Runtime type information.
Abstract base class for multi-variate surface interpolation schemes.
const fieldTable & fields() const
Return fields to be interpolated.
A class for managing temporary objects.
Definition: tmp.H:65
rDeltaTY field()
Namespace for OpenFOAM.
Foam::surfaceFields.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73