17 params.
addParam<std::vector<std::string>>(
18 "disable_objects", std::vector<std::string>(),
"A list of object tags to disable.");
19 params.
addParam<std::vector<std::string>>(
20 "enable_objects", std::vector<std::string>(),
"A list of object tags to enable.");
22 params.
addParam<
bool>(
"reverse_on_false",
24 "When true, the disable/enable lists are set to opposite values when the " 25 "specified condition is false.");
32 _enable(getParam<
std::vector<
std::string>>(
"enable_objects")),
33 _disable(getParam<
std::vector<
std::string>>(
"disable_objects")),
34 _reverse_on_false(getParam<bool>(
"reverse_on_false"))
39 "Either or both of the 'enable_objects' and 'disable_objects' parameters must be set.");
48 setControllableValueByName<bool>(
_enable[i], std::string(
"enable"),
true);
50 setControllableValueByName<bool>(
_enable[i], std::string(
"enable"),
false);
55 setControllableValueByName<bool>(
_disable[i], std::string(
"enable"),
false);
57 setControllableValueByName<bool>(
_disable[i], std::string(
"enable"),
true);
const std::vector< std::string > & _disable
List of objects to disable if condition is met.
ConditionalEnableControl(const InputParameters ¶meters)
static InputParameters validParams()
Class constructor.
virtual void execute() override
Execute the control.
const bool & _reverse_on_false
When true, the disable/enable lists are set to opposite values when the specified condition is false...
virtual bool conditionMet(const unsigned int &i)=0
Condition that must be true for an entry of the "enable" list to be enabled and/or an entry of the "d...
static InputParameters validParams()
const std::vector< std::string > & _enable
List of objects to enable if condition is met.
Base class for Control objects.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.