20 std::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");
76 const 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());
SamplerPostprocessorTransfer(const InputParameters ¶meters)
T & getUserObject(const std::string &name, unsigned int tid=0) const
virtual void execute() override
Traditional Transfer callback.
virtual bool converged(const unsigned int nl_sys_num)
const std::shared_ptr< MultiApp > getFromMultiApp() const
StochasticResults * _results
Storage for StochasticResults object that data will be transferred to/from.
Transfer Postprocessor from sub-applications to a VectorPostprocessor on the master application...
virtual void initializeFromMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
virtual void executeFromMultiapp() override
virtual void finalizeFromMultiapp() override
dof_id_type getLocalRowBegin() const
FEProblemBase & _fe_problem
registerMooseObject("StochasticToolsApp", SamplerPostprocessorTransfer)
const VectorPostprocessorName & _master_vpp_name
Name of vector-postprocessor on the master.
dof_id_type getNumberOfLocalRows() const
std::vector< VectorPostprocessorName > getVectorNamesHelper(const std::string &prefix, const std::vector< PostprocessorName > &pp_names)
static InputParameters validParams()
A tool for output Sampler data.
bool hasPostprocessorValueByName(const PostprocessorName &name) const
const std::vector< PostprocessorName > & _sub_pp_names
Name of postprocessor on the sub-applications.
void setCurrentLocalVectorPostprocessorValue(const std::string &vector_name, const VectorPostprocessorValue &¤t)
void paramError(const std::string ¶m, Args... args) const
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
dof_id_type getLocalRowEnd() const
virtual void initialSetup() override
std::vector< Real > VectorPostprocessorValue
bool hasToMultiApp() const
const std::vector< VectorPostprocessorName > _vpp_names
Storage vector names.
void mooseError(Args &&... args) const
const std::vector< VectorPostprocessorName > & vectorNames() const
The name of the vector to be created on the StochasticResults object, see StochasticResultsAction) ...
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< VectorPostprocessorValue > _current_data
Temporary storage for batch mode execution.