34 const auto & chain_control_data_map =
38 for (
const auto & item : chain_control_data_map)
39 if (!item.second->getDeclared())
40 mooseError(
"The chain control data '", item.first,
"' was requested but never declared.");
43 auto & control_warehouse =
_problem->getControlWarehouse();
46 for (
auto & control_shared_ptr : control_warehouse.getObjects())
48 auto chain_control =
dynamic_cast<ChainControl *
>(control_shared_ptr.get());
50 chain_control->
init();
58 for (
auto & control_shared_ptr : control_warehouse.getObjects())
60 auto chain_control =
dynamic_cast<ChainControl *
>(control_shared_ptr.get());
65 for (
const auto & data_dep_name : data_dep_names)
68 const auto & data_dep = *chain_control_data_map.at(data_dep_name);
69 const auto control_dep_name = data_dep.getChainControl().name();
72 auto & control_deps = chain_control->getDependencies();
73 if (std::find(control_deps.begin(), control_deps.end(), control_dep_name) ==
75 control_deps.push_back(control_dep_name);
static InputParameters validParams()
registerMooseAction("MooseApp", ChainControlSetupAction, "chain_control_setup")
void copyValuesBack()
Copies current chain control data values into old values.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
static InputParameters validParams()
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
Performs various setup tasks and checks for ChainControls.
virtual void init()
Initialization that occurs in ChainControlSetupAction, right before the dependencies are added...
const std::vector< std::string > & getChainControlDataDependencies() const
Returns the ChainControls that must run before this one.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
ChainControlSetupAction(const InputParameters ¶meters)
const std::map< std::string, std::unique_ptr< ChainControlDataBase > > & getChainControlDataMap() const
Gets the map of ChainControlData names to the relevant ChainControlDataBase.
Control that additionally provides the capability to produce/consume data values, to allow control op...