https://mooseframework.inl.gov
PseudoTimestep.h
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 #pragma once
11 
12 // MOOSE includes
13 #include "GeneralPostprocessor.h"
14 
19 {
20 public:
23 
24  virtual void execute() override;
25  virtual void initialize() override;
27  virtual Real getValue() const override;
28 
31  enum class PseudotimeMethod
32  {
33  SER,
34  RDM,
35  EXP
36  };
37 
38 protected:
41 
44  const Real _alpha;
45 
47  unsigned int _iterations_window;
48 
50  bool _bound;
51 
54 
57 
59  std::vector<Real> & _residual_norms_sequence;
60  std::vector<Real> & _iterations_step_sequence;
61 
63  Real currentResidualNorm() const;
64 
66  Real timestepSER() const;
67 
69  Real timestepEXP() const;
70 
72  Real timestepRDM() const;
73 
75  void outputPseudoTimestep(Real curr_dt) const;
76 };
Real currentResidualNorm() const
Computes the norm of the non-time dependent residual.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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.
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.
PseudotimeMethod
Enum class containing the different options for selecting the timestep size for pseudo-transient simu...
std::vector< Real > & _iterations_step_sequence
const Real _alpha
std::vector< Real > & _residual_norms_sequence
arrays for storing residual and iterations sequence
Real timestepSER() const
implementation of SER method
static InputParameters validParams()
const PseudotimeMethod _method
The timestep selection method.
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
virtual PostprocessorValue getValue() const =0
This will get called to actually grab the final value the postprocessor has calculated.
PseudoTimestep(const InputParameters &parameters)
const InputParameters & parameters() const
Get the parameters of the object.
Real _dt
Transient pseudotimestep.
bool _bound
Boolean to check if an upper bound was provided.
Real timestepEXP() const
implementation of EXP method