www.mooseframework.org
PercentChangePostprocessor.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
14 template <>
17 {
19  params.addRequiredParam<PostprocessorName>(
20  "postprocessor", "The name of the postprocessor used for exit criterion");
21  return params;
22 }
23 
25  : GeneralPostprocessor(parameters),
26  _postprocessor(getPostprocessorValue("postprocessor")),
27  _postprocessor_old(getPostprocessorValueOld("postprocessor"))
28 {
29  mooseDeprecated("PercentChangePostprocessor is deprecated: instead, ",
30  "please use ChangeOverTimePostprocessor using the parameter ",
31  "'compute_relative_change' set to 'true'");
32 }
33 
34 void
36 {
37 }
38 
39 void
41 {
42 }
43 
44 Real
46 {
47  return std::fabs((std::fabs(_postprocessor) - std::fabs(_postprocessor_old)) *
48  std::pow(std::fabs(_postprocessor), -1));
49 }
PercentChangePostprocessor(const InputParameters &parameters)
const PostprocessorValue & _postprocessor
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< GeneralPostprocessor >()
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
virtual void execute() override
Execute method.
registerMooseObject("MooseApp", PercentChangePostprocessor)
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...
InputParameters validParams< PercentChangePostprocessor >()
Real pow(Real x, int e)
Definition: MathUtils.C:211
virtual Real getValue() override
This will get called to actually grab the final value the postprocessor has calculated.
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:161
const PostprocessorValue & _postprocessor_old
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
This postprocessor displays the change in the postprocessor between adjacent timesteps.