FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 
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  // Private Member Functions
64 
65  //- Disallow default bitwise copy construct
67 
68  //- Disallow default bitwise assignment
69  void operator=(const multivariateScheme&);
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("multivariateScheme");
76 
77 
78  // Constructors
79 
80  //- Construct for field, faceFlux and Istream
82  (
83  const fvMesh& mesh,
86  const surfaceScalarField& faceFlux,
87  Istream& schemeData
88  );
89 
90 
91  // Member Operators
92 
93  //- surfaceInterpolationScheme sub-class returned by operator(field)
94  // which is used as the interpolation scheme for the field
96  :
99  {
100  // Private data
101 
102  const surfaceScalarField& weights_;
103 
104  public:
105 
106  // Constructors
107 
109  (
112  )
113  :
115  fieldScheme(field),
116  weights_(weights)
117  {}
118 
119 
120  // Member Functions
121 
122  //- Return the interpolation weighting factors
124  (
126  ) const
127  {
128  return weights_;
129  }
130  };
131 
133  (
135  ) const
136  {
138  (
139  new fieldScheme(field, weights_)
140  );
141  }
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 // Add the patch constructor functions to the hash tables
152 
153 #define makeLimitedMultivariateSurfaceInterpolationScheme(SS, LIMITER) \
154 typedef multivariateScheme<scalar, LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> > \
155  multivariateScheme##LIMITER_; \
156 defineTemplateTypeNameAndDebugWithName(multivariateScheme##LIMITER_, #SS, 0); \
157  \
158 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
159 <multivariateScheme<scalar, LimitedScheme<scalar, LIMITER<NVDTVD>, limitFuncs::magSqr> > > \
160  addMultivariate##SS##ConstructorToTable_;
161 
162 
163 #define makeLLimitedMultivariateSurfaceInterpolationScheme(SS, LLIMITER, LIMITER, NVDTVD, LIMFUNC) \
164 typedef multivariateScheme<scalar, LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
165  multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
166 defineTemplateTypeNameAndDebugWithName(multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
167  \
168 multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
169 <multivariateScheme<scalar, LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > > \
170  addMultivariate##SS##ConstructorToTable_;
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #ifdef NoRepository
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************ vim: set sw=4 sts=4 et: ************************ //