23 "Declare and transfer reporter data from sub-application(s) to main application.");
26 "List of the reporter names (object_name/value_name) to transfer the value from.");
28 "to_reporter",
"Reporter object to reference when declaring reporter values.");
30 params.
addParam<std::string>(
"prefix",
31 "Use the supplied string as the prefix for reporter " 32 "name rather than the transfer name.");
37 "The type of the reporter on the sub-application. This parameter is not typically required, " 38 "but if some processors do not have a sub-app, for instance if the max_procs_per_app " 39 "parameter is used in the MultiApp, then this is required.");
48 _from_reporter_names(getParam<
std::vector<
ReporterName>>(
"from_reporters")),
49 _to_obj_name(getParam<
std::string>(
"to_reporter")),
50 _to_reporter_names(isParamValid(
"prefix")
51 ? getReporterNamesHelper(getParam<
std::string>(
"prefix"),
54 : getReporterNamesHelper(_name, _to_obj_name, _from_reporter_names))
59 "The multi_app parameter is no longer valid for this class, use to_multi_app");
63 "Sibling or to_multiapp transfer have not been implemented for this transfer.");
72 mooseError(
"For a direct reporter clone, all processors must be associated with a " 73 "sub-application. If you know the type of reporter being transferred, please " 74 "consider using the 'reporter_type' parameter for an indirect clone.");
78 mooseError(
"For a direct reporter clone, all processors must be associated with a " 79 "sub-application. If you know the type of reporter being transferred, please " 80 "consider using the 'reporter_type' parameter for an indirect clone.");
83 if (!dynamic_cast<const Reporter *>(&uo))
84 paramError(
"to_reporter",
"This object must be a Reporter object.");
90 for (MooseIndex(n) i = 0; i < n; i++)
91 if (multi_app->hasLocalApp(i))
95 if (multi_app->hasApp())
98 for (MooseIndex(n) i = 0; i < n; i++)
99 if (multi_app->hasLocalApp(i))
104 multi_app->appProblemBase(i),
105 multi_app->problemBase(),
110 multi_app->appProblemBase(i),
111 multi_app->problemBase(),
118 const auto & types = getParam<MultiMooseEnum>(
"reporter_type");
120 paramError(
"reporter_type",
"This parameter must be the same length as 'from_reporters'");
131 if (n > 1 && multi_app->isRootProcessor())
133 resizeReporter(rn, multi_app->problemBase(), multi_app->numLocalApps());
170 TIME_SECTION(
"MultiAppCloneReporterTransfer::execute()", 5,
"Transferring reporters");
void declareVectorClone(const ReporterName &from_reporter, const ReporterName &to_reporter, const FEProblemBase &from_problem, FEProblemBase &to_problem, const ReporterMode &mode)
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
void addReporterTransferMode(const ReporterName &name, const ReporterMode &mode, FEProblemBase &problem)
MooseEnum _current_direction
MultiAppCloneReporterTransfer(const InputParameters ¶meters)
const ReporterMode REPORTER_MODE_ROOT
const std::vector< ReporterName > _to_reporter_names
const std::vector< ReporterName > & _from_reporter_names
registerMooseObject("MooseApp", MultiAppCloneReporterTransfer)
virtual void execute() override
Execute the transfer.
FEProblemBase & _fe_problem
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
static MultiMooseEnum standardTransferTypes()
virtual void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
void resizeReporter(const ReporterName &name, FEProblemBase &problem, dof_id_type n)
const std::string & _to_obj_name
virtual void executeToMultiapp()
void declareClone(const ReporterName &from_reporter, const ReporterName &to_reporter, const FEProblemBase &from_problem, FEProblemBase &to_problem, const ReporterMode &mode)
void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
void transferReporter(const ReporterName &from_reporter, const ReporterName &to_reporter, const FEProblemBase &from_problem, FEProblemBase &to_problem, unsigned int time_index=0)
static InputParameters validParams()
const ReporterMode REPORTER_MODE_DISTRIBUTED
static InputParameters validParams()
const std::shared_ptr< MultiApp > getMultiApp() const
Use this getter to obtain the MultiApp for transfers with a single direction.
Transfer for migrating reporter values between the main and sub-application(s).
Base class for all MultiAppTransfer objects.
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...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
Get the user object by its name.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
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)
static InputParameters validParams()
virtual void executeFromMultiapp()
Base class for user-specific data.
The Reporter system is comprised of objects that can contain any number of data values.