83#ifndef fieldAverageItem_H
84#define fieldAverageItem_H
100namespace functionObjects
104class fieldAverageItem;
105Istream&
operator>>(Istream&, fieldAverageItem&);
106Ostream&
operator<<(Ostream&,
const fieldAverageItem&);
112class fieldAverageItem
163 word prime2MeanFieldName_;
222 inline bool active()
const;
231 inline bool mean()
const;
264 inline scalar
window()
const;
279 inline scalar
dt(
const scalar deltaT)
const;
282 inline scalar
Dt()
const;
288 inline bool inWindow(
const scalar t)
const;
316 template<
class Type1,
class Type2>
327 friend bool operator==
334 a.active_ ==
b.active_
335 && a.fieldName_ ==
b.fieldName_
336 && a.mean_ ==
b.mean_
337 && a.meanFieldName_ ==
b.meanFieldName_
338 && a.prime2Mean_ ==
b.prime2Mean_
339 && a.prime2MeanFieldName_ ==
b.prime2MeanFieldName_
340 && a.base_ ==
b.base_
341 && a.totalIter_ ==
b.totalIter_
342 && a.totalTime_ ==
b.totalTime_
343 && a.window_ ==
b.window_
344 && a.windowName_ ==
b.windowName_
345 && a.windowType_ ==
b.windowType_
346 && a.allowRestart_ ==
b.allowRestart_;
349 friend bool operator!=
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A FIFO stack based on a singly-linked list.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Helper class to describe what form of averaging to apply. A set will be applied to each base field in...
bool calculatePrime2MeanField(const objectRegistry &obr) const
Calculate prime-squared average fields.
baseType
Enumeration defining the averaging base type.
bool allowRestart() const
Return the allow restart flag.
const FIFOStack< word > & windowFieldNames() const
Return the list of window field names (windowType = EXACT)
const word & base() const
Return averaging base type name.
const word & fieldName() const
Return const access to the field name.
bool writeWindowFields() const
Return true if we wish to write window fields.
bool mean() const
Return const access to the mean flag.
friend Istream & operator>>(Istream &, fieldAverageItem &)
static const word EXT_PRIME2MEAN
Prime-squared average.
void evolve(const objectRegistry &obr)
Evolve and update.
bool storeWindowFields() const
Return true if we wish to store window fields.
const word & windowName() const
Return the (optional) window name.
windowType
Enumeration defining the averaging window type.
bool inWindow(const scalar t) const
Return true if time is inside window (including boundaries)
friend Ostream & operator<<(Ostream &, const fieldAverageItem &)
scalar totalTime() const
Return the total time item has been evolved.
void addToWindow(const word &fieldName, const scalar deltaT)
Add field to window.
scalar window() const
Return the window length (iterations or seconds)
scalar dt(const scalar deltaT) const
Return the current time interval.
label totalIter() const
Return the total number of iterations item has been evolved.
~fieldAverageItem()
Destructor.
scalar Dt() const
Return the total time interval.
word windowFieldName(const word &prefix) const
Helper function to construct a window field name.
void setPrime2MeanFieldName(const word &name)
Set the prime-squared mean field name.
bool calculateMeanField(const objectRegistry &obr) const
Calculate the mean field value.
bool prime2Mean() const
Return const access to the prime-squared mean flag.
void setMeanFieldName(const word &name)
Set the mean field name.
fieldAverageItem()
Construct null.
const FIFOStack< scalar > & windowTimes() const
Return the list of window times (windowType = EXACT)
const word & prime2MeanFieldName() const
Return const access to the prime-squared mean field name.
bool active() const
Return const access to the active flag.
void writeState(dictionary &dict) const
Write state for restart.
const word & meanFieldName() const
Return const access to the mean field name.
void operator=(const fieldAverageItem &)
static const word EXT_MEAN
Mean average.
bool readState(const dictionary &dict)
Read state and re-initialise values.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, fieldInfo &)
Ostream & operator<<(Ostream &, const fieldInfo &)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.