https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorOfPostprocessors.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
12
14
17{
19
20 params.addRequiredParam<std::vector<PostprocessorName>>(
21 "postprocessors", "The postprocessors whose values are to be reported");
22 params.addClassDescription("Outputs the values of an arbitrary user-specified set of "
23 "postprocessors as a vector in the order specified by the user");
24
25 // The value from this VPP is naturally already on every processor
26 // TODO: Make this not the case! See #11415
27 params.set<bool>("_auto_broadcast") = false;
28
29 return params;
30}
31
33 : GeneralVectorPostprocessor(parameters),
34 _pp_vec(declareVector(MooseUtils::shortName(parameters.getObjectName())))
35{
36 std::vector<PostprocessorName> pps_names(
37 getParam<std::vector<PostprocessorName>>("postprocessors"));
38 _pp_vec.resize(pps_names.size());
39 for (const auto & pps_name : pps_names)
41}
42
43void
48
49void
51{
52 for (const auto & ppv : _postprocessor_values)
53 _pp_vec.push_back(*ppv);
54}
registerMooseObject("MooseApp", VectorOfPostprocessors)
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition MooseBase.h:406
virtual const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name) const
Retrieve the value of the Postprocessor.
VectorOfPostprocessors is a type of VectorPostprocessor that outputs the values of an arbitrary user-...
virtual void execute() override
Populates the postprocessor vector of values with the supplied postprocessors.
std::vector< const PostprocessorValue * > _postprocessor_values
The vector of PostprocessorValue objects that are used to get the values of the postprocessors.
virtual void initialize() override
Initialize, clears the postprocessor vector.
static InputParameters validParams()
VectorOfPostprocessors(const InputParameters &parameters)
Class constructor.
VectorPostprocessorValue & _pp_vec
The VectorPostprocessorValue object where the results are stored.