36 void Foam::functionObjects::runTimeControls::minMaxCondition::
37 setValue<Foam::scalar>
39 const word& valueType,
40 const word& fieldName,
44 state_.getObjectResult(functionObjectName_, fieldName, value);
52 namespace functionObjects
54 namespace runTimeControls
73 { modeType::mdMin,
"minimum" },
74 { modeType::mdMax,
"maximum" },
88 runTimeCondition(
name, obr,
dict, state),
89 functionObjectName_(
dict.
get<
word>(
"functionObject")),
90 mode_(modeTypeNames_.
get(
"mode",
dict)),
92 value_(
dict.
get<scalar>(
"value"))
100 bool satisfied =
true;
109 const word valueType =
112 if (valueType.empty())
115 <<
"Unable to find entry " << fieldName
117 <<
". Condition will not be applied." 124 setValue<scalar>(valueType, fieldName, v);
125 setValue<vector>(valueType, fieldName, v);
126 setValue<sphericalTensor>(valueType, fieldName, v);
127 setValue<symmTensor>(valueType, fieldName, v);
128 setValue<tensor>(valueType, fieldName, v);
152 << fieldName <<
": value = " << v
153 <<
", threshold value = " <<
value_ 154 <<
", satisfied = " << ok <<
endl;
156 satisfied = satisfied && ok;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
static const Enum< modeType > modeTypeNames_
virtual void reset()
Reset.
const scalar value_
Value to compare.
word objectResultType(const word &objectName, const word &entryName) const
Return the type of result.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
virtual bool apply()
Apply the condition.
Macros for easy insertion into run-time selection tables.
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 expressions::valueTypeCode::INVALID.
const wordList fieldNames_
Field names.
A class for handling words, derived from Foam::string.
defineTypeNameAndDebug(averageCondition, 0)
stateFunctionObject & state_
State.
word functionObjectName_
Name of function object to retrueve data from.
virtual void write()
Write.
addToRunTimeSelectionTable(runTimeCondition, averageCondition, dictionary)
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool active_
On/off switch.
Base class for function objects, adding functionality to read/write state information (data required ...
Registry of regIOobjects.
minMaxCondition(const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state)
Constructor.