36void Foam::functionObjects::runTimeControls::minMaxCondition::
39 const word& valueType,
40 const word& fieldName,
44 state_.getObjectResult(functionObjectName_, fieldName, value);
74 { modeType::mdMax,
"maximum" },
85 stateFunctionObject& state
88 runTimeCondition(
name, obr,
dict, state),
89 functionObjectName_(
dict.get<
word>(
"functionObject")),
90 mode_(modeTypeNames_.get(
"mode",
dict)),
100 bool satisfied =
true;
109 const word valueType =
112 if (valueType.empty())
115 <<
"Unable to find entry " << fieldName
117 <<
". Condition will not be applied."
152 << fieldName <<
": value = " << v
153 <<
", threshold value = " <<
value_
154 <<
", satisfied = " << ok <<
endl;
156 satisfied = satisfied && ok;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const wordList fieldNames_
Field names.
word functionObjectName_
Name of function object to retrueve data from.
virtual bool apply()
Apply the condition.
static const Enum< modeType > modeTypeNames_
const scalar value_
Value to compare.
void setValue(const word &valueType, const word &fieldName, scalar &value) const
Helper function to retrieve the value from the state dictionary.
virtual void write()
Write.
minMaxCondition(const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state)
Constructor.
virtual void reset()
Reset.
Base class for run time conditions.
bool active_
On/off switch.
runTimeCondition(const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state)
Constructor.
stateFunctionObject & state_
State.
virtual const word & name() const
Return the condition name.
Base class for function objects, adding functionality to read/write state information (data required ...
word objectResultType(const word &objectName, const word &entryName) const
Return the type of result.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.