multivariateScheme.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::multivariateScheme
26 
27 Description
28  Generic multi-variate discretisation scheme class which may be instantiated
29  for any of the NVD, CNVD or NVDV schemes.
30 
31 SourceFiles
32  multivariateScheme.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef multivariateScheme_H
37 #define multivariateScheme_H
38 
40 #include "surfaceFields.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class multivariateScheme Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type, class Scheme>
53 :
55  public Scheme::LimiterType
56 {
57  // Private Data
58 
59  const surfaceScalarField& faceFlux_;
60  surfaceScalarField weights_;
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("multivariateScheme");
67 
68 
69  // Constructors
70 
71  //- Construct for field, faceFlux and Istream
73  (
74  const fvMesh& mesh,
77  const surfaceScalarField& faceFlux,
78  Istream& schemeData
79  );
80 
81  //- Disallow default bitwise copy construction
82  multivariateScheme(const multivariateScheme&) = delete;
83 
84 
85  // Member Operators
86 
87  //- Disallow default bitwise assignment
88  void operator=(const multivariateScheme&) = delete;
89 
90  //- surfaceInterpolationScheme sub-class returned by operator(field)
91  // which is used as the interpolation scheme for the field
92  class fieldScheme
93  :
96  {
97  // Private Data
98 
99  const surfaceScalarField& weights_;
100 
101  public:
102 
103  // Constructors
104 
106  (
109  )
110  :
112  fieldScheme(field),
113  weights_(weights)
114  {}
115 
116 
117  // Member Functions
118 
119  //- Return the interpolation weighting factors
121  (
123  ) const
124  {
125  return weights_;
126  }
127  };
128 
130  (
132  ) const
133  {
135  (
136  new fieldScheme(field, weights_)
137  );
138  }
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 // Add the patch constructor functions to the hash tables
150 #define makeLimitedMultivariateSurfaceInterpolationScheme(SS, LIMITER) \
151 typedef multivariateScheme \
152 < \
153  scalar, \
154  LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
155 > \
156  multivariateScheme##LIMITER##_; \
157  defineTemplateTypeNameAndDebugWithName \
158  ( \
159  multivariateScheme##LIMITER##_, \
160  #SS, \
161  0 \
162  ); \
163  \
164 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
165 < \
166  multivariateScheme \
167  < \
168  scalar, \
169  LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
170  > \
171 > \
172  addMultivariate##SS##ConstructorToTable_;
173 
175 #define makeLLimitedMultivariateSurfaceInterpolationScheme\
176 ( \
177  SS, \
178  LLIMITER, \
179  LIMITER, \
180  NVDTVD, \
181  LIMFUNC \
182 ) \
183 typedef multivariateScheme \
184 < \
185  scalar, \
186  LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
187 > \
188  multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
189  defineTemplateTypeNameAndDebugWithName \
190  ( \
191  multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, \
192  #SS, \
193  0 \
194  ); \
195  \
196 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
197 < \
198  multivariateScheme \
199  < \
200  scalar, \
201  LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
202  > \
203 > \
204  addMultivariate##SS##ConstructorToTable_;
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #ifdef NoRepository
209  #include "multivariateScheme.C"
210 #endif
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************************************************************* //
Foam::surfaceFields.
multivariateScheme(const fvMesh &mesh, const typename multivariateSurfaceInterpolationScheme< Type >::fieldTable &fields, const surfaceScalarField &faceFlux, Istream &schemeData)
Construct for field, faceFlux and Istream.
surfaceInterpolationScheme sub-class returned by operator(field)
Generic multi-variate discretisation scheme class which may be instantiated for any of the NVD...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const fieldTable & fields() const
Return fields to be interpolated.
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
TypeName("multivariateScheme")
Runtime type information.
fieldScheme(const GeometricField< Type, fvPatchField, volMesh > &field, const surfaceScalarField &weights)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for multi-variate surface interpolation schemes.
void operator=(const multivariateScheme &)=delete
Disallow default bitwise assignment.
rDeltaTY field()
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.