OpenFOAM logo
Open Source CFD Toolkit

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