1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
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
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/>.
28 LocalMin-mean differencing scheme class.
30 This scheme interpolates 1/field using a scheme specified at run-time
31 and return the reciprocal of the interpolate.
36 \*---------------------------------------------------------------------------*/
41 #include "surfaceInterpolationScheme.H"
42 #include "volFields.H"
43 #include "surfaceFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class localMin Declaration
52 \*---------------------------------------------------------------------------*/
57 public surfaceInterpolationScheme<Type>
59 // Private Member Functions
61 //- Disallow default bitwise assignment
62 void operator=(const localMin&);
67 //- Runtime type information
73 //- Construct from mesh
74 localMin(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>
135 "localMin::interpolate(" + vf.name() + ')',
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 labelUList& own = mesh.owner();
151 const labelUList& nei = mesh.neighbour();
155 vff[facei] = minMod(vf[own[facei]], vf[nei[facei]]);
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 // ************************************************************************* //