fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteVolume / interpolation / surfaceInterpolation / multivariateSchemes / multivariateSelectionScheme / multivariateSelectionScheme.H
blobcaacbd59718e631743fccd43bc5affd41e223fec
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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         //- Schemes dictionary
60         dictionary schemes_;
62         //- Face flux
63         const surfaceScalarField& faceFlux_;
65         //- Combined weights
66         surfaceScalarField weights_;
69     // Private Member Functions
71         //- Disallow default bitwise copy construct
72         multivariateSelectionScheme(const multivariateSelectionScheme&);
74         //- Disallow default bitwise assignment
75         void operator=(const multivariateSelectionScheme&);
78 public:
80     //- Runtime type information
81     TypeName("multivariateSelection");
84     // Constructors
86         //- Construct for field, faceFlux and Istream
87         multivariateSelectionScheme
88         (
89             const fvMesh& mesh,
90             const typename multivariateSurfaceInterpolationScheme<Type>::
91                 fieldTable& fields,
92             const surfaceScalarField& faceFlux,
93             Istream& schemeData
94         );
97     // Member Operators
99         //- surfaceInterpolationScheme sub-class returned by operator(field)
100         //  which is used as the interpolation scheme for the field
101         class fieldScheme
102         :
103             public multivariateSurfaceInterpolationScheme<Type>::fieldScheme
104         {
105             // Private data
107                 const surfaceScalarField& weights_;
109         public:
111             // Constructors
113                 fieldScheme
114                 (
115                     const GeometricField<Type, fvPatchField, volMesh>& field,
116                     const surfaceScalarField& weights
117                 )
118                 :
119                     multivariateSurfaceInterpolationScheme<Type>::
120                         fieldScheme(field),
121                     weights_(weights)
122                 {}
125             // Member Functions
127                 //- Return the interpolation weighting factors
128                 tmp<surfaceScalarField> weights
129                 (
130                     const GeometricField<Type, fvPatchField, volMesh>&
131                 ) const
132                 {
133                     return weights_;
134                 }
135         };
137         tmp<surfaceInterpolationScheme<Type> > operator()
138         (
139             const GeometricField<Type, fvPatchField, volMesh>& field
140         ) const
141         {
142             return tmp<surfaceInterpolationScheme<Type> >
143             (
144                 new fieldScheme(field, weights_)
145             );
146         }
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 #ifdef NoRepository
157 #   include "multivariateSelectionScheme.C"
158 #endif
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 #endif
164 // ************************************************************************* //