Time steppers

The following time steppers are implemented in FESolvers.

FESolvers.FixedTimeStepperType
FixedTimeStepper(;num_steps::Int, Δt=1, t_start=0)
FixedTimeStepper(t::Vector)

A time stepper which gives fixed time steps. If the convenience interface is used, constant increments are used. Note that length(t)=num_steps+1 since the first value is just the initial value and is not an actual step.

source
FESolvers.AdaptiveTimeStepperType
AdaptiveTimeStepper(
    Δt_init::T, t_end::T; 
    t_start=zero(T), Δt_min=Δt_init, Δt_max=typemax(T), 
    change_factor=T(0.5), optiter_ratio=T(0.5), k=one(T)) where T

An adaptive time stepper with an initial step Δt_init and total time t_end. Two ways of adaption:

  1. If the previous attempt did not converge, the time

step is reduced as Δt*=change_factor and the step is retried.

  1. If convergence, the next time step depends on how many iterations was

required to converge; numiter. The time step is changed as Δt*=change_factor^(k*m), where m=(numiter-optiter)/(maxiter-optiter). In this expression, maxiter and optiter are the maximum and optimum number of iterations for the nonlinear solver. optiter=floor(maxiter*optiter_ratio) and maxiter is obtained from the nonlinear solver (via get_max_iter(s))

If numiter=maxiter, then m=1 and the time step update is the same as for a non-converged solution if k=1. Note that k>0, change_factor∈[0,1], and optiter_ratio∈[0,1] are expected, otherwise warnings are thrown.

source

Custom time stepper

A time stepper should support the following functions

FESolvers.is_last_stepFunction
is_last_step(timestepper)->Bool

Return true if the current step/time is the last step, return false otherwise

source
FESolvers.step_time!Function
step_time!(solver)
step_time!(timestepper, nlsolver)

Increment the timestepper depending on the convergence status of nlsolver. If not converged and a smaller time step is not possible, throw ConvergenceError.

Note that a call to the first definition is forwarded to the second function definition by decomposing the solver, unless another specialization is defined.

source