https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AB2PredictorCorrector.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 "TimeStepper.h"
14
15// C++ includes
16#include <fstream>
17
18namespace libMesh
19{
20template <typename T>
21class NumericVector;
22}
23
30{
31public:
33
35
36 virtual void step() override;
37 virtual void preExecute() override;
38 virtual void preSolve() override;
39 virtual void postSolve() override;
40 virtual bool converged() const override;
41
42protected:
43 virtual Real computeDT() override;
44 virtual Real computeInitialDT() override;
45
46 virtual Real estimateTimeError(NumericVector<Number> & sol);
47
48 NumericVector<Number> & _u1;
49 NumericVector<Number> & _aux1;
50 NumericVector<Number> & _pred1;
51
53 Real & _dt_full;
54
56 Real & _error;
58 Real _e_tol;
60 Real _e_max;
68 Real & _my_dt_old;
70 Real & _infnorm;
73 std::ofstream myfile;
74};
A TimeStepper based on the AB2 method.
virtual void preExecute() override
int _steps_between_increase
steps to take before increasing dt
virtual Real computeDT() override
Computes time step size after the initial time step.
virtual void preSolve() override
virtual void step() override
Take a time step.
virtual void postSolve() override
virtual bool converged() const override
If the time step converged.
Real _e_tol
error tolerance
NumericVector< Number > & _pred1
static InputParameters validParams()
Real & _error
global relative time discretization error estimate
Real & _dt_full
dt of the big step
Real _scaling_parameter
scaling_parameter for time step selection, default is 0.8
Real & _infnorm
infinity norm of the solution vector
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
Real _max_increase
maximum increase ratio
virtual Real estimateTimeError(NumericVector< Number > &sol)
NumericVector< Number > & _aux1
NumericVector< Number > & _u1
int & _dt_steps_taken
steps taken at current dt
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Base class for time stepping.
Definition TimeStepper.h:23
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...