https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConstantPostprocessor.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
11
13
16{
18 params.addParam<Real>("value", 0, "The value");
19 params.declareControllable("value");
20
21 params.addClassDescription("Postprocessor that holds a constant value");
22 return params;
23}
24
26 : GeneralPostprocessor(params), _value(getParam<Real>("value"))
27{
28 const PostprocessorReporterName r_name(name());
30
31 // Initialize value
32 write_data.setReporterValue<PostprocessorValue>(r_name, _value);
33}
34
35Real
37{
38 return _value;
39}
registerMooseObject("MooseApp", ConstantPostprocessor)
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
A class for storing a constant value.
static InputParameters validParams()
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
const Real & _value
value held by postprocessor
ConstantPostprocessor(const InputParameters &parameters)
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
A ReporterName that represents a Postprocessor.
void setReporterValue(const ReporterName &reporter_name, const T &value, const std::size_t time_index=0)
Method for setting Reporter values that already exist.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.