24 "List of the reporter names (object_name/value_name) to transfer the value from.");
27 "List of the reporter names (object_name/value_name) to transfer the value to.");
31 "The MultiApp object sub-application index to use when transferring to/from the " 32 "sub-application. If unset and transferring to the sub-applications then all " 33 "sub-applications will receive data. The value must be set when transferring from a " 36 "distribute_reporter_vector",
38 "Transfer to/from a vector reporter from/to reporters on child applications. N " 39 "to 1 or 1 to N type of transfer. The number of child applications must " 40 "match the size of the vector reporter");
47 _from_reporter_names(getParam<
std::vector<
ReporterName>>(
"from_reporters")),
48 _to_reporter_names(getParam<
std::vector<
ReporterName>>(
"to_reporters")),
49 _subapp_index(getParam<unsigned
int>(
"subapp_index")),
50 _distribute_reporter_vector(getParam<bool>(
"distribute_reporter_vector"))
53 paramError(
"to_reporters",
"from_reporters and to_reporters must be the same size.");
56 paramError(
"direction",
"This transfer only supports a single direction.");
61 "The subapp_index parameter is not supported for transfers between two multiapps");
71 "The supplied sub-application index is greater than the number of sub-applications.");
76 "subapp_index must be provided when more than one subapp is present.");
85 "The supplied sub-application index is greater than the number of sub-applications.");
127 std::vector<unsigned int> indices;
131 std::iota(indices.begin(), indices.end(), 0);
136 for (
const auto & ind : indices)
163 std::vector<unsigned int> indices;
168 std::iota(indices.begin(), indices.end(), 0);
190 for (
const auto ind : indices)
224 TIME_SECTION(
"MultiAppReporterTransfer::execute()", 5,
"Transferring reporters");
238 "Distributing reporter vectors is not implemented with sibling transfers.");
246 mooseError(
"Child application allocation on parallel processes must be the same to support " 247 "siblings reporter transfer");
250 mooseError(
"Number of source and target child apps must match for siblings transfer");
256 const std::shared_ptr<MultiApp> & main_app,
257 const std::vector<ReporterName> & main_app_rep_names,
258 const std::vector<ReporterName> & sub_app_rep_names)
261 for (
const auto & rn : main_app_rep_names)
264 std::vector<unsigned int> indices(main_app->numGlobalApps());
265 std::iota(indices.begin(), indices.end(), 0);
270 for (
const auto & ind : indices)
271 if (main_app->hasLocalApp(ind))
272 for (
const auto & rn : sub_app_rep_names)
void transferFromVectorReporter(const ReporterName &from_reporter, const ReporterName &to_reporter, const FEProblemBase &from_problem, FEProblemBase &to_problem, dof_id_type index, unsigned int time_index=0)
virtual void checkSiblingsTransferSupported() const override
Whether the transfer supports siblings transfer.
void clearVectorReporter(const ReporterName &name, FEProblemBase &problem)
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
void addReporterTransferMode(const ReporterName &name, const ReporterMode &mode, FEProblemBase &problem)
MooseEnum _current_direction
virtual void executeFromMultiapp()
const ReporterMode REPORTER_MODE_ROOT
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
const unsigned int & _subapp_index
If set, indicates a particular subapp to transfer the reporter to/from.
bool hasFromMultiApp() const
Whether the transfer owns a non-null from_multi_app.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const std::vector< ReporterName > & _from_reporter_names
Vector of reporters to transfer data from.
auto max(const L &left, const R &right)
void resizeReporter(const ReporterName &name, FEProblemBase &problem, dof_id_type n)
virtual void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
static InputParameters validParams()
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
MultiAppReporterTransfer(const InputParameters ¶meters)
virtual void executeToMultiapp()
const std::vector< ReporterName > & _to_reporter_names
Vector of reporters to transfer data to.
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)
bool _distribute_reporter_vector
determines transfer type
Transfer for migrating reporter values between the main and sub-application(s).
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 ...
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
virtual void execute() override
Execute the transfer.
static InputParameters validParams()
void setVectorReporterTransferModes(const std::shared_ptr< MultiApp > &main_app, const std::vector< ReporterName > &main_app_rep_names, const std::vector< ReporterName > &sub_app_rep_names)
Sets transfer modes for reporters when distributing.
MultiMooseEnum _directions
The directions this Transfer is to be executed on.
Base class for all MultiAppTransfer objects.
void sumVectorReporter(const ReporterName &name, FEProblemBase &problem)
IntRange< T > make_range(T beg, T end)
bool hasToMultiApp() const
Whether the transfer owns a non-null to_multi_app.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
registerMooseObject("MooseApp", MultiAppReporterTransfer)
const ReporterMode REPORTER_MODE_REPLICATED
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)
processor_id_type processor_id() const
static InputParameters validParams()
void ErrorVector unsigned int
auto index_range(const T &sizable)
The Reporter system is comprised of objects that can contain any number of data values.