OpenFOAM logo
Open Source CFD Toolkit

limitedSurfaceInterpolationScheme.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     limitedSurfaceInterpolationScheme
00027 
00028 Description
00029     Abstract base class for surface interpolation schemes.
00030 
00031 SourceFiles
00032     limitedSurfaceInterpolationScheme.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef limitedSurfaceInterpolationScheme_H
00037 #define limitedSurfaceInterpolationScheme_H
00038 
00039 #include "surfaceInterpolationScheme.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                  Class limitedSurfaceInterpolationScheme Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class Type>
00051 class limitedSurfaceInterpolationScheme
00052 :
00053     public surfaceInterpolationScheme<Type>
00054 {
00055     // Private Member Functions
00056 
00057         //- Disallow copy construct
00058         limitedSurfaceInterpolationScheme
00059         (
00060             const limitedSurfaceInterpolationScheme&
00061         );
00062 
00063         //- Disallow default bitwise assignment
00064         void operator=(const limitedSurfaceInterpolationScheme&);
00065 
00066 
00067 protected:
00068 
00069     // Protected data
00070 
00071         const surfaceScalarField& faceFlux_;
00072 
00073 
00074 public:
00075 
00076     //- Runtime type information
00077     TypeName("limitedSurfaceInterpolationScheme");
00078 
00079 
00080     // Declare run-time constructor selection tables
00081 
00082         declareRunTimeSelectionTable
00083         (
00084             tmp,
00085             limitedSurfaceInterpolationScheme,
00086             Mesh,
00087             (
00088                 const fvMesh& mesh,
00089                 Istream& schemeData
00090             ),
00091             (mesh, schemeData)
00092         );
00093 
00094         declareRunTimeSelectionTable
00095         (
00096             tmp,
00097             limitedSurfaceInterpolationScheme,
00098             MeshFlux,
00099             (
00100                 const fvMesh& mesh,
00101                 const surfaceScalarField& faceFlux,
00102                 Istream& schemeData
00103             ),
00104             (mesh, faceFlux, schemeData)
00105         );
00106 
00107 
00108     // Constructors
00109 
00110         //- Construct from mesh and faceFlux
00111         limitedSurfaceInterpolationScheme
00112         (
00113             const fvMesh& mesh,
00114             const surfaceScalarField& faceFlux
00115         )
00116         :
00117             surfaceInterpolationScheme<Type>(mesh),
00118             faceFlux_(faceFlux)
00119         {}
00120 
00121 
00122         //- Construct from mesh and Istream. 
00123         //  The name of the flux field is read from the Istream and looked-up
00124         //  from the mesh objectRegistry
00125         limitedSurfaceInterpolationScheme
00126         (
00127             const fvMesh& mesh,
00128             Istream& is
00129         )
00130         :
00131             surfaceInterpolationScheme<Type>(mesh),
00132             faceFlux_
00133             (
00134                 mesh.lookupObject<surfaceScalarField>
00135                 (
00136                     word(is)
00137                 )
00138             )
00139         {}
00140 
00141 
00142     // Selectors
00143 
00144         //- Return new tmp interpolation scheme
00145         static tmp<limitedSurfaceInterpolationScheme<Type> > New
00146         (
00147             const fvMesh& mesh,
00148             Istream& schemeData
00149         );
00150 
00151         //- Return new tmp interpolation scheme
00152         static tmp<limitedSurfaceInterpolationScheme<Type> > New
00153         (
00154             const fvMesh& mesh,
00155             const surfaceScalarField& faceFlux,
00156             Istream& schemeData
00157         );
00158 
00159 
00160     // Destructor
00161 
00162         virtual ~limitedSurfaceInterpolationScheme();
00163 
00164 
00165     // Member Functions
00166 
00167         //- Return the interpolation weighting factors
00168         virtual tmp<surfaceScalarField> limiter
00169         (
00170             const GeometricField<Type, fvPatchField, volMesh>&
00171         ) const = 0;
00172 
00173         //- Return the interpolation weighting factors for the given field
00174         virtual tmp<surfaceScalarField> weights
00175         (
00176             const GeometricField<Type, fvPatchField, volMesh>&
00177         ) const;
00178 };
00179 
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 } // End namespace Foam
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 // Add the patch constructor functions to the hash tables
00188 
00189 #define makelimitedSurfaceInterpolationTypeScheme(SS, Type)                    \
00190                                                                                \
00191 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00192                                                                                \
00193 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >         \
00194     add##SS##Type##MeshConstructorToTable_;                                    \
00195                                                                                \
00196 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >     \
00197     add##SS##Type##MeshFluxConstructorToTable_;                                \
00198                                                                                \
00199 limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >  \
00200     add##SS##Type##MeshConstructorToLimitedTable_;                             \
00201                                                                                \
00202 limitedSurfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >\
00203     add##SS##Type##MeshFluxConstructorToLimitedTable_;
00204 
00205 #define makelimitedSurfaceInterpolationScheme(SS)                              \
00206                                                                                \
00207 makelimitedSurfaceInterpolationTypeScheme(SS, scalar)                          \
00208 makelimitedSurfaceInterpolationTypeScheme(SS, vector)                          \
00209 makelimitedSurfaceInterpolationTypeScheme(SS, tensor)                          \
00210 makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor)
00211 
00212 
00213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00214 
00215 #ifdef NoRepository
00216 #   include "limitedSurfaceInterpolationScheme.C"
00217 #endif
00218 
00219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00220 
00221 #endif
00222 
00223 // ************************************************************************* //
For further information go to www.openfoam.org