implementations.sweeper_classes.Multistep module

class AdamsBashforthExplicit1Step(params)[source]

Bases: MultiStep

This is just forward Euler.

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

Bases: MultiStep

Trapezoidal method dressed up as a multistep method.

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

Bases: MultiStep

Third order implicit scheme

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)[source]

Bases: MultiStep

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”.

- u

Contains solution from previous steps

Type:

list

- f

Contains right hand side evaluations from previous steps

Type:

list

- t

Contains time of previous steps

Type:

list

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)[source]

Bases: sweeper

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.

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.