initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / interpolation / surfaceInterpolation / limitedSchemes / limitedSurfaceInterpolationScheme / limitedSurfaceInterpolationScheme.H
blob0d8dec2d02d6db752470f63fbe3f911ce0f0d909
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::limitedSurfaceInterpolationScheme
28 Description
29     Abstract base class for limited surface interpolation schemes.
31 SourceFiles
32     limitedSurfaceInterpolationScheme.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef limitedSurfaceInterpolationScheme_H
37 #define limitedSurfaceInterpolationScheme_H
39 #include "surfaceInterpolationScheme.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                  Class limitedSurfaceInterpolationScheme Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class limitedSurfaceInterpolationScheme
53     public surfaceInterpolationScheme<Type>
55     // Private Member Functions
57         //- Disallow copy construct
58         limitedSurfaceInterpolationScheme
59         (
60             const limitedSurfaceInterpolationScheme&
61         );
63         //- Disallow default bitwise assignment
64         void operator=(const limitedSurfaceInterpolationScheme&);
67 protected:
69     // Protected data
71         const surfaceScalarField& faceFlux_;
74 public:
76     //- Runtime type information
77     TypeName("limitedSurfaceInterpolationScheme");
80     // Declare run-time constructor selection tables
82         declareRunTimeSelectionTable
83         (
84             tmp,
85             limitedSurfaceInterpolationScheme,
86             Mesh,
87             (
88                 const fvMesh& mesh,
89                 Istream& schemeData
90             ),
91             (mesh, schemeData)
92         );
94         declareRunTimeSelectionTable
95         (
96             tmp,
97             limitedSurfaceInterpolationScheme,
98             MeshFlux,
99             (
100                 const fvMesh& mesh,
101                 const surfaceScalarField& faceFlux,
102                 Istream& schemeData
103             ),
104             (mesh, faceFlux, schemeData)
105         );
108     // Constructors
110         //- Construct from mesh and faceFlux
111         limitedSurfaceInterpolationScheme
112         (
113             const fvMesh& mesh,
114             const surfaceScalarField& faceFlux
115         )
116         :
117             surfaceInterpolationScheme<Type>(mesh),
118             faceFlux_(faceFlux)
119         {}
122         //- Construct from mesh and Istream.
123         //  The name of the flux field is read from the Istream and looked-up
124         //  from the mesh objectRegistry
125         limitedSurfaceInterpolationScheme
126         (
127             const fvMesh& mesh,
128             Istream& is
129         )
130         :
131             surfaceInterpolationScheme<Type>(mesh),
132             faceFlux_
133             (
134                 mesh.lookupObject<surfaceScalarField>
135                 (
136                     word(is)
137                 )
138             )
139         {}
142     // Selectors
144         //- Return new tmp interpolation scheme
145         static tmp<limitedSurfaceInterpolationScheme<Type> > New
146         (
147             const fvMesh& mesh,
148             Istream& schemeData
149         );
151         //- Return new tmp interpolation scheme
152         static tmp<limitedSurfaceInterpolationScheme<Type> > New
153         (
154             const fvMesh& mesh,
155             const surfaceScalarField& faceFlux,
156             Istream& schemeData
157         );
160     // Destructor
162         virtual ~limitedSurfaceInterpolationScheme();
165     // Member Functions
167         //- Return the interpolation weighting factors
168         virtual tmp<surfaceScalarField> limiter
169         (
170             const GeometricField<Type, fvPatchField, volMesh>&
171         ) const = 0;
173         //- Return the interpolation weighting factors for the given field,
174         //  by limiting the given weights with the given limiter
175         tmp<surfaceScalarField> weights
176         (
177             const GeometricField<Type, fvPatchField, volMesh>&,
178             const surfaceScalarField& CDweights,
179             tmp<surfaceScalarField> tLimiter
180         ) const;
182         //- Return the interpolation weighting factors for the given field
183         virtual tmp<surfaceScalarField> weights
184         (
185             const GeometricField<Type, fvPatchField, volMesh>&
186         ) const;
188         //- Return the interpolation weighting factors
189         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
190         flux
191         (
192             const GeometricField<Type, fvPatchField, volMesh>&
193         ) const;
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 } // End namespace Foam
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 // Add the patch constructor functions to the hash tables
205 #define makelimitedSurfaceInterpolationTypeScheme(SS, Type)                    \
206                                                                                \
207 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
208                                                                                \
209 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >         \
210     add##SS##Type##MeshConstructorToTable_;                                    \
211                                                                                \
212 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >     \
213     add##SS##Type##MeshFluxConstructorToTable_;                                \
214                                                                                \
215 limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> >  \
216     add##SS##Type##MeshConstructorToLimitedTable_;                             \
217                                                                                \
218 limitedSurfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> >\
219     add##SS##Type##MeshFluxConstructorToLimitedTable_;
221 #define makelimitedSurfaceInterpolationScheme(SS)                              \
222                                                                                \
223 makelimitedSurfaceInterpolationTypeScheme(SS, scalar)                          \
224 makelimitedSurfaceInterpolationTypeScheme(SS, vector)                          \
225 makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor)                 \
226 makelimitedSurfaceInterpolationTypeScheme(SS, symmTensor)                      \
227 makelimitedSurfaceInterpolationTypeScheme(SS, tensor)
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 #ifdef NoRepository
233 #   include "limitedSurfaceInterpolationScheme.C"
234 #endif
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 #endif
240 // ************************************************************************* //