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...

Public Types | |
| enum | baseType { ITER, TIME } |
| Enumeration defining the averaging base type. More... | |
| enum | windowType { NONE, APPROXIMATE, EXACT } |
| Enumeration defining the averaging window type. More... | |
Public Member Functions | |
| fieldAverageItem () | |
| Construct null. More... | |
| fieldAverageItem (Istream &) | |
| Construct from Istream. More... | |
| fieldAverageItem (const fieldAverageItem &) | |
| Construct as copy. More... | |
| ~fieldAverageItem () | |
| Destructor. More... | |
| bool | active () const |
| Return const access to the active flag. More... | |
| bool & | active () |
| Return non-const access to the active flag. More... | |
| const word & | fieldName () const |
| Return const access to the field name. More... | |
| bool | mean () const |
| Return const access to the mean flag. More... | |
| bool & | mean () |
| Return non-const access to the mean flag. More... | |
| const word & | meanFieldName () const |
| Return const access to the mean field name. More... | |
| void | setMeanFieldName (const word &name) |
| Set the mean field name. More... | |
| bool | prime2Mean () const |
| Return const access to the prime-squared mean flag. More... | |
| bool & | prime2Mean () |
| Return non-const access to the prime-squared mean flag. More... | |
| const word & | prime2MeanFieldName () const |
| Return const access to the prime-squared mean field name. More... | |
| void | setPrime2MeanFieldName (const word &name) |
| Set the prime-squared mean field name. More... | |
| const word & | base () const |
| Return averaging base type name. More... | |
| label | totalIter () const |
| Return the total number of iterations item has been evolved. More... | |
| scalar | totalTime () const |
| Return the total time item has been evolved. More... | |
| scalar | window () const |
| Return the window length (iterations or seconds) More... | |
| const word & | windowName () const |
| Return the (optional) window name. More... | |
| const FIFOStack< scalar > & | windowTimes () const |
| Return the list of window times (windowType = EXACT) More... | |
| const FIFOStack< word > & | windowFieldNames () const |
| Return the list of window field names (windowType = EXACT) More... | |
| bool | allowRestart () const |
| Return the allow restart flag. More... | |
| scalar | dt (const scalar deltaT) const |
| Return the current time interval. More... | |
| scalar | Dt () const |
| Return the total time interval. More... | |
| word | windowFieldName (const word &prefix) const |
| Helper function to construct a window field name. More... | |
| bool | inWindow (const scalar t) const |
| Return true if time is inside window (including boundaries) More... | |
| bool | storeWindowFields () const |
| Return true if we wish to store window fields. More... | |
| bool | writeWindowFields () const |
| Return true if we wish to write window fields. More... | |
| void | addToWindow (const word &fieldName, const scalar deltaT) |
| Add field to window. More... | |
| void | evolve (const objectRegistry &obr) |
| Evolve and update. More... | |
| void | clear (const objectRegistry &obr, const bool fullClean) |
| Clear out all mean fields and (optionally) supporting data. More... | |
| bool | readState (const dictionary &dict) |
| Read state and re-initialise values. More... | |
| void | writeState (dictionary &dict) const |
| Write state for restart. More... | |
| template<class Type > | |
| bool | calculateMeanField (const objectRegistry &obr) const |
| Calculate the mean field value. More... | |
| template<class Type1 , class Type2 > | |
| bool | calculatePrime2MeanField (const objectRegistry &obr) const |
| Calculate prime-squared average fields. More... | |
| void | operator= (const fieldAverageItem &) |
Static Public Attributes | |
| static const word | EXT_MEAN |
| Mean average. More... | |
| static const word | EXT_PRIME2MEAN |
| Prime-squared average. More... | |
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 iterationsOptions for the windowType entry:
none | no windowing
exact | allow additional files will be stored and written
approximate | disallow additional files will be stored and writtenprime2Mean 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.
| fieldAverageItem | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 28 of file fieldAverageItemIO.C.
| fieldAverageItem | ( | const fieldAverageItem & | faItem | ) |
Construct as copy.
Definition at line 85 of file fieldAverageItem.C.
| ~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(), 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(), fieldAverage::addPrime2MeanField(), and fieldAverage::writeFields().

|
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(), fieldAverage::addPrime2MeanFieldType(), and fieldAverage::writeFields().

|
inline |
Set the mean field name.
Definition at line 61 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::addMeanSqrToPrime2Mean(), fieldAverage::addPrime2MeanField(), fieldAverage::addPrime2MeanFieldType(), and fieldAverage::writeFields().

|
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(), fieldAverage::addPrime2MeanFieldType(), and fieldAverage::writeFields().

|
inline |
Set the prime-squared mean field name.
Definition at line 89 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(), and fieldAverage::writeFields().

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

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

|
inline |
Helper function to construct a window field name.
Definition at line 199 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.

|
inline |
Return true if we wish to store window fields.
Definition at line 232 of file fieldAverageItemI.H.
Referenced by fieldAverage::storeWindowFields().

|
inline |
Return true if we wish to write window fields.
Definition at line 238 of file fieldAverageItemI.H.
Referenced by fieldAverage::writeFields().

| void addToWindow | ( | const word & | fieldName, |
| const scalar | deltaT | ||
| ) |
Add field to window.
Definition at line 117 of file fieldAverageItem.C.
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(), forAllIters, and objectRegistry::time().

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

| 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 26 of file fieldAverageItemTemplates.C.
References Foam::abort(), beta(), TimeState::deltaTValue(), Foam::FatalError, FatalErrorInFunction, objectRegistry::findObject(), objectRegistry::lookupObject(), objectRegistry::lookupObjectRef(), n, and objectRegistry::time().
Referenced by fieldAverage::calculateMeanFields().


| bool calculatePrime2MeanField | ( | const objectRegistry & | obr | ) | const |
Calculate prime-squared average fields.
Definition at line 161 of file fieldAverageItemTemplates.C.
References Foam::abort(), beta(), TimeState::deltaTValue(), Foam::FatalError, FatalErrorInFunction, objectRegistry::findObject(), objectRegistry::lookupObject(), objectRegistry::lookupObjectRef(), Foam::sqr(), and objectRegistry::time().
Referenced by fieldAverage::calculatePrime2MeanFields().


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

|
friend |
Definition at line 483 of file fieldAverageItem.H.
|
friend |
Definition at line 505 of file fieldAverageItem.H.
|
friend |
|
friend |
|
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>>().