22 "vectorpostprocessors",
"The vectorpostprocessors whose vector values are to be combined");
23 params.
addParam<std::vector<std::vector<std::string>>>(
24 "vectors",
"Vectors to combine from each vectorpostprocessor");
25 params.
addParam<Real>(
"vector_filler_value",
27 "Which value to use to fill the smaller vectors (any smaller than the "
28 "largest vector) if the vectors are not the same size");
30 "Outputs the values of an arbitrary user-specified set of "
31 "vectorpostprocessors as a combined vector in the order specified by the user");
35 params.
set<
bool>(
"_auto_broadcast") =
false;
44 const auto & vpps_names = getParam<std::vector<VectorPostprocessorName>>(
"vectorpostprocessors");
45 std::vector<std::vector<std::string>> vpp_vectors(vpps_names.size());
48 for (
const auto i : index_range(vpps_names))
50 const auto & vpp_name = vpps_names[i];
52 for (
const auto & vec_name : vpp.getVectorNames())
53 vpp_vectors[i].push_back(vec_name);
57 vpp_vectors = getParam<std::vector<std::vector<std::string>>>(
"vectors");
58 if (vpp_vectors.size() != vpps_names.size())
61 "Outer vector size should be the same size as the 'vectorpostprocessors' parameter");
65 for (
const auto i : index_range(vpp_vectors))
66 for (
const auto j : index_range(vpp_vectors[i]))
67 _vpp_vecs.push_back(&this->declareVector(vpps_names[i] +
"_" + vpp_vectors[i][j]));
70 for (
const auto i : index_range(vpps_names))
71 for (
const auto & vec_name : vpp_vectors[i])
87 std::size_t max_size = 0;
registerMooseObject("MooseApp", CombinedVectorPostprocessor)
CombinedVectorPostprocessor is a type of VectorPostprocessor that outputs the values of multiple vect...
std::vector< VectorPostprocessorValue * > _vpp_vecs
The VectorPostprocessorValue object where the results are stored.
CombinedVectorPostprocessor(const InputParameters ¶meters)
Class constructor.
std::vector< const VectorPostprocessorValue * > _vectorpostprocessor_values
The vector of VectorPostprocessorValue objects that are used to get the values of the vectorpostproce...
static InputParameters validParams()
const Real _filler_value
A filler value to place on vectors that are smaller than the longest vector.
virtual void execute() override
Populates the postprocessor vector of values with the supplied vectorpostprocessors.
virtual void initialize() override
Initialize, clears the postprocessor vector.
const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string &object_name, const THREAD_ID tid=0) const
Return the VPP object given the name.
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
static InputParameters validParams()
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 isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const VectorPostprocessorValue & getVectorPostprocessorValueByName(const VectorPostprocessorName &name, const std::string &vector_name) const
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
FEProblemBase & _vpp_fe_problem
The FEProblemBase.