49 Foam::functionObjects::fieldAverageItem::baseTypeNames_
51 { baseType::ITER,
"iteration" },
52 { baseType::TIME,
"time" },
60 Foam::functionObjects::fieldAverageItem::windowTypeNames_
62 { windowType::NONE,
"none" },
63 { windowType::APPROXIMATE,
"approximate" },
64 { windowType::EXACT,
"exact" },
73 fieldName_(
"unknown"),
75 meanFieldName_(
"unknown"),
77 prime2MeanFieldName_(
"unknown"),
78 base_(baseType::ITER),
83 windowType_(windowType::NONE),
96 active_(faItem.active_),
97 fieldName_(faItem.fieldName_),
99 meanFieldName_(faItem.meanFieldName_),
100 prime2Mean_(faItem.prime2Mean_),
101 prime2MeanFieldName_(faItem.prime2MeanFieldName_),
103 totalIter_(faItem.totalIter_),
104 totalTime_(faItem.totalTime_),
105 window_(faItem.window_),
106 windowName_(faItem.windowName_),
107 windowType_(faItem.windowType_),
109 windowTimes_(faItem.windowTimes_),
110 windowFieldNames_(faItem.windowFieldNames_),
111 allowRestart_(faItem.allowRestart_)
125 const word& fieldName,
129 windowTimes_.push(deltaT);
130 windowFieldNames_.push(fieldName);
144 bool removeItem =
true;
146 while (removeItem && windowTimes_.size())
148 removeItem = !(inWindow(windowTimes_.first()));
153 const word fieldName = windowFieldNames_.pop();
164 const objectRegistry& obr,
170 obr.checkOut(meanFieldName_);
175 obr.checkOut(prime2MeanFieldName_);
178 for (
const word& fieldName : windowFieldNames_)
180 obr.checkOut(fieldName);
183 if (totalTime_ < 0 || fullClean)
187 windowTimes_.clear();
188 windowFieldNames_.clear();
195 dict.readEntry(
"totalIter", totalIter_);
196 dict.readEntry(
"totalTime", totalTime_);
200 dict.readEntry(
"windowTimes", windowTimes_);
201 dict.readEntry(
"windowFieldNames", windowFieldNames_);
213 dict.add(
"totalIter", totalIter_);
214 dict.add(
"totalTime", totalTime_);
218 dict.add(
"windowTimes", windowTimes_);
219 dict.add(
"windowFieldNames", windowFieldNames_);
226 void Foam::functionObjects::fieldAverageItem::operator=
228 const fieldAverageItem& rhs
237 active_ = rhs.active_;
238 fieldName_ = rhs.fieldName_;
240 meanFieldName_ = rhs.meanFieldName_;
241 prime2Mean_ = rhs.prime2Mean_;
242 prime2MeanFieldName_ = rhs.prime2MeanFieldName_;
244 totalIter_ = rhs.totalIter_;
245 totalTime_ = rhs.totalTime_;
246 window_ = rhs.window_;
247 windowName_ = rhs.windowName_;
248 windowType_ = rhs.windowType_;
249 windowTimes_ = rhs.windowTimes_;
250 windowFieldNames_ = rhs.windowFieldNames_;
251 allowRestart_ = rhs.allowRestart_;
fieldAverageItem()
Construct null.
scalar deltaTValue() const noexcept
Return time step value.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
baseType
Enumeration defining the averaging base type.
bool checkOut(regIOobject *io) const
Remove a regIOobject from registry and free memory if the object is ownedByRegistry. A nullptr is ignored.
bool readState(const dictionary &dict)
Read state and re-initialise values.
static const word EXT_PRIME2MEAN
Prime-squared average.
~fieldAverageItem()
Destructor.
void addToWindow(const word &fieldName, const scalar deltaT)
Add field to window.
void writeState(dictionary &dict) const
Write state for restart.
A class for handling words, derived from Foam::string.
const Time & time() const noexcept
Return time registry.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
void evolve(const objectRegistry &obr)
Evolve and update.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Helper class to describe what form of averaging to apply. A set will be applied to each base field in...
void clear(const objectRegistry &obr, const bool fullClean)
Clear out all mean fields and (optionally) supporting data.
Registry of regIOobjects.
windowType
Enumeration defining the averaging window type.
static const word EXT_MEAN
Mean average.