1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 limitWith differencing scheme limits the specified scheme with the
35 \*---------------------------------------------------------------------------*/
40 #include "surfaceInterpolationScheme.H"
41 #include "limitedSurfaceInterpolationScheme.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class limitWith Declaration
50 \*---------------------------------------------------------------------------*/
55 public surfaceInterpolationScheme<Type>
57 // Private Member Functions
59 //- Interpolation scheme
60 tmp<surfaceInterpolationScheme<Type> > tInterp_;
63 tmp<limitedSurfaceInterpolationScheme<Type> > tLimiter_;
66 //- Disallow default bitwise copy construct
67 limitWith(const limitWith&);
69 //- Disallow default bitwise assignment
70 void operator=(const limitWith&);
75 //- Runtime type information
76 TypeName("limitWith");
81 //- Construct from mesh and Istream.
82 // The name of the flux field is read from the Istream and looked-up
83 // from the mesh objectRegistry
90 surfaceInterpolationScheme<Type>(mesh),
93 surfaceInterpolationScheme<Type>::New(mesh, is)
97 limitedSurfaceInterpolationScheme<Type>::New(mesh, is)
101 //- Construct from mesh, faceFlux and Istream
105 const surfaceScalarField& faceFlux,
109 surfaceInterpolationScheme<Type>(mesh),
112 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
116 limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
123 //- Return the interpolation weighting factors
124 virtual tmp<surfaceScalarField> weights
126 const GeometricField<Type, fvPatchField, volMesh>& vf
129 return tLimiter_().weights
132 tInterp_().weights(vf),
133 tLimiter_().limiter(vf)
137 //- Return true if this scheme uses an explicit correction
138 virtual bool corrected() const
140 return tInterp_().corrected();
143 //- Return the explicit correction to the face-interpolate
144 // for the given field
145 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
146 correction(const GeometricField<Type, fvPatchField, volMesh>& vf) const
148 return tLimiter_().limiter(vf)*tInterp_().correction(vf);
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //