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.");
78 for (MooseIndex(n) i = 0; i < n; i++)
108 for (MooseIndex(n) i = 0; i < n; i++)
113 const std::string prefix =
isParamValid(
"prefix") ? getParam<std::string>(
"prefix") :
name();
115 for (MooseIndex(n) i = 0; i < n; i++)
125 " is of unsupported type ",
127 ". Contact MOOSE developers on how to transfer this type of reporter value.");
133 prefix + (prefix.empty() ?
"" :
":") +
"converged", *
_sampler_ptr);
138 dof_id_type app_index)
150 (*_converged)[local_index] =
getFromMultiApp()->getExecutioner(app_index)->lastSolveConverged();
const ExecFlagType EXEC_TRANSFER
const ReporterMode REPORTER_MODE_ROOT
registerMooseObject("StochasticToolsApp", SamplerReporterTransfer)
T & getUserObject(const std::string &name, unsigned int tid=0) const
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
bool isParamValid(const std::string &name) const
bool hasToMultiApp() const
const std::shared_ptr< MultiApp > getFromMultiApp() const
bool contains(const std::string &value) const
virtual std::string type() const=0
const ReporterContextBase & getReporterContextBase(const ReporterName &reporter_name) const
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)
void addReporterTransferMode(const ReporterName &name, const ReporterMode &mode, FEProblemBase &problem)
Transfer Reporters from sub-applications to a StochasticReporter on the main application.
virtual void initializeFromMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
StochasticReporter * _results
StochasticReporter object where values are being transferred.
std::vector< bool > * _converged
Reporter value for whether or not sub app converged.
virtual void initialSetup() override
void intitializeStochasticReporters()
Used to declare reporter values on main app and add consumer modes on subapps.
virtual void executeFromMultiapp() override
virtual void execute() override
Traditional Transfer callback.
void transferStochasticReporters(dof_id_type global_index, dof_id_type app_index)
Transfer reporter values.
virtual void finalizeFromMultiapp() override
std::vector< ReporterName > _reporter_names
Storage vector names.
static InputParameters validParams()
const std::vector< ReporterName > & _sub_reporter_names
Name of reporters on the sub-applications.
SamplerReporterTransfer(const InputParameters ¶meters)
dof_id_type getLocalRowEnd() const
dof_id_type getLocalRowBegin() const
const ExecFlagEnum & getExecuteOnEnum() const
virtual ReporterName declareStochasticReporterClone(const Sampler &sampler, const ReporterData &from_data, const ReporterName &from_reporter, std::string prefix="")
std::vector< T > & declareStochasticReporter(std::string value_name, const Sampler &sampler)
virtual void initialize() override final
FEProblemBase & _fe_problem