Go to the documentation of this file.
38 namespace functionObjects
40 namespace runTimeControls
46 equationMaxIterCondition,
67 threshold_(
dict.get<label>(
"threshold")),
68 startIter_(
dict.getOrDefault(
"startIter", 2))
70 if (!fieldNames_.size())
73 <<
"No fields supplied: deactivating" <<
endl;
78 startIter_ =
max(startIter_, 2);
86 bool satisfied =
false;
108 if (solverDict.
found(fieldName))
111 const label nIterations = sp.first().nIterations();
112 result[fieldi] = nIterations;
127 <<
"Number of iterations data not found for field "
139 <<
"Number of iterations data not found for any fields: "
140 <<
"deactivating" <<
endl;
145 if (satisfied && valid)
148 <<
": satisfied using threshold value: " <<
threshold_ <<
nl;
152 if (result[resulti] != -1)
155 <<
", iterations: " << result[resulti] <<
nl;
defineTypeNameAndDebug(averageCondition, 0)
Base class for run time conditions.
equationMaxIterCondition(const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state)
Constructor.
A class for handling words, derived from Foam::string.
bool active_
On/off switch.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
addToRunTimeSelectionTable(runTimeCondition, averageCondition, dictionary)
Base class for function objects, adding functionality to read/write state information (data required ...
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool apply()
Apply the condition.
const label threshold_
Threshold for maximum number of iterations.
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
label startIter_
Start checking from iteration - always skips first iteration.
label timeIndex() const noexcept
Return current time index.
const objectRegistry & obr_
Reference to the object registry.
const wordList fieldNames_
Field name.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
virtual void write()
Write.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
word name_
Condition name.
#define WarningInFunction
Report a warning using Foam::Warning.
const Time & time() const noexcept
Return time registry.