16 #include "libmesh/enum_norm_type.h" 33 "method", method,
"The method used for pseudotimestep timemarching");
36 "alpha",
"alpha > 0",
"The parameter alpha used in the scaling of the timestep");
37 params.
addParam<
Real>(
"max_dt",
"The largest timestep allowed");
40 "For how many iterations should the residual be tracked (only applies to the SER method)");
46 params.
addClassDescription(
"Computes pseudo-time steps for obtaining steady-state solutions " 47 "through a pseudo transient process.");
55 _initial_dt(getParam<
Real>(
"initial_dt")),
56 _alpha(getParam<
Real>(
"alpha")),
57 _bound(isParamValid(
"max_dt")),
58 _max_dt(_bound ? getParam<
Real>(
"max_dt") :
std::numeric_limits<
Real>::
max()),
59 _residual_norms_sequence(declareRestartableData<
std::vector<
Real>>(
"residual_norms_sequence")),
60 _iterations_step_sequence(declareRestartableData<
std::vector<
Real>>(
"iterations_step_sequence"))
63 mooseError(
"This pseudotimestepper can only be used if the steady state is computed via time " 74 mooseError(
"The iterations window can be only provided for the SER method.");
99 res_norm = res_norm +
std::pow(var_res, 2);
113 _console <<
"Current step " << curr_step <<
" and current dt " << step_dt
115 <<
" at time " << curr_time << std::endl;
180 "Vector is improper length.");
182 "Vectors should be same length.");
189 curr_dt =
transient->getDT();
Real currentResidualNorm() const
Computes the norm of the non-time dependent residual.
A MultiMooseEnum object to hold "execute_on" flags.
virtual Real & time() const
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const ExecFlagType & _current_execute_flag
Reference to FEProblemBase.
registerMooseObject("MooseApp", PseudoTimestep)
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Real _max_dt
Upper bound on timestep.
const ExecFlagType EXEC_TIMESTEP_END
void outputPseudoTimestep(Real curr_dt) const
Outputs the status of the residual and timestep at the end of time step.
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
Real timestepRDM() const
implementation of RDM method
const Real _initial_dt
Required parameters for the pseudotimestepper.
virtual void execute() override
Execute method.
Computes a time step size based on pseudo-timestep continuation.
auto max(const L &left, const R &right)
Nonlinear system to be solved.
static InputParameters validParams()
PseudotimeMethod
Enum class containing the different options for selecting the timestep size for pseudo-transient simu...
std::vector< Real > & _iterations_step_sequence
Real calculate_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type, std::set< unsigned int > *skip_dimensions=nullptr) const
std::vector< Real > & _residual_norms_sequence
arrays for storing residual and iterations sequence
Real timestepSER() const
implementation of SER method
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static InputParameters validParams()
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
SystemBase & _sys
Reference to the system object for this user object.
MooseApp & _app
The MOOSE application this is associated with.
unsigned int number() const
Gets the number of this system.
const PseudotimeMethod _method
The timestep selection method.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
virtual int & timeStep() const
unsigned int _iterations_window
Number of iterations over which the residual can be lagged.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
void addDocumentation(const std::string &name, const std::string &doc)
Add an item documentation string.
PseudoTimestep(const InputParameters ¶meters)
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const InputParameters & parameters() const
Get the parameters of the object.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual bool isTransient() const override
unsigned int n_vars() const
Real _dt
Transient pseudotimestep.
bool _bound
Boolean to check if an upper bound was provided.
NumericVector< Number > & getResidualNonTimeVector()
Return a numeric vector that is associated with the nontime tag.
Real timestepEXP() const
implementation of EXP method
auto min(const L &left, const R &right)
virtual Real & dt() const
MooseUnits pow(const MooseUnits &, int)
const ExecFlagType EXEC_INITIAL
virtual libMesh::System & system() override
Get the reference to the libMesh system.