/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ 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 3 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, see . Class Foam::localMax Group grpFvSurfaceInterpolationSchemes Description LocalMax-mean differencing scheme class. This scheme interpolates 1/field using a scheme specified at run-time and return the reciprocal of the interpolate. SourceFiles localMax.C \*---------------------------------------------------------------------------*/ #ifndef localMax_H #define localMax_H #include "surfaceInterpolationScheme.H" #include "volFields.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class localMax Declaration \*---------------------------------------------------------------------------*/ template class localMax : public surfaceInterpolationScheme { // Private Member Functions //- Disallow default bitwise assignment void operator=(const localMax&); public: //- Runtime type information TypeName("localMax"); // Constructors //- Construct from mesh localMax(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 localMax ( const fvMesh& mesh, Istream& is ) : surfaceInterpolationScheme(mesh) {} //- Construct from faceFlux and Istream localMax ( const fvMesh& mesh, const surfaceScalarField& faceFlux, Istream& is ) : surfaceInterpolationScheme(mesh) {} // Member Functions //- Return the interpolation weighting factors virtual tmp weights ( const GeometricField& ) const { NotImplemented; 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 ( "localMax::interpolate(" + vf.name() + ')', mesh.time().timeName(), mesh ), mesh, vf.dimensions() ) ); GeometricField& vff = tvff.ref(); forAll(vff.boundaryField(), patchi) { vff.boundaryField()[patchi] = vf.boundaryField()[patchi]; } const labelUList& own = mesh.owner(); const labelUList& nei = mesh.neighbour(); forAll(vff, facei) { vff[facei] = max(vf[own[facei]], vf[nei[facei]]); } return tvff; } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //