ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / finiteVolume / interpolation / surfaceInterpolation / limitedSchemes / PhiScheme / PhiScheme.H
blob358c17e47351ce40f30f795f9d93a02fc3d1edb3
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::PhiScheme
27 Description
28     Class to create the weighting-factors based on the face-flux.
30     The particular differencing scheme class is supplied as a template
31     argument, the weight function of which is called by the weight function
32     of this class for the internal faces as well as faces of coupled
33     patches (e.g. processor-processor patches). The weight function is
34     supplied with the central-differencing weighting factor, the face-flux,
35     the face neighbour cell values and the face area.
37     This code organisation is both neat and efficient, allowing for
38     convenient implementation of new schemes to run on parallelised cases.
40 SourceFiles
41     PhiScheme.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef PhiScheme_H
46 #define PhiScheme_H
48 #include "limitedSurfaceInterpolationScheme.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 /*---------------------------------------------------------------------------*\
56                            Class PhiScheme Declaration
57 \*---------------------------------------------------------------------------*/
59 template<class Type, class PhiLimiter>
60 class PhiScheme
62     public limitedSurfaceInterpolationScheme<Type>,
63     public PhiLimiter
65     // Private Member Functions
67         //- Disallow default bitwise copy construct
68         PhiScheme(const PhiScheme&);
70         //- Disallow default bitwise assignment
71         void operator=(const PhiScheme&);
74 public:
76     //- Runtime type information
77     TypeName("PhiScheme");
80     // Constructors
82         //- Construct from mesh, faceFlux and blendingFactor
83         PhiScheme
84         (
85             const fvMesh& mesh,
86             const surfaceScalarField& faceFlux,
87             const PhiLimiter& weight
88         )
89         :
90             limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
91             PhiLimiter(weight)
92         {}
94         //- Construct from mesh and Istream.
95         //  The name of the flux field is read from the Istream and looked-up
96         //  from the mesh objectRegistry
97         PhiScheme
98         (
99             const fvMesh& mesh,
100             Istream& is
101         )
102         :
103             limitedSurfaceInterpolationScheme<Type>(mesh, is),
104             PhiLimiter(is)
105         {}
107         //- Construct from mesh, faceFlux and Istream
108         PhiScheme
109         (
110             const fvMesh& mesh,
111             const surfaceScalarField& faceFlux,
112             Istream& is
113         )
114         :
115             limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
116             PhiLimiter(is)
117         {}
120     // Member Functions
122         //- Return the interpolation weighting factors
123         virtual tmp<surfaceScalarField> limiter
124         (
125             const GeometricField<Type, fvPatchField, volMesh>&
126         ) const;
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 // Add the patch constructor functions to the hash tables
138 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE)                    \
139                                                                                \
140 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_;                            \
141 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0);            \
142                                                                                \
143 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable                    \
144 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToTable_;             \
145                                                                                \
146 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable                \
147 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToTable_;         \
148                                                                                \
149 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable             \
150 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToLimitedTable_;      \
151                                                                                \
152 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable         \
153 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 #ifdef NoRepository
158 #   include "PhiScheme.C"
159 #endif
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #endif
165 // ************************************************************************* //