https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PostprocessorDT.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
10#include "PostprocessorDT.h"
11
13
16{
18 params.addClassDescription("Computes timestep based on a Postprocessor value.");
19 params.addRequiredParam<PostprocessorName>("postprocessor",
20 "The name of the postprocessor that computes the dt");
21 params.addParam<Real>("dt", "Initial value of dt");
22 params.addParam<Real>("scale", 1, "Multiple scale and supplied postprocessor value.");
23 params.addParam<Real>("offset", 0, "Add an offset to the supplied postprocessor value.");
24 params.addDeprecatedParam<Real>("factor",
25 "Add an offset to the supplied postprocessor value",
26 "offset has replaced factor for that same purpose");
27 return params;
28}
29
31 : TimeStepper(parameters),
33 _pps_value(getPostprocessorValue("postprocessor")),
34 _has_initial_dt(isParamValid("dt")),
35 _initial_dt(_has_initial_dt ? getParam<Real>("dt") : 0.),
36 _scale(getParam<Real>("scale")),
37 _offset(isParamValid("offset") ? getParam<Real>("offset") : getParam<Real>("factor"))
38{
39}
40
41Real
43{
45 return _initial_dt;
46 else
47 return computeDT();
48}
49
50Real
registerMooseObject("MooseApp", PostprocessorDT)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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 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 addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
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.
Computes the value of dt based on a postprocessor value.
const Real & _scale
Multiplier applied to the postprocessor value.
PostprocessorDT(const InputParameters &parameters)
static InputParameters validParams()
const PostprocessorValue & _pps_value
virtual Real computeDT() override
Computes time step size after the initial time step.
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
const Real & _offset
Offset added to the postprocessor value.
Interface class for classes which interact with Postprocessors.
Base class for time stepping.
Definition TimeStepper.h:23
static InputParameters validParams()
Definition TimeStepper.C:16