OpenFOAM logo
Open Source CFD Toolkit

multivariateSelectionScheme.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     multivariateSelectionScheme
00027 
00028 Description
00029     Generic multi-variate discretisation scheme class for which any of the
00030     NVD, CNVD or NVDV schemes may be selected for each variable.
00031 
00032 SourceFiles
00033     multivariateSelectionScheme.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef multivariateSelectionScheme_H
00038 #define multivariateSelectionScheme_H
00039 
00040 #include "multivariateSurfaceInterpolationScheme.H"
00041 #include "surfaceFields.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                   Class multivariateSelectionScheme Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class Type>
00053 class multivariateSelectionScheme
00054 :
00055     public multivariateSurfaceInterpolationScheme<Type>
00056 {
00057     // Private data
00058 
00059         dictionary schemes_;
00060         const surfaceScalarField& faceFlux_;
00061         surfaceScalarField weights_;
00062 
00063 
00064     // Private Member Functions
00065 
00066         //- Disallow default bitwise copy construct
00067         multivariateSelectionScheme(const multivariateSelectionScheme&);
00068 
00069         //- Disallow default bitwise assignment
00070         void operator=(const multivariateSelectionScheme&);
00071 
00072 
00073 public:
00074 
00075     //- Runtime type information
00076     TypeName("multivariateSelection");
00077 
00078 
00079     // Constructors
00080 
00081         //- Construct for field, faceFlux and Istream
00082         multivariateSelectionScheme
00083         (
00084             const fvMesh& mesh,
00085             const typename multivariateSurfaceInterpolationScheme<Type>::
00086                 fieldTable& fields,
00087             const surfaceScalarField& faceFlux,
00088             Istream& schemeData
00089         );
00090 
00091 
00092     // Member Operators
00093 
00094         //- surfaceInterpolationScheme sub-class returned by operator(field)
00095         //  which is used as the interpolation scheme for the field
00096         class fieldScheme
00097         :
00098             public multivariateSurfaceInterpolationScheme<Type>::fieldScheme
00099         {
00100             // Private data
00101 
00102                 const surfaceScalarField& weights_;
00103 
00104         public:
00105 
00106             // Constructors
00107             
00108                 fieldScheme
00109                 (
00110                     const GeometricField<Type, fvPatchField, volMesh>& field,
00111                     const surfaceScalarField& weights
00112                 )
00113                 :
00114                     multivariateSurfaceInterpolationScheme<Type>::
00115                         fieldScheme(field),
00116                     weights_(weights)
00117                 {}
00118 
00119 
00120             // Member Functions
00121 
00122                 //- Return the interpolation weighting factors
00123                 tmp<surfaceScalarField> weights
00124                 (
00125                     const GeometricField<Type, fvPatchField, volMesh>&
00126                 ) const
00127                 {
00128                     return weights_;
00129                 }
00130         };
00131 
00132         tmp<surfaceInterpolationScheme<Type> > operator()
00133         (
00134             const GeometricField<Type, fvPatchField, volMesh>& field
00135         ) const
00136         {
00137             return tmp<surfaceInterpolationScheme<Type> >
00138             (
00139                 new fieldScheme(field, weights_)
00140             );
00141         }
00142 };
00143 
00144 
00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00146 
00147 } // End namespace Foam
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 #ifdef NoRepository
00152 #   include "multivariateSelectionScheme.C"
00153 #endif
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #endif
00158 
00159 // ************************************************************************* //
For further information go to www.openfoam.org