39 const word& valueType,
40 const word& fieldName,
44 state_.getObjectResult(functionObjectName_, fieldName, value);
52namespace functionObjects
54namespace runTimeControls
73 { modeType::mdMin,
"minimum" },
74 { modeType::mdMax,
"maximum" },
89 functionObjectName_(
dict.get<
word>(
"functionObject")),
90 mode_(modeTypeNames_.get(
"mode",
dict)),
92 value_(
dict.get<scalar>(
"value"))
100 bool satisfied =
true;
107 for (
const word& fieldName :fieldNames_)
109 const word valueType =
110 state_.objectResultType(functionObjectName_, fieldName);
115 <<
"Unable to find entry " << fieldName
116 <<
" for function object " << functionObjectName_
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);
151 Log <<
" " <<
type() <<
": " << modeTypeNames_[mode_] <<
" "
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,...
virtual bool apply()
Apply the condition.
static const Enum< modeType > modeTypeNames_
virtual void write()
Write.
virtual void reset()
Reset.
Base class for run time conditions.
Base class for function objects, adding functionality to read/write state information (data required ...
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Header files for all the primitive types that Fields are instantiated for.
#define WarningInFunction
Report a warning using Foam::Warning.
void Foam::functionObjects::runTimeControls::minMaxCondition::setValue< Foam::scalar >(const word &valueType, const word &fieldName, scalar &value) const
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 INVALID.