/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class Foam::localMin Description LocalMin-mean differencing scheme class. This scheme interpolates 1/field using a scheme specified at run-time and return the reciprocal of the interpolate. SourceFiles localMin.C \*---------------------------------------------------------------------------*/ #ifndef localMin_H #define localMin_H #include "surfaceInterpolationScheme.H" #include "volFields.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class localMin Declaration \*---------------------------------------------------------------------------*/ template class localMin : public surfaceInterpolationScheme { // Private Member Functions //- Disallow default bitwise assignment void operator=(const localMin&); public: //- Runtime type information TypeName("localMin"); // Constructors //- Construct from mesh localMin(const fvMesh& mesh) : surfaceInterpolationScheme(mesh) {} //- Construct from Istream. // The name of the flux field is read from the Istream and looked-up // from the mesh objectRegistry localMin ( const fvMesh& mesh, Istream& is ) : surfaceInterpolationScheme(mesh) {} //- Construct from faceFlux and Istream localMin ( const fvMesh& mesh, const surfaceScalarField& faceFlux, Istream& is ) : surfaceInterpolationScheme(mesh) {} // Member Functions //- Return the interpolation weighting factors virtual tmp weights ( const GeometricField& ) const { notImplemented ( "localMin::weights" "(const GeometricField&)" ); return tmp(NULL); } //- Return the face-interpolate of the given cell field virtual tmp > interpolate ( const GeometricField& vf ) const { const fvMesh& mesh = vf.mesh(); tmp > tvff ( new GeometricField ( IOobject ( "localMin::interpolate(" + vf.name() + ')', mesh.time().timeName(), mesh ), mesh, vf.dimensions() ) ); GeometricField& vff = tvff(); forAll(vff.boundaryField(), patchi) { vff.boundaryField()[patchi] = vf.boundaryField()[patchi]; } const unallocLabelList& own = mesh.owner(); const unallocLabelList& nei = mesh.neighbour(); forAll(vff, facei) { vff[facei] = minMod(vf[own[facei]], vf[nei[facei]]); } return tvff; } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //