https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PercentChangePostprocessor.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.addClassDescription("Computes the percent change of a postprocessor value compared to the "
19 "value at the previous timestep.");
20 params.addRequiredParam<PostprocessorName>(
21 "postprocessor", "The name of the postprocessor used for exit criterion");
22 return params;
23}
24
26 : GeneralPostprocessor(parameters),
27 _postprocessor(getPostprocessorValue("postprocessor")),
28 _postprocessor_old(getPostprocessorValueOld("postprocessor"))
29{
30 mooseDeprecated("PercentChangePostprocessor is deprecated: instead, ",
31 "please use ChangeOverTimePostprocessor using the parameter ",
32 "'compute_relative_change' set to 'true'");
33}
34
35void
39
40void
44
45Real
47{
48 return std::fabs((std::fabs(_postprocessor) - std::fabs(_postprocessor_old)) *
49 std::pow(std::fabs(_postprocessor), -1));
50}
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition MooseError.h:363
registerMooseObject("MooseApp", PercentChangePostprocessor)
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 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.
This postprocessor displays the change in the postprocessor between adjacent timesteps.
const PostprocessorValue & _postprocessor_old
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual void execute() override
Execute method.
static InputParameters validParams()
PercentChangePostprocessor(const InputParameters &parameters)
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const PostprocessorValue & _postprocessor
MooseUnits pow(const MooseUnits &, int)
Definition Units.C:537