OpenFOAM logo
Open Source CFD Toolkit

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