initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / interpolation / surfaceInterpolation / multivariateSchemes / multivariateSelectionScheme / multivariateSelectionScheme.H
blob46c5d4d5b4c0a9c9985fc332278a4f9cfd0ceda6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::multivariateSelectionScheme
28 Description
29     Generic multi-variate discretisation scheme class for which any of the
30     NVD, CNVD or NVDV schemes may be selected for each variable.
32 SourceFiles
33     multivariateSelectionScheme.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef multivariateSelectionScheme_H
38 #define multivariateSelectionScheme_H
40 #include "multivariateSurfaceInterpolationScheme.H"
41 #include "surfaceFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                   Class multivariateSelectionScheme Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Type>
53 class multivariateSelectionScheme
55     public multivariateSurfaceInterpolationScheme<Type>
57     // Private data
59         dictionary schemes_;
60         const surfaceScalarField& faceFlux_;
61         surfaceScalarField weights_;
64     // Private Member Functions
66         //- Disallow default bitwise copy construct
67         multivariateSelectionScheme(const multivariateSelectionScheme&);
69         //- Disallow default bitwise assignment
70         void operator=(const multivariateSelectionScheme&);
73 public:
75     //- Runtime type information
76     TypeName("multivariateSelection");
79     // Constructors
81         //- Construct for field, faceFlux and Istream
82         multivariateSelectionScheme
83         (
84             const fvMesh& mesh,
85             const typename multivariateSurfaceInterpolationScheme<Type>::
86                 fieldTable& fields,
87             const surfaceScalarField& faceFlux,
88             Istream& schemeData
89         );
92     // Member Operators
94         //- surfaceInterpolationScheme sub-class returned by operator(field)
95         //  which is used as the interpolation scheme for the field
96         class fieldScheme
97         :
98             public multivariateSurfaceInterpolationScheme<Type>::fieldScheme
99         {
100             // Private data
102                 const surfaceScalarField& weights_;
104         public:
106             // Constructors
107             
108                 fieldScheme
109                 (
110                     const GeometricField<Type, fvPatchField, volMesh>& field,
111                     const surfaceScalarField& weights
112                 )
113                 :
114                     multivariateSurfaceInterpolationScheme<Type>::
115                         fieldScheme(field),
116                     weights_(weights)
117                 {}
120             // Member Functions
122                 //- Return the interpolation weighting factors
123                 tmp<surfaceScalarField> weights
124                 (
125                     const GeometricField<Type, fvPatchField, volMesh>&
126                 ) const
127                 {
128                     return weights_;
129                 }
130         };
132         tmp<surfaceInterpolationScheme<Type> > operator()
133         (
134             const GeometricField<Type, fvPatchField, volMesh>& field
135         ) const
136         {
137             return tmp<surfaceInterpolationScheme<Type> >
138             (
139                 new fieldScheme(field, weights_)
140             );
141         }
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 } // End namespace Foam
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 #ifdef NoRepository
152 #   include "multivariateSelectionScheme.C"
153 #endif
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 #endif
159 // ************************************************************************* //