implementations.convergence_controller_classes.interpolate_between_restarts module

class InterpolateBetweenRestarts(controller, params, description, **kwargs)[source]

Bases: ConvergenceController

Interpolate the solution and right hand side to the new set of collocation nodes after a restart. The idea is that when you adjust the step size between restarts, you already know what the new quadrature method is going to be and possibly interpolating the current iterate to these results in a better initial guess than spreading the initial conditions or whatever you usually like to do.

post_iteration_processing(controller, step, **kwargs)[source]

Interpolate the solution and right hand sides and store them in the sweeper, where they will be distributed accordingly in the prediction step.

This function is called after every iteration instead of just after the step because we might choose to stop iterating as soon as we have decided to restart. If we let the step continue to iterate, this is not the most efficient implementation and you may choose to write a different convergence controller.

The interpolation is based on Thibaut’s magic.

Parameters:
  • controller (pySDC.Controller) – The controller

  • step (pySDC.Step.step) – The current step

post_spread_processing(controller, step, **kwargs)[source]

Spread the interpolated values to the collocation nodes. This overrides whatever the sweeper uses for prediction.

Parameters:
  • controller (pySDC.Controller.controller) – The controller

  • step (pySDC.Step.step) – The current step

setup(controller, params, description, **kwargs)[source]

Store the initial guess used in the sweeper when no restart has happened

Parameters:
  • controller (pySDC.Controller.controller) – The controller

  • params (dict) – Parameters for the convergence controller

  • description (dict) – The description object used to instantiate the controller

setup_status_variables(controller, **kwargs)[source]

Add variables to the sweeper containing the interpolated solution and right hand side.

Parameters:

controller (pySDC.Controller.controller) – The controller