38 fieldName_(
"unknown"),
40 meanFieldName_(
"unknown"),
42 prime2MeanFieldName_(
"unknown"),
63 fieldAverageItem& faItem
71 faItem.active_ =
false;
72 faItem.fieldName_ = dictEntry.
keyword();
73 faItem.mean_ =
dict.get<
bool>(
"mean");
74 faItem.prime2Mean_ =
dict.get<
bool>(
"prime2Mean");
75 faItem.base_ = faItem.baseTypeNames_.get(
"base",
dict);
76 faItem.window_ =
dict.getOrDefault<scalar>(
"window", -1);
78 if (faItem.window_ > 0)
80 faItem.windowType_ = faItem.windowTypeNames_.get(
"windowType",
dict);
87 && label(faItem.window_) < 1
91 <<
"Window must be 1 or more for base type " 96 faItem.windowName_ =
dict.getOrDefault<
word>(
"windowName",
"");
100 faItem.allowRestart_ =
dict.get<
bool>(
"allowRestart");
102 if (!faItem.allowRestart_)
105 << faItem.windowTypeNames_[faItem.windowType_]
106 <<
" windowing for field " << faItem.fieldName_
107 <<
" will not write intermediate files and restart will" 108 <<
" not be possible. To enable, please set" 109 <<
" 'allowRestart' to 'yes'" 127 faItem.prime2MeanFieldName_ =
130 if ((faItem.window_ > 0) && (!faItem.windowName_.empty()))
132 faItem.meanFieldName_ =
133 faItem.meanFieldName_ +
"_" + faItem.windowName_;
135 faItem.prime2MeanFieldName_ =
136 faItem.prime2MeanFieldName_ +
"_" + faItem.windowName_;
146 const fieldAverageItem& faItem
151 os.beginBlock(faItem.fieldName_);
153 os.writeEntry(
"mean", faItem.mean_);
154 os.writeEntry(
"prime2Mean", faItem.prime2Mean_);
155 os.writeEntry(
"base", faItem.baseTypeNames_[faItem.base_]);
157 if (faItem.window_ > 0)
159 os.writeEntry(
"window", faItem.window_);
161 if (!faItem.windowName_.empty())
163 os.writeEntry(
"windowName", faItem.windowName_);
169 faItem.windowTypeNames_[faItem.windowType_]
172 os.writeEntry(
"allowRestart", faItem.allowRestart_);
fieldAverageItem()
Construct null.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
baseType
Enumeration defining the averaging base type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A keyword and a list of tokens is a 'dictionaryEntry'.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static const word EXT_PRIME2MEAN
Prime-squared average.
const keyType & keyword() const noexcept
Return keyword.
A class for handling words, derived from Foam::string.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
windowType
Enumeration defining the averaging window type.
virtual const dictionary & dict() const noexcept
Return dictionary (ie, this)
static const word EXT_MEAN
Mean average.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...