1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::multivariateScheme
28 Generic multi-variate discretisation scheme class which may be instantiated
29 for any of the NVD, CNVD or NVDV schemes.
34 \*---------------------------------------------------------------------------*/
36 #ifndef multivariateScheme_H
37 #define multivariateScheme_H
39 #include "multivariateSurfaceInterpolationScheme.H"
40 #include "surfaceFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class multivariateScheme Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class Type, class Scheme>
52 class multivariateScheme
54 public multivariateSurfaceInterpolationScheme<Type>,
55 public Scheme::LimiterType
59 const surfaceScalarField& faceFlux_;
60 surfaceScalarField weights_;
63 // Private Member Functions
65 //- Disallow default bitwise copy construct
66 multivariateScheme(const multivariateScheme&);
68 //- Disallow default bitwise assignment
69 void operator=(const multivariateScheme&);
74 //- Runtime type information
75 TypeName("multivariateScheme");
80 //- Construct for field, faceFlux and Istream
84 const typename multivariateSurfaceInterpolationScheme<Type>::
86 const surfaceScalarField& faceFlux,
93 //- surfaceInterpolationScheme sub-class returned by operator(field)
94 // which is used as the interpolation scheme for the field
97 public multivariateSurfaceInterpolationScheme<Type>::
102 const surfaceScalarField& weights_;
110 const GeometricField<Type, fvPatchField, volMesh>& field,
111 const surfaceScalarField& weights
114 multivariateSurfaceInterpolationScheme<Type>::
122 //- Return the interpolation weighting factors
123 tmp<surfaceScalarField> weights
125 const GeometricField<Type, fvPatchField, volMesh>&
132 tmp<surfaceInterpolationScheme<Type> > operator()
134 const GeometricField<Type, fvPatchField, volMesh>& field
137 return tmp<surfaceInterpolationScheme<Type> >
139 new fieldScheme(field, weights_)
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 } // End namespace Foam
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 // Add the patch constructor functions to the hash tables
153 #define makeLimitedMultivariateSurfaceInterpolationScheme(SS, LIMITER) \
154 typedef multivariateScheme \
157 LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
159 multivariateScheme##LIMITER_; \
160 defineTemplateTypeNameAndDebugWithName(multivariateScheme##LIMITER_, #SS, 0); \
162 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
167 LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> \
170 addMultivariate##SS##ConstructorToTable_;
173 #define makeLLimitedMultivariateSurfaceInterpolationScheme\
181 typedef multivariateScheme \
184 LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> \
186 multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
187 defineTemplateTypeNameAndDebugWithName \
189 multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, \
194 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
199 LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> \
202 addMultivariate##SS##ConstructorToTable_;
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 # include "multivariateScheme.C"
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 // ************************************************************************* //