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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::multivariateScheme
28 
29 Description
30  Generic multi-variate discretisation scheme class which may be instantiated
31  for any of the NVD, CNVD or NVDV schemes.
32 
33 SourceFiles
34  multivariateScheme.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef multivariateScheme_H
39 #define multivariateScheme_H
40 
42 #include "surfaceFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class multivariateScheme Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<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
68  multivariateScheme(const multivariateScheme&) = delete;
69 
70  //- No copy assignment
71  void operator=(const multivariateScheme&) = delete;
72 
73 
74 public:
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
109 
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  };
133 
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
154 
155 #define makeLimitedMultivariateSurfaceInterpolationScheme(SS, LIMITER) \
156 typedef 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  \
169 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
170 < \
171  multivariateScheme \
172  < \
173  scalar, \
174  LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
175  > \
176 > \
177  addMultivariate##SS##ConstructorToTable_;
178 
179 
180 #define makeLLimitedMultivariateSurfaceInterpolationScheme\
181 ( \
182  SS, \
183  LLIMITER, \
184  LIMITER, \
185  NVDTVD, \
186  LIMFUNC \
187 ) \
188 typedef 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  \
201 multivariateSurfaceInterpolationScheme<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 // ************************************************************************* //
Foam::multivariateScheme
Generic multi-variate discretisation scheme class which may be instantiated for any of the NVD,...
Definition: multivariateScheme.H:53
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::multivariateScheme::fieldScheme::weights
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: multivariateScheme.H:125
multivariateScheme.C
surfaceFields.H
Foam::surfaceFields.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::multivariateSurfaceInterpolationScheme
Abstract base class for multi-variate surface interpolation schemes.
Definition: multivariateSurfaceInterpolationScheme.H:52
field
rDeltaTY field()
Foam::multivariateScheme::TypeName
TypeName("multivariateScheme")
Runtime type information.
Foam::multivariateSurfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: multivariateSurfaceInterpolationScheme.H:153
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::multivariateSurfaceInterpolationScheme::fields
const fieldTable & fields() const
Return fields to be interpolated.
Definition: multivariateSurfaceInterpolationScheme.H:159
multivariateSurfaceInterpolationScheme.H
Foam::multivariateScheme::fieldScheme
surfaceInterpolationScheme sub-class returned by operator(field)
Definition: multivariateScheme.H:96
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::multivariateScheme::fieldScheme::fieldScheme
fieldScheme(const GeometricField< Type, fvPatchField, volMesh > &field, const surfaceScalarField &weights)
Definition: multivariateScheme.H:110
Foam::multivariateSurfaceInterpolationScheme::fieldTable
fieldTable
Definition: multivariateSurfaceInterpolationScheme.H:60