1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::fieldAverageItem
29 Helper class to describe what form of averaging to apply. A set will be
30 applied to each base field in Foam::fieldAverage, of the form:
36 base time; // iteration
44 \*---------------------------------------------------------------------------*/
46 #ifndef fieldAverageItem_H
47 #define fieldAverageItem_H
49 #include "NamedEnum.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 // Forward declaration of classes
61 // Forward declaration of friend functions and operators
62 class fieldAverageItem;
63 Istream& operator>>(Istream&, fieldAverageItem&);
64 Ostream& operator<<(Ostream&, const fieldAverageItem&);
67 /*---------------------------------------------------------------------------*\
68 Class fieldAverageItem Declaration
69 \*---------------------------------------------------------------------------*/
71 class fieldAverageItem
77 //- Enumeration defining the averaging base type
95 //- Compute prime-squared mean flag
98 //- Averaging base type names
99 static const NamedEnum<baseType, 2> baseTypeNames_;
101 //- Averaging base type
105 // Private Member Functions
107 //- Disallow default bitwise copy construct
108 // fieldAverageItem(const fieldAverageItem&);
110 //- Disallow default bitwise assignment
111 // void operator=(const fieldAverageItem&);
121 //- Construct from Istream
122 fieldAverageItem(Istream&);
124 //- Construct as copy
125 fieldAverageItem(const fieldAverageItem&);
137 //- Return const access to the field name
138 const word& fieldName() const
143 //- Return const access to the mean flag
144 const Switch& mean() const
149 //- Return const access to the prime-squared mean flag
150 const Switch& prime2Mean() const
155 //- Return averaging base type name
156 const word base() const
158 return baseTypeNames_[base_];
161 //- Return true if base is ITER
162 Switch ITERBase() const
164 return base_ == ITER;
167 //- Return true if base is time
168 Switch timeBase() const
170 return base_ == TIME;
176 void operator=(const fieldAverageItem&);
179 // IOstream Operators
181 friend Istream& operator>>(Istream&, fieldAverageItem&);
182 friend Ostream& operator<<(Ostream&, const fieldAverageItem&);
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 // ************************************************************************* //