Multistep#

class AdamsBashforthExplicit1Step(params, level)[source]#

Bases: MultiStep

One-step Adams-Bashforth method, which is just forward Euler.

alpha = [-1.0]#
beta = [1.0, 0.0]#
class AdamsMoultonImplicit1Step(params, level)[source]#

Bases: MultiStep

Trapezoidal method dressed up as a multistep method.

alpha = [-1.0]#
beta = [0.5, 0.5]#
class AdamsMoultonImplicit2Step(params, level)[source]#

Bases: MultiStep

Third-order implicit two-step Adams-Moulton method, started with a trapezoidal rule step.

alpha = [0.0, -1.0]#
beta = [-0.08333333333333333, 0.6666666666666666, 0.4166666666666667]#
generate_starting_values()[source]#

Generate starting value by trapezoidal rule.

class BackwardEuler(params, level)[source]#

Bases: MultiStep

Backward Euler written as a one-step implicit multistep method. Almost as old, impressive and beloved as Koelner Dom.

alpha = [-1.0]#
beta = [0.0, 1.0]#
class Cache(num_steps)[source]#

Bases: object

Class for managing solutions and right hand side evaluations of previous steps for the MultiStep “sweeper”.

Variables:
  • u (-) – Contains solution from previous steps

  • f (-) – Contains right hand side evaluations from previous steps

  • t (-) – Contains time of previous steps

update(t, u, f)[source]#

Add a new value to the cache and remove the oldest one.

Parameters:
  • t (float) – Time of new step

  • u (dtype_u) – Solution of new step

  • f (dtype_f) – Right hand side evaluation at new step

class MultiStep(params, level)[source]#

Bases: Sweeper

Base class for linear multistep methods, given by alpha and beta coefficients and a cache of previous steps.

alpha = None#
beta = None#
compute_end_point()[source]#

The solution is stored in the single node that we have.

compute_residual(stage=None)[source]#

Do nothing.

Parameters:

stage (str) – The current stage of the step the level belongs to

generate_starting_values()[source]#

Compute solutions to the steps when not enough previous values are available for the multistep method. The initial conditions are added in predict since this is not bespoke behaviour to any method.

property level[source]#

Returns the current level

Returns:

pySDC.Level.level – Current level

predict()[source]#

Add the initial conditions to the cache if needed.

Default prediction for the sweepers, only copies the values to all collocation nodes and evaluates the RHS of the ODE there

update_nodes()[source]#

Compute the solution to the current step. If the cache is not filled, we compute a provisional solution with a different method.