core.controller module

class Controller(controller_params: Dict[str, Any], description: Dict[str, Any], useMPI: bool | None = None)[source]

Bases: object

Base abstract controller class

add_convergence_controller(convergence_controller: Type[Any], description: Dict[str, Any], params: Dict[str, Any] | None = None, allow_double: bool = False) None[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: Type[Any]) None[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: Any, controller_params: Dict[str, Any], description: Dict[str, Any]) None[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: Dict[str, Any]) str[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: List[Any]

Getter for the hooks

Returns:

hooks

Return type:

pySDC.Hooks.hooks

return_stats() Dict[Any, Any][source]

Return the merged stats from all hooks

Returns:

Merged stats from all hooks

Return type:

dict

run(u0: Any, t0: float, Tend: float) Any[source]

Abstract interface to the run() method

Parameters:
  • u0 – initial values

  • t0 (float) – starting time

  • Tend (float) – ending time

setup_convergence_controllers(description: Dict[str, Any]) None[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() None[source]
class ParaDiagController(controller_params: Dict[str, Any], description: Dict[str, Any], n_steps: int, useMPI: bool | None = None)[source]

Bases: Controller

FFT_in_time(quantity: Any) None[source]

Compute weighted forward FFT in time. The weighting is determined by the alpha parameter in ParaDiag

Note: The implementation via matrix-vector multiplication may be inefficient and less stable compared to an FFT

with transposes!

iFFT_in_time(quantity: Any) None[source]

Compute weighted backward FFT in time. The weighting is determined by the alpha parameter in ParaDiag