implementations.convergence_controller_classes.check_convergence module

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

Bases: ConvergenceController

Perform simple checks on convergence for SDC iterations.

Iteration is terminated via one of two criteria:
  • Residual tolerance

  • Maximum number of iterations

static check_convergence(S, self=None)[source]

Check the convergence of a single step. Test the residual and max. number of iterations as well as allowing overrides to both stop and continue.

Parameters:

S (pySDC.Step) – The current step

Returns:

Convergence status of the step

Return type:

bool

check_iteration_status(controller, S, **kwargs)[source]

Routine to determine whether to stop iterating (currently testing the residual + the max. number of iterations)

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

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

Returns:

None

communicate_convergence(controller, S, comm)[source]

Communicate the convergence status during check_iteration_status if MPI is used.

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

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

  • comm (mpi4py.MPI.Comm) – MPI communicator

Returns:

None

dependencies(controller, description, **kwargs)[source]

Load the embedded error estimator if needed.

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

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

Returns:

None

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

Define default parameters here

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

  • params (dict) – The params passed for this specific convergence controller

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

Returns:

The updated params dictionary

Return type:

(dict)