1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 Calculates scalar minimim and maximum field values.
30 For variables with rank > 0, computes the magnitude of the min/max
33 Data written to the file \<timeDir\>/fieldMinMax.dat
40 \*---------------------------------------------------------------------------*/
45 #include "primitiveFieldsFwd.H"
46 #include "volFieldsFwd.H"
50 #include "pointFieldFwd.H"
51 #include "NamedEnum.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 // Forward declaration of classes
63 /*---------------------------------------------------------------------------*\
64 Class fieldMinMax Declaration
65 \*---------------------------------------------------------------------------*/
82 static const NamedEnum<modeType, 2> modeTypeNames_;
84 //- Name of this set of field min/max.
85 // Also used as the name of the output directory.
88 const objectRegistry& obr_;
93 //- Switch to enable/disable writing to file
96 //- Switch to send output to Info as well
99 //- Mode for min/max - only applicable for ranks > 0
102 //- Fields to assess min/max
106 autoPtr<OFstream> fieldMinMaxFilePtr_;
109 // Private Member Functions
111 //- If the output file has not been created create it
114 //- Disallow default bitwise copy construct
115 fieldMinMax(const fieldMinMax&);
117 //- Disallow default bitwise assignment
118 void operator=(const fieldMinMax&);
120 //- Output file header information
121 virtual void writeFileHeader();
126 //- Runtime type information
127 TypeName("fieldMinMax");
132 //- Construct for given objectRegistry and dictionary.
133 // Allow the possibility to load fields from files
137 const objectRegistry&,
139 const bool loadFromFiles = false
144 virtual ~fieldMinMax();
149 //- Return name of the set of field min/max
150 virtual const word& name() const
155 //- Read the field min/max data
156 virtual void read(const dictionary&);
158 //- Execute, currently does nothing
159 virtual void execute();
161 //- Execute at the final time-loop, currently does nothing
164 //- Calculate the field min/max
166 void calcMinMaxFields(const word& fieldName);
168 //- Write the fieldMinMax
169 virtual void write();
171 //- Update for changes of mesh
172 virtual void updateMesh(const mapPolyMesh&)
175 //- Update for changes of mesh
176 virtual void movePoints(const pointField&)
181 // Template specialisation for scalar fields
183 void fieldMinMax::calcMinMaxFields<scalar>(const word& fieldName);
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 # include "fieldMinMaxTemplates.C"
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 // ************************************************************************* //