27 "StochasticReporter on the main application.");
30 "from_reporter",
"The name(s) of the Reporter(s) on the sub-app to transfer from.");
32 "stochastic_reporter",
"The name of the StochasticReporter object to transfer values to.");
34 params.
addParam<std::string>(
"prefix",
35 "Use the supplied string as the prefix for reporter " 36 "name rather than the transfer name.");
46 _sub_reporter_names(getParam<
std::vector<
ReporterName>>(
"from_reporter"))
49 paramError(
"to_multi_app",
"To and between multiapp directions are not implemented");
59 paramError(
"stochastic_reporter",
"This object must be a 'StochasticReporter' object.");
75 for (MooseIndex(n) i = 0; i < n; i++)
98 for (MooseIndex(n) i = 0; i < n; i++)
103 const std::string prefix =
isParamValid(
"prefix") ? getParam<std::string>(
"prefix") :
name();
105 for (MooseIndex(n) i = 0; i < n; i++)
115 " is of unsupported type ",
117 ". Contact MOOSE developers on how to transfer this type of reporter value.");
123 prefix + (prefix.empty() ?
"" :
":") +
"converged", *
_sampler_ptr);
140 (*_converged)[local_index] =
getFromMultiApp()->getExecutioner(app_index)->lastSolveConverged();
StochasticReporter * _results
StochasticReporter object where values are being transferred.
static InputParameters validParams()
T & getUserObject(const std::string &name, unsigned int tid=0) const
const std::shared_ptr< MultiApp > getFromMultiApp() const
void addReporterTransferMode(const ReporterName &name, const ReporterMode &mode, FEProblemBase &problem)
const ReporterMode REPORTER_MODE_ROOT
virtual std::string type() const=0
virtual ReporterName declareStochasticReporterClone(const Sampler &sampler, const ReporterData &from_data, const ReporterName &from_reporter, std::string prefix="")
const std::vector< ReporterName > & _sub_reporter_names
Name of reporters on the sub-applications.
void intitializeStochasticReporters()
Used to declare reporter values on main app and add consumer modes on subapps.
dof_id_type getLocalRowBegin() const
FEProblemBase & _fe_problem
virtual const std::string & name() const
bool isParamValid(const std::string &name) const
registerMooseObject("StochasticToolsApp", SamplerReporterTransfer)
virtual void initialSetup() override
std::vector< ReporterName > _reporter_names
Storage vector names.
virtual void executeFromMultiapp() override
virtual void finalizeFromMultiapp() override
void transferStochasticReporters(dof_id_type global_index, dof_id_type app_index)
Transfer reporter values.
void paramError(const std::string ¶m, Args... args) const
dof_id_type getLocalRowEnd() const
virtual void initializeFromMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
virtual void execute() override
Traditional Transfer callback.
bool hasToMultiApp() const
std::vector< bool > * _converged
Reporter value for whether or not sub app converged.
void transferToVectorReporter(const ReporterName &from_reporter, const ReporterName &to_reporter, const FEProblemBase &from_problem, FEProblemBase &to_problem, dof_id_type index, unsigned int time_index=0)
std::vector< T > & declareStochasticReporter(std::string value_name, const Sampler &sampler)
Transfer Reporters from sub-applications to a StochasticReporter on the main application.
const ReporterContextBase & getReporterContextBase(const ReporterName &reporter_name) const
SamplerReporterTransfer(const InputParameters ¶meters)