20std::vector<VectorPostprocessorName>
23 std::vector<VectorPostprocessorName> vec_names;
24 vec_names.reserve(pp_names.size());
25 for (
const auto & pp_name : pp_names)
28 vec_names.push_back(prefix +
":" + pp_name);
30 vec_names.push_back(pp_name);
39 params.
addClassDescription(
"Transfers data from Postprocessors on the sub-application to a "
40 "VectorPostprocessor on the master application.");
42 params.
addParam<std::vector<PostprocessorName>>(
43 "from_postprocessor",
"The name(s) of the Postprocessor(s) on the sub-app to transfer from.");
44 params.
addParam<VectorPostprocessorName>(
"to_vector_postprocessor",
45 "The name of the VectorPostprocessor in "
46 "the MultiApp to transfer values "
49 params.
addParam<std::string>(
"prefix",
50 "Use the supplied string as the prefix for vector postprocessor "
51 "name rather than the transfer name.");
53 params.
addParam<
bool>(
"keep_solve_fail_value",
55 "If true, whatever the value the sub app has upon exitting is used. "
56 "If false, NaN will be transferred.");
65 _sub_pp_names(getParam<
std::vector<PostprocessorName>>(
"from_postprocessor")),
66 _master_vpp_name(getParam<VectorPostprocessorName>(
"to_vector_postprocessor")),
67 _vpp_names(isParamValid(
"prefix")
70 _keep_diverge(getParam<bool>(
"keep_solve_fail_value"))
73 paramError(
"to_multi_app",
"To and between multiapp directions are not implemented");
76const std::vector<VectorPostprocessorName> &
89 mooseError(
"The 'results' object must be a 'StochasticResults' object.");
93 for (MooseIndex(n) i = 0; i < n; i++)
102 "' on sub-application '",
128 for (MooseIndex(n) i = 0; i < n; i++)
139 _current_data[j].emplace_back(std::numeric_limits<double>::quiet_NaN());
168 current.emplace_back(std::numeric_limits<double>::quiet_NaN());
std::vector< Real > VectorPostprocessorValue
std::vector< VectorPostprocessorName > getVectorNamesHelper(const std::string &prefix, const std::vector< PostprocessorName > &pp_names)
registerMooseObject("StochasticToolsApp", SamplerPostprocessorTransfer)
T & getUserObject(const std::string &name, unsigned int tid=0) const
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
bool hasPostprocessorValueByName(const PostprocessorName &name) const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
bool hasToMultiApp() const
const std::shared_ptr< MultiApp > getFromMultiApp() const
Transfer Postprocessor from sub-applications to a VectorPostprocessor on the master application.
SamplerPostprocessorTransfer(const InputParameters ¶meters)
std::vector< VectorPostprocessorValue > _current_data
Temporary storage for batch mode execution.
virtual void initialSetup() override
virtual void execute() override
Traditional Transfer callback.
static InputParameters validParams()
virtual void initializeFromMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
StochasticResults * _results
Storage for StochasticResults object that data will be transferred to/from.
const std::vector< VectorPostprocessorName > & vectorNames() const
The name of the vector to be created on the StochasticResults object, see StochasticResultsAction)
const VectorPostprocessorName & _master_vpp_name
Name of vector-postprocessor on the master.
virtual void finalizeFromMultiapp() override
const std::vector< PostprocessorName > & _sub_pp_names
Name of postprocessor on the sub-applications.
virtual void executeFromMultiapp() override
const std::vector< VectorPostprocessorName > _vpp_names
Storage vector names.
dof_id_type getNumberOfLocalRows() const
dof_id_type getLocalRowEnd() const
dof_id_type getLocalRowBegin() const
A tool for output Sampler data.
void setCurrentLocalVectorPostprocessorValue(const std::string &vector_name, const VectorPostprocessorValue &¤t)
virtual bool converged(const unsigned int sys_num)
FEProblemBase & _fe_problem