core.Controller module

class controller(controller_params, description, useMPI=None)[source]

Bases: object

Base abstract controller class

add_convergence_controller(convergence_controller, description, params=None, allow_double=False)[source]

Add an individual convergence controller to the list of convergence controllers and instantiate it. Afterwards, the order of the convergence controllers is updated.

Parameters:
  • convergence_controller (pySDC.ConvergenceController) – The convergence controller to be added

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

  • params (dict) – Parameters for the convergence controller

  • allow_double (bool) – Allow adding the same convergence controller multiple times

Returns:

None

add_hook(hook)[source]

Add a hook to the controller which will be called in addition to all other hooks whenever something happens. The hook is only added if a hook of the same class is not already present.

Parameters:

hook (pySDC.Hook) – A hook class that is derived from the core hook class

Returns:

None

dump_setup(step, controller_params, description)[source]

Helper function to dump the setup used for this controller

Parameters:
  • step (pySDC.Step.step) – the step instance (will/should be the first one only)

  • controller_params (dict) – controller parameters

  • description (dict) – description of the problem

get_convergence_controllers_as_table(description)[source]

This function is for debugging purposes to keep track of the different convergence controllers and their order.

Parameters:

description (dict) – Description of the problem

Returns:

Table of convergence controllers as a string

Return type:

str

property hooks

Getter for the hooks

Returns:

hooks

Return type:

pySDC.Hooks.hooks

return_stats()[source]

Return the merged stats from all hooks

Returns:

Merged stats from all hooks

Return type:

dict

run(u0, t0, Tend)[source]

Abstract interface to the run() method

Parameters:
  • u0 – initial values

  • t0 (float) – starting time

  • Tend (float) – ending time

setup_convergence_controllers(description)[source]

Setup variables needed for convergence controllers, notably a list containing all of them and a list containing their order. Also, we add the CheckConvergence convergence controller, which takes care of maximum iteration count or a residual based stopping criterion, as well as all convergence controllers added to the description.

Parameters:

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

Returns:

None

welcome_message()[source]