34 const auto & chain_control_data_map =
38 for (
const auto & item : chain_control_data_map)
39 if (!item.second->getDeclared())
42 "' was requested but never declared.\nChain control data:\n",
46 auto & control_warehouse =
_problem->getControlWarehouse();
49 for (
auto & control_shared_ptr : control_warehouse.getObjects())
51 auto chain_control =
dynamic_cast<ChainControl *
>(control_shared_ptr.get());
53 chain_control->
init();
61 for (
auto & control_shared_ptr : control_warehouse.getObjects())
63 auto chain_control =
dynamic_cast<ChainControl *
>(control_shared_ptr.get());
68 for (
const auto & data_dep_name : data_dep_names)
71 const auto & data_dep = *chain_control_data_map.at(data_dep_name);
72 const auto control_dep_name = data_dep.getChainControl().name();
75 auto & control_deps = chain_control->getDependencies();
76 if (std::find(control_deps.begin(), control_deps.end(), control_dep_name) ==
78 control_deps.push_back(control_dep_name);
registerMooseAction("MooseApp", ChainControlSetupAction, "chain_control_setup")
static InputParameters validParams()
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
const std::map< std::string, std::unique_ptr< ChainControlDataBase > > & getChainControlDataMap() const
Gets the map of ChainControlData names to the relevant ChainControlDataBase.
void copyValuesBack()
Copies current chain control data values into old values.
std::string outputChainControlMap() const
Output the chain control map to a string.
Performs various setup tasks and checks for ChainControls.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
static InputParameters validParams()
ChainControlSetupAction(const InputParameters ¶meters)
Control that additionally provides the capability to produce/consume data values, to allow control op...
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.
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.