FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::multivariateSelectionScheme
00026 
00027 Description
00028     Generic multi-variate discretisation scheme class for which any of the
00029     NVD, CNVD or NVDV schemes may be selected for each variable.
00030 
00031 SourceFiles
00032     multivariateSelectionScheme.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef multivariateSelectionScheme_H
00037 #define multivariateSelectionScheme_H
00038 
00039 #include <finiteVolume/multivariateSurfaceInterpolationScheme.H>
00040 #include <finiteVolume/surfaceFields.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                   Class multivariateSelectionScheme Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class multivariateSelectionScheme
00053 :
00054     public multivariateSurfaceInterpolationScheme<Type>
00055 {
00056     // Private data
00057 
00058         dictionary schemes_;
00059         const surfaceScalarField& faceFlux_;
00060         surfaceScalarField weights_;
00061 
00062 
00063     // Private Member Functions
00064 
00065         //- Disallow default bitwise copy construct
00066         multivariateSelectionScheme(const multivariateSelectionScheme&);
00067 
00068         //- Disallow default bitwise assignment
00069         void operator=(const multivariateSelectionScheme&);
00070 
00071 
00072 public:
00073 
00074     //- Runtime type information
00075     TypeName("multivariateSelection");
00076 
00077 
00078     // Constructors
00079 
00080         //- Construct for field, faceFlux and Istream
00081         multivariateSelectionScheme
00082         (
00083             const fvMesh& mesh,
00084             const typename multivariateSurfaceInterpolationScheme<Type>::
00085                 fieldTable& fields,
00086             const surfaceScalarField& faceFlux,
00087             Istream& schemeData
00088         );
00089 
00090 
00091     // Member Operators
00092 
00093         //- surfaceInterpolationScheme sub-class returned by operator(field)
00094         //  which is used as the interpolation scheme for the field
00095         class fieldScheme
00096         :
00097             public multivariateSurfaceInterpolationScheme<Type>::fieldScheme
00098         {
00099             // Private data
00100 
00101                 const surfaceScalarField& weights_;
00102 
00103         public:
00104 
00105             // Constructors
00106             
00107                 fieldScheme
00108                 (
00109                     const GeometricField<Type, fvPatchField, volMesh>& field,
00110                     const surfaceScalarField& weights
00111                 )
00112                 :
00113                     multivariateSurfaceInterpolationScheme<Type>::
00114                         fieldScheme(field),
00115                     weights_(weights)
00116                 {}
00117 
00118 
00119             // Member Functions
00120 
00121                 //- Return the interpolation weighting factors
00122                 tmp<surfaceScalarField> weights
00123                 (
00124                     const GeometricField<Type, fvPatchField, volMesh>&
00125                 ) const
00126                 {
00127                     return weights_;
00128                 }
00129         };
00130 
00131         tmp<surfaceInterpolationScheme<Type> > operator()
00132         (
00133             const GeometricField<Type, fvPatchField, volMesh>& field
00134         ) const
00135         {
00136             return tmp<surfaceInterpolationScheme<Type> >
00137             (
00138                 new fieldScheme(field, weights_)
00139             );
00140         }
00141 };
00142 
00143 
00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00145 
00146 } // End namespace Foam
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 #ifdef NoRepository
00151 #   include <finiteVolume/multivariateSelectionScheme.C>
00152 #endif
00153 
00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00155 
00156 #endif
00157 
00158 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines