1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 LocalMax-mean differencing scheme class. This scheme interpolates 1/field
30 using a scheme specified at run-time and return the reciprocal of the
36 \*---------------------------------------------------------------------------*/
41 #include "surfaceInterpolationScheme.H"
42 #include "volFields.H"
43 #include "surfaceFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class localMax Declaration
52 \*---------------------------------------------------------------------------*/
57 public surfaceInterpolationScheme<Type>
59 // Private Member Functions
61 //- Disallow default bitwise assignment
62 void operator=(const localMax&);
67 //- Runtime type information
73 //- Construct from mesh
74 localMax(const fvMesh& mesh)
76 surfaceInterpolationScheme<Type>(mesh)
79 //- Construct from Istream.
80 // The name of the flux field is read from the Istream and looked-up
81 // from the mesh objectRegistry
88 surfaceInterpolationScheme<Type>(mesh)
91 //- Construct from faceFlux and Istream
95 const surfaceScalarField& faceFlux,
99 surfaceInterpolationScheme<Type>(mesh)
105 //- Return the interpolation weighting factors
106 virtual tmp<surfaceScalarField> weights
108 const GeometricField<Type, fvPatchField, volMesh>&
114 "(const GeometricField<Type, fvPatchField, volMesh>&)"
117 return tmp<surfaceScalarField>(NULL);
120 //- Return the face-interpolate of the given cell field
121 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
124 const GeometricField<Type, fvPatchField, volMesh>& vf
127 const fvMesh& mesh = vf.mesh();
129 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tvff
131 new GeometricField<Type, fvsPatchField, surfaceMesh>
136 mesh.time().timeName(),
143 GeometricField<Type, fvsPatchField, surfaceMesh>& vff = tvff();
145 forAll(vff.boundaryField(), patchi)
147 vff.boundaryField()[patchi] = vf.boundaryField()[patchi];
150 const unallocLabelList& own = mesh.owner();
151 const unallocLabelList& nei = mesh.neighbour();
155 vff[facei] = max(vf[own[facei]], vf[nei[facei]]);
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 // ************************************************************************* //