1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "fieldMinMax.H"
27 #include "volFields.H"
28 #include "dictionary.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 void Foam::fieldMinMax::calcMinMaxFields(const word& fieldName)
36 typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
38 if (obr_.foundObject<fieldType>(fieldName))
40 const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
45 const scalar minValue = min(mag(field)).value();
46 const scalar maxValue = max(mag(field)).value();
48 if (Pstream::master())
53 << obr_.time().value() << tab
54 << fieldName << tab << minValue << tab << maxValue
60 Info<< "fieldMinMax output:" << nl
61 << " min(mag(" << fieldName << ")) = "
63 << " max(mag(" << fieldName << ")) = "
72 const Type minValue = min(field).value();
73 const Type maxValue = max(field).value();
75 if (Pstream::master())
80 << obr_.time().value() << tab
81 << fieldName << tab << minValue << tab << maxValue
87 Info<< "fieldMinMax output:" << nl
88 << " cmptMin(" << fieldName << ") = "
90 << " cmptMax(" << fieldName << ") = "
101 "Foam::fieldMinMax::calcMinMaxFields"
102 "(const word& fieldName)"
103 )<< "Unknown min/max mode: " << modeTypeNames_[mode_]
111 // ************************************************************************* //