1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::multivariateScheme
29 Generic multi-variate discretisation scheme class which may be instantiated
30 for any of the NVD, CNVD or NVDV schemes.
35 \*---------------------------------------------------------------------------*/
37 #ifndef multivariateScheme_H
38 #define multivariateScheme_H
40 #include "multivariateSurfaceInterpolationScheme.H"
41 #include "surfaceFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class multivariateScheme Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Type, class Scheme>
53 class multivariateScheme
55 public multivariateSurfaceInterpolationScheme<Type>,
56 public Scheme::LimiterType
60 const surfaceScalarField& faceFlux_;
61 surfaceScalarField weights_;
64 // Private Member Functions
66 //- Disallow default bitwise copy construct
67 multivariateScheme(const multivariateScheme&);
69 //- Disallow default bitwise assignment
70 void operator=(const multivariateScheme&);
75 //- Runtime type information
76 TypeName("multivariateScheme");
81 //- Construct for field, faceFlux and Istream
85 const typename multivariateSurfaceInterpolationScheme<Type>::
87 const surfaceScalarField& faceFlux,
94 //- surfaceInterpolationScheme sub-class returned by operator(field)
95 // which is used as the interpolation scheme for the field
98 public multivariateSurfaceInterpolationScheme<Type>::
103 const surfaceScalarField& weights_;
111 const GeometricField<Type, fvPatchField, volMesh>& field,
112 const surfaceScalarField& weights
115 multivariateSurfaceInterpolationScheme<Type>::
123 //- Return the interpolation weighting factors
124 tmp<surfaceScalarField> weights
126 const GeometricField<Type, fvPatchField, volMesh>&
133 tmp<surfaceInterpolationScheme<Type> > operator()
135 const GeometricField<Type, fvPatchField, volMesh>& field
138 return tmp<surfaceInterpolationScheme<Type> >
140 new fieldScheme(field, weights_)
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 // Add the patch constructor functions to the hash tables
154 #define makeLimitedMultivariateSurfaceInterpolationScheme(SS, LIMITER) \
155 typedef multivariateScheme<scalar, LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> > \
156 multivariateScheme##LIMITER_; \
157 defineTemplateTypeNameAndDebugWithName(multivariateScheme##LIMITER_, #SS, 0); \
159 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
160 <multivariateScheme<scalar, LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> > > \
161 addMultivariate##SS##ConstructorToTable_;
164 #define makeLLimitedMultivariateSurfaceInterpolationScheme(SS, LLIMITER, LIMITER, NVDTVD, LIMFUNC) \
165 typedef multivariateScheme<scalar, LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
166 multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
167 defineTemplateTypeNameAndDebugWithName(multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
169 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
170 <multivariateScheme<scalar, LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > > \
171 addMultivariate##SS##ConstructorToTable_;
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 # include "multivariateScheme.C"
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // ************************************************************************* //