38 fieldName_(
"unknown"),
40 meanFieldName_(
"unknown"),
42 prime2MeanFieldName_(
"unknown"),
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_;
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_);
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
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)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A keyword and a list of tokens is a 'dictionaryEntry'.
virtual const dictionary & dict() const noexcept
Return dictionary (ie, this)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const keyType & keyword() const noexcept
Return keyword.
Helper class to describe what form of averaging to apply. A set will be applied to each base field in...
baseType
Enumeration defining the averaging base type.
static const word EXT_PRIME2MEAN
Prime-squared average.
windowType
Enumeration defining the averaging window type.
fieldAverageItem()
Construct null.
static const word EXT_MEAN
Mean average.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)