Helper class to describe what form of averaging to apply. A set will be applied to each base field in Foam::fieldAverage, of the following form. More...
#include <fieldAverageItem.H>

Public Types | |
| enum class | baseType { ITER , TIME } |
| Enumeration defining the averaging base type. More... | |
| enum class | windowType { NONE , APPROXIMATE , EXACT } |
| Enumeration defining the averaging window type. More... | |
Public Member Functions | |
| fieldAverageItem () | |
| Construct null. | |
| fieldAverageItem (Istream &) | |
| Construct from Istream. | |
| fieldAverageItem (const fieldAverageItem &) | |
| Construct as copy. | |
| ~fieldAverageItem () | |
| Destructor. | |
| bool | active () const |
| Return const access to the active flag. | |
| bool & | active () |
| Return non-const access to the active flag. | |
| const word & | fieldName () const |
| Return const access to the field name. | |
| bool | mean () const |
| Return const access to the mean flag. | |
| bool & | mean () |
| Return non-const access to the mean flag. | |
| const word & | meanFieldName () const |
| Return const access to the mean field name. | |
| void | setMeanFieldName (const word &name) |
| Set the mean field name. | |
| bool | prime2Mean () const |
| Return const access to the prime-squared mean flag. | |
| bool & | prime2Mean () |
| Return non-const access to the prime-squared mean flag. | |
| const word & | prime2MeanFieldName () const |
| Return const access to the prime-squared mean field name. | |
| void | setPrime2MeanFieldName (const word &name) |
| Set the prime-squared mean field name. | |
| const word & | base () const |
| Return averaging base type name. | |
| label | totalIter () const |
| Return the total number of iterations item has been evolved. | |
| scalar | totalTime () const |
| Return the total time item has been evolved. | |
| scalar | window () const |
| Return the window length (iterations or seconds). | |
| const word & | windowName () const |
| Return the (optional) window name. | |
| const FIFOStack< scalar > & | windowTimes () const |
| Return the list of window times (windowType = EXACT). | |
| const FIFOStack< word > & | windowFieldNames () const |
| Return the list of window field names (windowType = EXACT). | |
| bool | allowRestart () const |
| Return the allow restart flag. | |
| scalar | dt (const scalar deltaT) const |
| Return the current time interval. | |
| scalar | Dt () const |
| Return the total time interval. | |
| word | windowFieldName (const word &prefix) const |
| Helper function to construct a window field name. | |
| bool | inWindow (const scalar t) const |
| Return true if time is inside window (including boundaries). | |
| bool | storeWindowFields () const |
| Return true if we wish to store window fields. | |
| bool | writeWindowFields () const |
| Return true if we wish to write window fields. | |
| void | addToWindow (const word &fieldName, const scalar deltaT) |
| Add field to window. | |
| void | evolve (const objectRegistry &obr) |
| Evolve and update. | |
| void | clear (const objectRegistry &obr, const bool fullClean) |
| Clear out all mean fields and (optionally) supporting data. | |
| bool | readState (const dictionary &dict) |
| Read state and re-initialise values. | |
| void | writeState (dictionary &dict) const |
| Write state for restart. | |
| template<class Type> | |
| bool | calculateMeanField (const objectRegistry &obr) const |
| Calculate the mean field value. | |
| template<class Type1, class Type2> | |
| bool | calculatePrime2MeanField (const objectRegistry &obr) const |
| Calculate prime-squared average fields. | |
| void | operator= (const fieldAverageItem &) |
Static Public Attributes | |
| static const word | EXT_MEAN |
| Mean average. | |
| static const word | EXT_PRIME2MEAN |
| Prime-squared average. | |
Friends | |
| bool | operator== (const fieldAverageItem &a, const fieldAverageItem &b) |
| bool | operator!= (const fieldAverageItem &a, const fieldAverageItem &b) |
| Istream & | operator>> (Istream &, fieldAverageItem &) |
| Ostream & | operator<< (Ostream &, const fieldAverageItem &) |
Helper class to describe what form of averaging to apply. A set will be applied to each base field in Foam::fieldAverage, of the following form.
<field1>
{
mean on;
prime2Mean on;
base time; // iteration
window 200; // optional averaging window
windowName w1; // optional window name (default = "")
windowType approximate; // window type
allowRestart yes; // optional, used for windowType 'exact'
}
where the entries mean:
| Property | Description | Type | Req'd | Dflt |
|---|---|---|---|---|
mean | Flag to calculate average | bool | yes | - |
prime2Mean | Flag to calculate prime-square average | bool | yes | - |
base | Type of averaging interval | word | yes | - |
window | Averaging window | scalar | no | |
windowName | Name of the averaging window | word | no | "" |
windowType | Type of averaging window | word | no | |
allowRestart | Flag to allow restart for windowType=exact | bool | no |
Options for the base entry:
time | Averaging interval is based on time
iter | Averaging interval is based on iterations
Options for the windowType entry:
none | no windowing
exact | allow additional files will be stored and written
approximate | disallow additional files will be stored and written
prime2Mean option, the mean option must be enabled.Definition at line 153 of file fieldAverageItem.H.
|
strong |
Enumeration defining the averaging base type.
| Enumerator | |
|---|---|
| ITER | |
| TIME | |
Definition at line 175 of file fieldAverageItem.H.
|
strong |
Enumeration defining the averaging window type.
| Enumerator | |
|---|---|
| NONE | |
| APPROXIMATE | |
| EXACT | |
Definition at line 184 of file fieldAverageItem.H.
| fieldAverageItem | ( | ) |
Construct null.
Definition at line 63 of file fieldAverageItem.C.
Referenced by fieldAverageItem(), operator!=, operator<<, operator=(), operator==, and operator>>.

| fieldAverageItem | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 28 of file fieldAverageItemIO.C.
| fieldAverageItem | ( | const fieldAverageItem & | faItem | ) |
Construct as copy.
Definition at line 84 of file fieldAverageItem.C.
References fieldAverageItem().

| ~fieldAverageItem | ( | ) |
Destructor.
Definition at line 110 of file fieldAverageItem.C.
|
inline |
Return const access to the active flag.
Definition at line 23 of file fieldAverageItemI.H.
Referenced by fieldAverage::addMeanFieldType().

|
inline |
Return non-const access to the active flag.
Definition at line 29 of file fieldAverageItemI.H.
|
inline |
Return const access to the field name.
Definition at line 35 of file fieldAverageItemI.H.
Referenced by fieldAverage::addMeanFieldType(), fieldAverage::addMeanSqrToPrime2MeanType(), fieldAverage::addPrime2MeanField(), fieldAverage::addPrime2MeanFieldType(), addToWindow(), calculateMeanField(), calculatePrime2MeanField(), clear(), evolve(), fieldAverage::restoreWindowFieldsType(), and fieldAverage::storeWindowFieldType().

|
inline |
Return const access to the mean flag.
Definition at line 41 of file fieldAverageItemI.H.
Referenced by fieldAverage::addMeanField(), fieldAverage::addMeanFieldType(), and fieldAverage::addPrime2MeanField().

|
inline |
Return non-const access to the mean flag.
Definition at line 47 of file fieldAverageItemI.H.
|
inline |
Return const access to the mean field name.
Definition at line 54 of file fieldAverageItemI.H.
Referenced by fieldAverage::addMeanFieldType(), fieldAverage::addMeanSqrToPrime2MeanType(), and fieldAverage::addPrime2MeanFieldType().

|
inline |
Set the mean field name.
Definition at line 60 of file fieldAverageItemI.H.
References Foam::name().

|
inline |
Return const access to the prime-squared mean flag.
Definition at line 69 of file fieldAverageItemI.H.
Referenced by fieldAverage::addPrime2MeanField(), and fieldAverage::addPrime2MeanFieldType().

|
inline |
Return non-const access to the prime-squared mean flag.
Definition at line 75 of file fieldAverageItemI.H.
|
inline |
Return const access to the prime-squared mean field name.
Definition at line 82 of file fieldAverageItemI.H.
Referenced by fieldAverage::addMeanSqrToPrime2MeanType(), and fieldAverage::addPrime2MeanFieldType().

|
inline |
Set the prime-squared mean field name.
Definition at line 88 of file fieldAverageItemI.H.
References Foam::name().

|
inline |
Return averaging base type name.
Definition at line 97 of file fieldAverageItemI.H.
|
inline |
Return the total number of iterations item has been evolved.
Definition at line 103 of file fieldAverageItemI.H.
|
inline |
Return the total time item has been evolved.
Definition at line 109 of file fieldAverageItemI.H.
|
inline |
Return the window length (iterations or seconds).
Definition at line 115 of file fieldAverageItemI.H.
Referenced by fieldAverage::restoreWindowFields().

|
inline |
Return the (optional) window name.
Definition at line 121 of file fieldAverageItemI.H.
|
inline |
Return the list of window times (windowType = EXACT).
Definition at line 128 of file fieldAverageItemI.H.
|
inline |
Return the list of window field names (windowType = EXACT).
Definition at line 135 of file fieldAverageItemI.H.
Referenced by fieldAverage::restoreWindowFieldsType().

|
inline |
Return the allow restart flag.
Definition at line 141 of file fieldAverageItemI.H.
|
inline |
Return the current time interval.
Definition at line 147 of file fieldAverageItemI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by calculateMeanField(), and calculatePrime2MeanField().


|
inline |
Return the total time interval.
Definition at line 174 of file fieldAverageItemI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by calculateMeanField(), and calculatePrime2MeanField().


|
inline |
Helper function to construct a window field name.
Definition at line 198 of file fieldAverageItemI.H.
References Foam::name().
Referenced by fieldAverage::storeWindowFieldType().


|
inline |
Return true if time is inside window (including boundaries).
Definition at line 207 of file fieldAverageItemI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by evolve().


|
inline |
Return true if we wish to store window fields.
Definition at line 232 of file fieldAverageItemI.H.
References EXACT.
|
inline |
Return true if we wish to write window fields.
Definition at line 238 of file fieldAverageItemI.H.
| void addToWindow | ( | const word & | fieldName, |
| const scalar | deltaT ) |
Add field to window.
Definition at line 116 of file fieldAverageItem.C.
References fieldName().
Referenced by fieldAverage::storeWindowFieldType().


| void evolve | ( | const objectRegistry & | obr | ) |
Evolve and update.
Definition at line 127 of file fieldAverageItem.C.
References objectRegistry::checkOut(), TimeState::deltaTValue(), fieldName(), forAllIters, inWindow(), and objectRegistry::time().

| void clear | ( | const objectRegistry & | obr, |
| const bool | fullClean ) |
Clear out all mean fields and (optionally) supporting data.
Definition at line 155 of file fieldAverageItem.C.
References objectRegistry::checkOut(), and fieldName().

| bool readState | ( | const dictionary & | dict | ) |
Read state and re-initialise values.
Definition at line 186 of file fieldAverageItem.C.
References dict.
| void writeState | ( | dictionary & | dict | ) | const |
| bool calculateMeanField | ( | const objectRegistry & | obr | ) | const |
Calculate the mean field value.
Definition at line 25 of file fieldAverageItemTemplates.C.
References Foam::abort(), APPROXIMATE, beta(), TimeState::deltaTValue(), Dt(), dt(), EXACT, Foam::FatalError, FatalErrorInFunction, fieldName(), objectRegistry::findObject(), objectRegistry::lookupObject(), objectRegistry::lookupObjectRef(), n, NONE, and objectRegistry::time().

| bool calculatePrime2MeanField | ( | const objectRegistry & | obr | ) | const |
Calculate prime-squared average fields.
Definition at line 160 of file fieldAverageItemTemplates.C.
References Foam::abort(), APPROXIMATE, beta(), TimeState::deltaTValue(), Dt(), dt(), EXACT, Foam::FatalError, FatalErrorInFunction, fieldName(), objectRegistry::findObject(), objectRegistry::lookupObject(), objectRegistry::lookupObjectRef(), NONE, Foam::sqr(), and objectRegistry::time().

| void operator= | ( | const fieldAverageItem & | rhs | ) |
Definition at line 219 of file fieldAverageItem.C.
References fieldAverageItem(), and Foam::rhs().

|
friend |
Definition at line 482 of file fieldAverageItem.H.
References b, and fieldAverageItem().
|
friend |
Definition at line 504 of file fieldAverageItem.H.
References b, and fieldAverageItem().
|
friend |
References fieldAverageItem().
|
friend |
References fieldAverageItem().
|
static |
Mean average.
Definition at line 164 of file fieldAverageItem.H.
Referenced by Foam::functionObjects::operator>>().
|
static |
Prime-squared average.
Definition at line 169 of file fieldAverageItem.H.
Referenced by Foam::functionObjects::operator>>().