https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
PostprocessorInterface Class Reference

Interface class for classes which interact with Postprocessors. More...

#include <PostprocessorInterface.h>

Inheritance diagram for PostprocessorInterface:
[legend]

Public Member Functions

 PostprocessorInterface (const MooseObject *moose_object)
 
 PostprocessorInterface (const FEProblemBase *problem)
 
 PostprocessorInterface (const PostprocessorInterface &object, const Moose::Kokkos::FunctorCopy &key)
 Special constructor used for Kokkos functor copy during parallel dispatch. More...
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 Determine whether or not the Postprocessor is a default value. More...
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 Determine if the Postprocessor data exists. More...
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 Determine if the Postprocessor data exists. More...
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 Returns number of Postprocessors coupled under parameter name. More...
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 Get the name of a postprocessor. More...
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 doco-normal-methods-begin Retrieve the value of a Postprocessor or one of it's old or older values More...
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 Retrieve the value of the Postprocessor. More...
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 Helper for deriving classes to override to add dependencies when a Postprocessor is requested. More...
 

Private Member Functions

const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 Internal method for getting the PostprocessorName associated with a paremeter. More...
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 Checks the parameters relating to a Postprocessor. More...
 
bool postprocessorsAdded () const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 Internal methods for getting Postprocessor values. More...
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 

Private Attributes

const MooseObject_ppi_moose_object
 The MooseObject that uses this interface. More...
 
const InputParameters_ppi_params
 PostprocessorInterface Parameters. More...
 
const FEProblemBase_ppi_feproblem
 Reference the the FEProblemBase class. More...
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 Holds the default postprocessor values that are requested (key is PostprocessorName) More...
 

Detailed Description

Interface class for classes which interact with Postprocessors.

Provides the getPostprocessorValueXYZ() and related interfaces.

Definition at line 34 of file PostprocessorInterface.h.

Constructor & Destructor Documentation

◆ PostprocessorInterface() [1/3]

PostprocessorInterface::PostprocessorInterface ( const MooseObject moose_object)

Definition at line 21 of file PostprocessorInterface.C.

22  : _ppi_moose_object(*moose_object),
25 {
26 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.

◆ PostprocessorInterface() [2/3]

PostprocessorInterface::PostprocessorInterface ( const FEProblemBase problem)

Definition at line 28 of file PostprocessorInterface.C.

29  : _ppi_moose_object(*problem),
31  _ppi_feproblem(*problem)
32 {
33 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.

◆ PostprocessorInterface() [3/3]

PostprocessorInterface::PostprocessorInterface ( const PostprocessorInterface object,
const Moose::Kokkos::FunctorCopy key 
)

Special constructor used for Kokkos functor copy during parallel dispatch.

Definition at line 36 of file PostprocessorInterface.C.

39  _ppi_params(object._ppi_params),
41 {
42 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.

Member Function Documentation

◆ addPostprocessorDependencyHelper()

virtual void PostprocessorInterface::addPostprocessorDependencyHelper ( const PostprocessorName &  ) const
inlineprotectedvirtual

Helper for deriving classes to override to add dependencies when a Postprocessor is requested.

Reimplemented in AuxKernelTempl< ComputeValueType >, AuxKernelTempl< RT >, AuxKernelTempl< RealVectorValue >, AuxKernelTempl< Real >, UserObject, and InitialConditionBase.

Definition at line 149 of file PostprocessorInterface.h.

Referenced by getPostprocessorValueByNameInternal().

149 {}

◆ checkParam()

void PostprocessorInterface::checkParam ( const std::string &  param_name,
const unsigned int  index = std::numeric_limits<unsigned int>::max() 
) const
private

Checks the parameters relating to a Postprocessor.

If index is not set, index checking is not performed.

Definition at line 149 of file PostprocessorInterface.C.

Referenced by coupledPostprocessors(), and getPostprocessorNameInternal().

152 {
153  const bool check_index = index != std::numeric_limits<unsigned int>::max();
154 
155  if (!_ppi_params.isParamValid(param_name))
157  "When getting a Postprocessor, failed to get a parameter with the name \"",
158  param_name,
159  "\".",
160  "\n\nKnown parameters:\n",
162 
163  if (_ppi_params.isType<PostprocessorName>(param_name))
164  {
165  if (check_index && index > 0)
166  _ppi_moose_object.paramError(param_name,
167  "A Postprocessor was requested with index ",
168  index,
169  " but a single Postprocessor is coupled.");
170  }
171  else if (_ppi_params.isType<std::vector<PostprocessorName>>(param_name))
172  {
173  const auto & names = _ppi_params.get<std::vector<PostprocessorName>>(param_name);
174  if (check_index && names.size() <= index)
175  _ppi_moose_object.paramError(param_name,
176  "A Postprocessor was requested with index ",
177  index,
178  " but only ",
179  names.size(),
180  " Postprocessors are coupled.");
181  }
182  else
183  {
185  "Supplied parameter with name \"",
186  param_name,
187  "\" of type \"",
188  _ppi_params.type(param_name),
189  "\" is not an expected type for getting a Postprocessor.\n\n",
190  "Allowed types are \"PostprocessorName\" and \"std::vector<PostprocessorName>\".");
191  }
192 }
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:439
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
auto max(const L &left, const R &right)
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
bool isType(const std::string &name) const
std::string type(const std::string &name) const
Prints the type of the requested parameter by name.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:271
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledPostprocessors()

std::size_t PostprocessorInterface::coupledPostprocessors ( const std::string &  param_name) const

Returns number of Postprocessors coupled under parameter name.

Parameters
param_nameThe name of the Postprocessor parameter
Returns
Number of coupled post-processors, 1 if it's a single

Definition at line 139 of file PostprocessorInterface.C.

Referenced by FunctionValuePostprocessor::FunctionValuePostprocessor().

140 {
141  checkParam(param_name);
142 
143  if (_ppi_params.isType<PostprocessorName>(param_name))
144  return 1;
145  return _ppi_params.get<std::vector<PostprocessorName>>(param_name).size();
146 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
void checkParam(const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
Checks the parameters relating to a Postprocessor.
bool isType(const std::string &name) const
const InputParameters & _ppi_params
PostprocessorInterface Parameters.

◆ getDefaultPostprocessorValueByName()

PostprocessorValue PostprocessorInterface::getDefaultPostprocessorValueByName ( const PostprocessorName &  name) const
private
Returns
The default value stored in the PostprocessorName name.

Definition at line 106 of file PostprocessorInterface.C.

Referenced by getPostprocessorValueInternal().

107 {
108  mooseAssert(isDefaultPostprocessorValueByName(name), "Not a default value");
109 
110  Real real_value = -std::numeric_limits<Real>::max();
111  std::istringstream ss(name);
112  ss >> real_value;
113  return real_value;
114 }
bool isDefaultPostprocessorValueByName(const PostprocessorName &name) const
auto max(const L &left, const R &right)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ getPostprocessorName()

const PostprocessorName & PostprocessorInterface::getPostprocessorName ( const std::string &  param_name,
const unsigned int  index = 0 
) const

Get the name of a postprocessor.

This can only be used if the postprocessor parameter does not have a default value set (see isDefaultPostprocessorValue()), in which case the "name" is actually the default value.

Parameters
param_nameThe name of the Postprocessor parameter
indexThe index of the Postprocessor
Returns
The name of the given Postprocessor

Definition at line 195 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel().

197 {
198  return getPostprocessorNameInternal(param_name, index, /* allow_default_value = */ false);
199 }
const PostprocessorName & getPostprocessorNameInternal(const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
Internal method for getting the PostprocessorName associated with a paremeter.

◆ getPostprocessorNameInternal()

const PostprocessorName & PostprocessorInterface::getPostprocessorNameInternal ( const std::string &  param_name,
const unsigned int  index,
const bool  allow_default_value = true 
) const
private

Internal method for getting the PostprocessorName associated with a paremeter.

Needed in order to allow the return of a name that is a default value.

Definition at line 202 of file PostprocessorInterface.C.

Referenced by getPostprocessorName(), getPostprocessorValueInternal(), hasPostprocessor(), and isDefaultPostprocessorValue().

206 {
207  checkParam(param_name, index);
208 
209  const auto & name = _ppi_params.isType<PostprocessorName>(param_name)
210  ? _ppi_params.get<PostprocessorName>(param_name)
211  : _ppi_params.get<std::vector<PostprocessorName>>(param_name)[index];
212 
213  if (!allow_default_value && isDefaultPostprocessorValueByName(name))
214  {
215  std::stringstream oss;
216  oss << "Cannot get the name associated with PostprocessorName parameter \"" << param_name
217  << "\"";
218  if (index)
219  oss << " at index " << index;
220  oss << ",\nbecause said parameter is a default Postprocessor value.";
221  _ppi_moose_object.paramError(param_name, oss.str());
222  }
223 
224  return name;
225 }
std::string name(const ElemQuality q)
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:439
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
bool isDefaultPostprocessorValueByName(const PostprocessorName &name) const
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
void checkParam(const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
Checks the parameters relating to a Postprocessor.
bool isType(const std::string &name) const
const InputParameters & _ppi_params
PostprocessorInterface Parameters.

◆ getPostprocessorValue()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValue ( const std::string &  param_name,
const unsigned int  index = 0 
) const

doco-normal-methods-begin Retrieve the value of a Postprocessor or one of it's old or older values

Parameters
param_nameThe name of the Postprocessor parameter (see below)
indexThe index of the Postprocessor
Returns
A reference to the desired value

The name required by this method is the name that is hard-coded into your source code. For example, if you have a Kernel that requires a Postprocessor you may have an input file with "pp = my_pp", this function requires the "pp" name as input (see .../moose_test/functions/PostprocessorFunction.C)

see getPostprocessorValueByName getPostprocessorValueOldByName getPostprocessorValueOlderByName

Definition at line 46 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel(), FunctionValuePostprocessor::FunctionValuePostprocessor(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), and ParsedPostprocessor::ParsedPostprocessor().

48 {
49  return getPostprocessorValueInternal(param_name, index, /* t_index = */ 0);
50 }
const PostprocessorValue & getPostprocessorValueInternal(const std::string &param_name, unsigned int index, std::size_t t_index) const
Internal methods for getting Postprocessor values.

◆ getPostprocessorValueByName()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueByName ( const PostprocessorName &  name) const
virtual

Retrieve the value of the Postprocessor.

Parameters
namePostprocessor name (see below)
Returns
A reference to the desired value

The name required by this method is the name defined in the input file. For example, if you have a Kernel that requires a Postprocessor you may have an input file with "pp = my_pp", this method requires the "my_pp" name as input (see .../moose_test/functions/PostprocessorFunction.C)

see getPostprocessorValue getPostprocessorValueOld getPostprocessorValueOlder

Definition at line 67 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel(), PIDTransientControl::execute(), IterationAdaptiveDT::IterationAdaptiveDT(), LibtorchNeuralNetControl::LibtorchNeuralNetControl(), ParsedODEKernel::ParsedODEKernel(), SecantSolve::savePostprocessorValues(), SteffensenSolve::savePostprocessorValues(), PicardSolve::savePostprocessorValues(), WebServerControl::startServer(), Terminator::Terminator(), SecantSolve::transformPostprocessors(), SteffensenSolve::transformPostprocessors(), PicardSolve::transformPostprocessors(), and VectorOfPostprocessors::VectorOfPostprocessors().

68 {
69  return getPostprocessorValueByNameInternal(name, /* t_index = */ 0);
70 }
const PostprocessorValue & getPostprocessorValueByNameInternal(const PostprocessorName &name, std::size_t t_index) const

◆ getPostprocessorValueByNameInternal()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueByNameInternal ( const PostprocessorName &  name,
std::size_t  t_index 
) const
private

Definition at line 256 of file PostprocessorInterface.C.

Referenced by getPostprocessorValueByName(), getPostprocessorValueInternal(), getPostprocessorValueOldByName(), and getPostprocessorValueOlderByName().

258 {
259  mooseAssert(t_index < 3, "Invalid time index");
260  mooseAssert(!isDefaultPostprocessorValueByName(name), "Should not be default");
261 
262  // If all pps have been added, we can check for existance
264  _ppi_moose_object.mooseError("A Postprocessor with the name \"", name, "\" was not found.");
265 
266  if (t_index == 0)
268 
271 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
const ReporterMode REPORTER_MODE_ROOT
bool isDefaultPostprocessorValueByName(const PostprocessorName &name) const
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
const T & getReporterValue(const ReporterName &reporter_name, const MooseObject &consumer, const ReporterMode &mode, const std::size_t time_index=0) const
Method for returning read only references to Reporter values.
Definition: ReporterData.h:388
bool hasPostprocessorByName(const PostprocessorName &name) const
Determine if the Postprocessor data exists.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:202
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
A ReporterName that represents a Postprocessor.
Definition: ReporterName.h:143
virtual void addPostprocessorDependencyHelper(const PostprocessorName &) const
Helper for deriving classes to override to add dependencies when a Postprocessor is requested...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:271

◆ getPostprocessorValueInternal()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueInternal ( const std::string &  param_name,
unsigned int  index,
std::size_t  t_index 
) const
private

Internal methods for getting Postprocessor values.

Definition at line 228 of file PostprocessorInterface.C.

Referenced by getPostprocessorValue(), getPostprocessorValueOld(), and getPostprocessorValueOlder().

231 {
232  const auto & name = getPostprocessorNameInternal(param_name, index);
233 
234  // If the Postprocessor is a default value (either set by addParam or set to a constant
235  // value by the user in input/an action), we covert the name to a value, store said
236  // value locally, and return it so that it fits in with the rest of the interface
237  // (needing a reference to a value)
239  {
240  const auto value = getDefaultPostprocessorValueByName(name);
241  const auto & value_ref =
242  *_default_values.emplace(name, std::make_unique<PostprocessorValue>(value))
243  .first->second; // first is inserted pair, second is value in pair
244  mooseAssert(value == value_ref, "Inconsistent default value");
245  return value_ref;
246  }
247  // If not a default and all pps have been added, we check check for existance
248  else if (postprocessorsAdded() && !hasPostprocessorByName(name))
250  param_name, "A Postprocessor with the name \"", name, "\" was not found.");
251 
252  return getPostprocessorValueByNameInternal(name, t_index);
253 }
std::string name(const ElemQuality q)
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:439
bool isDefaultPostprocessorValueByName(const PostprocessorName &name) const
PostprocessorValue getDefaultPostprocessorValueByName(const PostprocessorName &name) const
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const PostprocessorName & getPostprocessorNameInternal(const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
Internal method for getting the PostprocessorName associated with a paremeter.
bool hasPostprocessorByName(const PostprocessorName &name) const
Determine if the Postprocessor data exists.
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
const PostprocessorValue & getPostprocessorValueByNameInternal(const PostprocessorName &name, std::size_t t_index) const
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
Holds the default postprocessor values that are requested (key is PostprocessorName) ...

◆ getPostprocessorValueOld()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOld ( const std::string &  param_name,
const unsigned int  index = 0 
) const

Definition at line 53 of file PostprocessorInterface.C.

55 {
56  return getPostprocessorValueInternal(param_name, index, /* t_index = */ 1);
57 }
const PostprocessorValue & getPostprocessorValueInternal(const std::string &param_name, unsigned int index, std::size_t t_index) const
Internal methods for getting Postprocessor values.

◆ getPostprocessorValueOldByName()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOldByName ( const PostprocessorName &  name) const

Definition at line 73 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel().

74 {
75  return getPostprocessorValueByNameInternal(name, /* t_index = */ 1);
76 }
const PostprocessorValue & getPostprocessorValueByNameInternal(const PostprocessorName &name, std::size_t t_index) const

◆ getPostprocessorValueOlder()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOlder ( const std::string &  param_name,
const unsigned int  index = 0 
) const

Definition at line 60 of file PostprocessorInterface.C.

62 {
63  return getPostprocessorValueInternal(param_name, index, /* t_index = */ 2);
64 }
const PostprocessorValue & getPostprocessorValueInternal(const std::string &param_name, unsigned int index, std::size_t t_index) const
Internal methods for getting Postprocessor values.

◆ getPostprocessorValueOlderByName()

const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOlderByName ( const PostprocessorName &  name) const

Definition at line 79 of file PostprocessorInterface.C.

80 {
81  return getPostprocessorValueByNameInternal(name, /* t_index = */ 2);
82 }
const PostprocessorValue & getPostprocessorValueByNameInternal(const PostprocessorName &name, std::size_t t_index) const

◆ hasPostprocessor()

bool PostprocessorInterface::hasPostprocessor ( const std::string &  param_name,
const unsigned int  index = 0 
) const

Determine if the Postprocessor data exists.

Parameters
param_nameThe name of the Postprocessor parameter
indexThe index of the Postprocessor
Returns
True if the Postprocessor exists
See also
hasPostprocessorByName getPostprocessorValue

Definition at line 117 of file PostprocessorInterface.C.

119 {
120  if (!postprocessorsAdded())
122  "Cannot call hasPostprocessor() until all Postprocessors have been constructed.");
123 
124  return hasPostprocessorByName(getPostprocessorNameInternal(param_name, index));
125 }
const PostprocessorName & getPostprocessorNameInternal(const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
Internal method for getting the PostprocessorName associated with a paremeter.
bool hasPostprocessorByName(const PostprocessorName &name) const
Determine if the Postprocessor data exists.
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:271

◆ hasPostprocessorByName()

bool PostprocessorInterface::hasPostprocessorByName ( const PostprocessorName &  name) const

Determine if the Postprocessor data exists.

Parameters
nameThe name of the Postprocessor
Returns
True if the Postprocessor exists
See also
hasPostprocessor getPostprocessorValueByName

Definition at line 128 of file PostprocessorInterface.C.

Referenced by getPostprocessorValueByNameInternal(), getPostprocessorValueInternal(), hasPostprocessor(), AdvancedOutput::initShowHideLists(), TableOutput::outputReporters(), Exodus::outputReporters(), and WebServerControl::startServer().

129 {
130  if (!postprocessorsAdded())
132  "Cannot call hasPostprocessorByName() until all Postprocessors have been constructed.");
133 
136 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:202
const MooseObject & _ppi_moose_object
The MooseObject that uses this interface.
A ReporterName that represents a Postprocessor.
Definition: ReporterName.h:143
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:271
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
Definition: ReporterData.h:445

◆ isDefaultPostprocessorValue()

bool PostprocessorInterface::isDefaultPostprocessorValue ( const std::string &  param_name,
const unsigned int  index = 0 
) const

Determine whether or not the Postprocessor is a default value.

A default value is when the value is either the value set by addParam, or is a user-set value in input instead of a name to a postprocessor.

Parameters
param_nameThe name of the Postprocessor parameter
indexThe index of the postprocessor
Returns
True if the Postprocessor is a default value, false if the Postprocessor is the name of a Postprocessor

Definition at line 85 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel().

87 {
89 }
bool isDefaultPostprocessorValueByName(const PostprocessorName &name) const
const PostprocessorName & getPostprocessorNameInternal(const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
Internal method for getting the PostprocessorName associated with a paremeter.

◆ isDefaultPostprocessorValueByName()

bool PostprocessorInterface::isDefaultPostprocessorValueByName ( const PostprocessorName &  name) const
private
Returns
True if the PostprocessorName name repesents a default value: the name converts to a value (set by addParam or set via input), and a Postprocessor does not exist with the same name (we do allow Postprocessors with numbered names...)

Definition at line 92 of file PostprocessorInterface.C.

Referenced by getDefaultPostprocessorValueByName(), getPostprocessorNameInternal(), getPostprocessorValueByNameInternal(), getPostprocessorValueInternal(), and isDefaultPostprocessorValue().

93 {
94  // We do allow actual Postprocessor objects to have names that will succeed in being
95  // represented as a double... so if the name does actually exist as a PP, it's not a default
98  return false;
99 
100  std::istringstream ss(name);
101  Real real_value = -std::numeric_limits<Real>::max();
102  return (ss >> real_value && ss.eof());
103 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
auto max(const L &left, const R &right)
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:202
A ReporterName that represents a Postprocessor.
Definition: ReporterName.h:143
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
Definition: ReporterData.h:445

◆ postprocessorsAdded()

bool PostprocessorInterface::postprocessorsAdded ( ) const
private
Returns
True if all pps have been added (the task associated with adding them is complete)

Definition at line 274 of file PostprocessorInterface.C.

Referenced by getPostprocessorValueByNameInternal(), getPostprocessorValueInternal(), hasPostprocessor(), and hasPostprocessorByName().

275 {
276  return _ppi_feproblem.getMooseApp().actionWarehouse().isTaskComplete("add_postprocessor");
277 }
const FEProblemBase & _ppi_feproblem
Reference the the FEProblemBase class.
bool isTaskComplete(const std::string &task) const
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:87
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
Definition: MooseApp.h:211

◆ validParams()

InputParameters PostprocessorInterface::validParams ( )
static

Definition at line 16 of file PostprocessorInterface.C.

Referenced by Convergence::validParams(), and FVInterfaceKernel::validParams().

17 {
18  return emptyInputParameters();
19 }
InputParameters emptyInputParameters()

Member Data Documentation

◆ _default_values

std::map<PostprocessorName, std::unique_ptr<PostprocessorValue> > PostprocessorInterface::_default_values
mutableprivate

Holds the default postprocessor values that are requested (key is PostprocessorName)

Definition at line 162 of file PostprocessorInterface.h.

Referenced by getPostprocessorValueInternal().

◆ _ppi_feproblem

const FEProblemBase& PostprocessorInterface::_ppi_feproblem
private

◆ _ppi_moose_object

const MooseObject& PostprocessorInterface::_ppi_moose_object
private

◆ _ppi_params

const InputParameters& PostprocessorInterface::_ppi_params
private

The documentation for this class was generated from the following files: