Go to the documentation of this file.
29 params.addClassDescription(
"Copies Sampler data to a SamplerReceiver object.");
30 params.set<MultiMooseEnum>(
"direction") =
"to_multiapp";
31 params.suppressParameter<MultiMooseEnum>(
"direction");
32 params.addParam<std::vector<std::string>>(
34 "A list of parameters (on the sub application) to control "
35 "with the Sampler data. The order of the parameters listed "
36 "here should match the order of the items in the Sampler.");
37 params.addRequiredParam<std::string>(
"to_control",
38 "The name of the 'SamplerReceiver' on the sub application "
39 "to which the Sampler data will be transferred.");
45 _parameter_names(getParam<std::vector<std::string>>(
"parameters")),
46 _receiver_name(getParam<std::string>(
"to_control"))
53 mooseAssert(
_sampler_ptr->getNumberOfLocalRows() == _multi_app->numLocalApps(),
54 "The number of MultiApps and the number of sample rows must be the same.");
57 for (dof_id_type row_index =
_sampler_ptr->getLocalRowBegin();
61 mooseAssert(_multi_app->hasLocalApp(row_index),
62 "The current sample row index is not a valid global MultiApp index.");
102 FEProblemBase & to_problem = _multi_app->appProblemBase(app_index);
103 ExecuteMooseObjectWarehouse<Control> & control_wh = to_problem.getControlWarehouse();
105 mooseError(
"The sub-application (",
107 ") does not contain a Control object with the name '",
112 dynamic_cast<SamplerReceiver *>(control_wh.getActiveObject(
_receiver_name).get());
116 "The sub-application (",
118 ") Control object for the 'to_control' parameter must be of type 'SamplerReceiver'.");
virtual void executeToMultiapp() override
const std::string & _receiver_name
The name of the SamplerReceiver Control object on the sub-application.
dof_id_type _global_index
Current global index for batch execution.
virtual void execute() override
Traditional Transfer callback.
Copy each row from each DenseMatrix to the sub-applications SamplerReceiver object.
void transfer(const std::vector< std::string > &names, const std::vector< Real > &values)
Update the parameter names and associated values.
registerMooseObjectRenamed("StochasticToolsApp", SamplerTransfer, "01/01/2020 00:00", SamplerParameterTransfer)
registerMooseObject("StochasticToolsApp", SamplerParameterTransfer)
A Control object for receiving data from a master application Sampler object.
virtual void initializeToMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
SamplerParameterTransfer(const InputParameters ¶meters)
SamplerReceiver * getReceiver(unsigned int app_index)
Return the SamplerReceiver object and perform error checking.
virtual void finalizeToMultiapp() override
static InputParameters validParams()
const std::vector< std::string > & _parameter_names
Storage for the list of parameters to control.
defineLegacyParams(SamplerParameterTransfer)