Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
VectorPostprocessorComponent.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<VectorPostprocessorName>(
21  "vectorpostprocessor", "The vectorpostprocessor from which a value is extracted");
22  params.addRequiredParam<std::string>("vector_name",
23  "Name of the vector for which to report a value");
24  params.addRequiredParam<unsigned int>(
25  "index", "Index of the vectorpostprocessor for which to report a value");
26  params.addClassDescription(
27  "Returns the value of the specified component of a VectorPostprocessor");
28 
29  return params;
30 }
31 
33  : GeneralPostprocessor(parameters),
34  _vpp_name(getParam<VectorPostprocessorName>("vectorpostprocessor")),
35  _vector_name(getParam<std::string>("vector_name")),
36  _vpp_values(getVectorPostprocessorValue("vectorpostprocessor", _vector_name)),
37  _vpp_index(getParam<unsigned int>("index"))
38 {
39 }
40 
41 Real
43 {
44  if (_vpp_index >= _vpp_values.size())
45  mooseError("In VectorPostprocessorComponent index greater than size of vector");
46  return _vpp_values[_vpp_index];
47 }
registerMooseObject("MooseApp", VectorPostprocessorComponent)
const unsigned int _vpp_index
Index of the component in the vector to read a value from.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
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...
static InputParameters validParams()
const VectorPostprocessorValue & _vpp_values
VectorPostprocessorValue object to read a specified component from.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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...
VectorPostprocessorComponent(const InputParameters &parameters)
void ErrorVector unsigned int