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

surfaceInterpolationScheme.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::surfaceInterpolationScheme
00026 
00027 Description
00028     Abstract base class for surface interpolation schemes.
00029 
00030 SourceFiles
00031     surfaceInterpolationScheme.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef surfaceInterpolationScheme_H
00036 #define surfaceInterpolationScheme_H
00037 
00038 #include <OpenFOAM/tmp.H>
00039 #include <finiteVolume/volFieldsFwd.H>
00040 #include <finiteVolume/surfaceFieldsFwd.H>
00041 #include <OpenFOAM/typeInfo.H>
00042 #include <OpenFOAM/runTimeSelectionTables.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class fvMesh;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                  Class surfaceInterpolationScheme Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 template<class Type>
00056 class surfaceInterpolationScheme
00057 :
00058     public refCount
00059 {
00060     // Private data
00061 
00062         //- Hold reference to mesh
00063         const fvMesh& mesh_;
00064 
00065 
00066     // Private Member Functions
00067 
00068         //- Disallow copy construct
00069         surfaceInterpolationScheme(const surfaceInterpolationScheme&);
00070 
00071         //- Disallow default bitwise assignment
00072         void operator=(const surfaceInterpolationScheme&);
00073 
00074 
00075 public:
00076 
00077     //- Runtime type information
00078     TypeName("surfaceInterpolationScheme");
00079 
00080 
00081     // Declare run-time constructor selection tables
00082 
00083         declareRunTimeSelectionTable
00084         (
00085             tmp,
00086             surfaceInterpolationScheme,
00087             Mesh,
00088             (
00089                 const fvMesh& mesh,
00090                 Istream& schemeData
00091             ),
00092             (mesh, schemeData)
00093         );
00094 
00095         declareRunTimeSelectionTable
00096         (
00097             tmp,
00098             surfaceInterpolationScheme,
00099             MeshFlux,
00100             (
00101                 const fvMesh& mesh,
00102                 const surfaceScalarField& faceFlux,
00103                 Istream& schemeData
00104             ),
00105             (mesh, faceFlux, schemeData)
00106         );
00107 
00108 
00109     // Constructors
00110 
00111         //- Construct from mesh
00112         surfaceInterpolationScheme(const fvMesh& mesh)
00113         :
00114             mesh_(mesh)
00115         {}
00116 
00117 
00118     // Selectors
00119 
00120         //- Return new tmp interpolation scheme
00121         static tmp<surfaceInterpolationScheme<Type> > New
00122         (
00123             const fvMesh& mesh,
00124             Istream& schemeData
00125         );
00126 
00127         //- Return new tmp interpolation scheme
00128         static tmp<surfaceInterpolationScheme<Type> > New
00129         (
00130             const fvMesh& mesh,
00131             const surfaceScalarField& faceFlux,
00132             Istream& schemeData
00133         );
00134 
00135 
00136     // Destructor
00137 
00138         virtual ~surfaceInterpolationScheme();
00139 
00140 
00141     // Member Functions
00142 
00143         //- Return mesh reference
00144         const fvMesh& mesh() const
00145         {
00146             return mesh_;
00147         }
00148 
00149 
00150         //- Return the face-interpolate of the given cell field
00151         //  with the given owner and neighbour weigting factors
00152         static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00153         interpolate
00154         (
00155             const GeometricField<Type, fvPatchField, volMesh>&,
00156             const tmp<surfaceScalarField>&,
00157             const tmp<surfaceScalarField>&
00158         );
00159 
00160         //- Return the face-interpolate of the given cell field
00161         //  with the given weighting factors
00162         static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00163         interpolate
00164         (
00165             const GeometricField<Type, fvPatchField, volMesh>&,
00166             const tmp<surfaceScalarField>&
00167         );
00168 
00169 
00170         //- Return the interpolation weighting factors for the given field
00171         virtual tmp<surfaceScalarField> weights
00172         (
00173             const GeometricField<Type, fvPatchField, volMesh>&
00174         ) const = 0;
00175 
00176         //- Return true if this scheme uses an explicit correction
00177         virtual bool corrected() const
00178         {
00179             return false;
00180         }
00181 
00182         //- Return the explicit correction to the face-interpolate
00183         //  for the given field
00184         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00185         correction(const GeometricField<Type, fvPatchField, volMesh>&) const
00186         {
00187             return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >(NULL);
00188         }
00189 
00190         //- Return the face-interpolate of the given cell field
00191         //  with explicit correction
00192         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00193         interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const;
00194 
00195         //- Return the face-interpolate of the given tmp cell field
00196         //  with explicit correction
00197         tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00198         interpolate
00199         (
00200             const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00201         ) const;
00202 };
00203 
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 } // End namespace Foam
00208 
00209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00210 
00211 // Add the patch constructor functions to the hash tables
00212 
00213 #define makeSurfaceInterpolationTypeScheme(SS, Type)                           \
00214                                                                                \
00215 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00216                                                                                \
00217 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >         \
00218     add##SS##Type##MeshConstructorToTable_;                                    \
00219                                                                                \
00220 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >     \
00221     add##SS##Type##MeshFluxConstructorToTable_;
00222 
00223 #define makeSurfaceInterpolationScheme(SS)                                     \
00224                                                                                \
00225 makeSurfaceInterpolationTypeScheme(SS, scalar)                                 \
00226 makeSurfaceInterpolationTypeScheme(SS, vector)                                 \
00227 makeSurfaceInterpolationTypeScheme(SS, sphericalTensor)                        \
00228 makeSurfaceInterpolationTypeScheme(SS, symmTensor)                             \
00229 makeSurfaceInterpolationTypeScheme(SS, tensor)
00230 
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 #ifdef NoRepository
00235 #   include <finiteVolume/surfaceInterpolationScheme.C>
00236 #endif
00237 
00238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00239 
00240 #endif
00241 
00242 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines