API reference#

A run of pySDC is set up with a description, a dictionary that names a problem class, a sweeper class and their parameters, and possibly transfer classes and convergence controllers. A controller then runs it, with hooks, given in the controller parameters, recording what happens. The tables below list the classes pySDC ships for each of these roles, with the first sentence of their docstrings; each name links to its full documentation. The complete list of modules is at the end of this page.

Problems#

The equations: right-hand sides, implicit solves and, where known, exact solutions.

Class

Summary

acoustic_1d_imex

Periodic 1D acoustic-advection system with finite differences, acoustic waves implicit and advection explicit.

advectiondiffusion1d_imex

Periodic 1D advection-diffusion equation with FFTs, IMEX with diffusion implicit and advection explicit.

advectiondiffusion1d_implicit

Periodic 1D advection-diffusion equation with FFTs, fully implicit in advection and diffusion.

advectionNd

Example implementing the unforced ND advection equation with periodic or Dirichlet boundary conditions in \([0,1]^N\)

allencahn_front_fullyimplicit

1D Allen-Cahn front with driving force, Dirichlet BCs and finite differences, fully implicit with Newton.

allencahn_front_semiimplicit

1D Allen-Cahn front with driving force, Dirichlet BCs and finite differences, IMEX with Laplacian implicit.

allencahn_front_finel

1D Allen-Cahn front with driving force and Dirichlet BCs, fully implicit with Newton, using Finel’s trick.

allencahn_periodic_fullyimplicit

1D Allen-Cahn equation with driving force, periodic BCs and finite differences, fully implicit with Newton.

allencahn_periodic_semiimplicit

1D Allen-Cahn equation with driving force, periodic BCs and finite differences, IMEX with Laplacian implicit.

allencahn_periodic_multiimplicit

1D periodic Allen-Cahn equation with driving force, multi-implicit: linear solve for Laplacian, Newton for rest.

allencahn_fullyimplicit

2D periodic Allen-Cahn equation with finite differences, fully implicit with Newton.

allencahn_semiimplicit

2D periodic Allen-Cahn equation with finite differences, IMEX with Laplacian implicit, reaction explicit.

allencahn_semiimplicit_v2

2D periodic Allen-Cahn equation with finite differences, IMEX with Laplacian and cubic term implicit.

allencahn_multiimplicit

2D periodic Allen-Cahn equation with finite differences, multi-implicit: Laplacian (CG), reaction (Newton).

allencahn_multiimplicit_v2

2D periodic Allen-Cahn with finite differences, multi-implicit: Laplacian plus cubic term, linear term.

allencahn2d_imex

2D periodic Allen-Cahn equation with FFTs, IMEX with the Laplacian implicit and the reaction explicit.

allencahn2d_imex_stab

2D periodic Allen-Cahn equation with FFTs, IMEX with a stabilizing linear term shifted into the implicit part.

allencahn_imex

Periodic Allen-Cahn equation with driving force and mpi4py-fft FFTs, IMEX with the Laplacian implicit.

allencahn_imex_timeforcing

Periodic Allen-Cahn equation with mpi4py-fft FFTs, IMEX, with a time-dependent, mass-conserving driving force.

allencahn_temp_imex

Periodic Allen-Cahn equation coupled to a temperature equation, mpi4py-fft FFTs, IMEX with both Laplacians implicit.

auzinger

This class implements the Auzinger equation as initial value problem.

battery_n_capacitors

Example implementing the battery drain model with \(N\) capacitors, where \(N\) is an arbitrary integer greater than zero.

battery

Example implementing the battery drain model with \(N=1\) capacitor, inherits from battery_n_capacitors.

battery_implicit

Battery drain model with one capacitor, treated fully implicitly with Newton instead of the IMEX splitting.

boussinesq_2d_imex

Linearized 2D Boussinesq equations with finite differences, IMEX with waves implicit (GMRES), advection explicit.

Brusselator

2D periodic Brusselator reaction-diffusion system with mpi4py-fft, IMEX with diffusion implicit, reactions explicit.

buck_converter

Example implementing the model of a buck converter, which is also called a step-down converter.

Burgers1D

1D viscous Burgers equation with Dirichlet BCs and a Chebychev method, IMEX with diffusion implicit, advection explicit.

Burgers2D

2D viscous Burgers equation, periodic in x (FFT) and Dirichlet in z (Chebychev), diffusion implicit, advection explicit.

DiscontinuousTestODE

This class implements a very simple test case of a ordinary differential equation consisting of one discrete event.

ExactDiscontinuousTestODE

Variant of DiscontinuousTestODE whose solve_system returns the exact solution, to test the SwitchEstimator.

swfw_scalar

Scalar test equation with a fast and a slow wave, IMEX with the fast part implicit and the slow part explicit.

fermi_pasta_ulam_tsingou

The Fermi-Pasta-Ulam-Tsingou (FPUT) problem was one of the first computer experiments.

full_solar_system

Gravitational N-body problem of the sun, the eight planets (Earth and Moon as one body) and Pluto.

generalized_fisher

1D generalized Fisher equation with finite differences and Dirichlet BCs, fully implicit with Newton.

petsc_fisher_multiimplicit

1D generalized Fisher equation with PETSc finite differences, multi-implicit: diffusion (CG), reaction (SNES).

petsc_fisher_fullyimplicit

1D generalized Fisher equation with PETSc finite differences, fully implicit with PETSc’s SNES.

petsc_fisher_semiimplicit

1D generalized Fisher equation with PETSc finite differences, IMEX with diffusion implicit, reaction explicit.

GenericGusto

Problem class wrapping a Gusto (Firedrake) equation, with all terms of its residual treated implicitly.

GenericGustoImex

Problem class wrapping a Gusto (Firedrake) equation, IMEX with the terms labeled implicit and explicit split.

fenics_grayscott

1D Gray-Scott reaction-diffusion system with FEniCS finite elements, fully implicit with FEniCS’ Newton solver.

fenics_grayscott_mass

Gray-Scott in mass-matrix form, \(M \vec{u}' = F(\vec{u})\), with no mass inversion.

petsc_grayscott_multiimplicit

2D periodic Gray-Scott system with PETSc finite differences, multi-implicit: diffusion (CG), reaction (SNES).

petsc_grayscott_fullyimplicit

2D periodic Gray-Scott system with PETSc finite differences, fully implicit with PETSc’s SNES.

petsc_grayscott_semiimplicit

2D periodic Gray-Scott system with PETSc finite differences, IMEX with diffusion implicit, reaction explicit.

grayscott_imex_diffusion

Periodic Gray-Scott system with mpi4py-fft FFTs, IMEX with diffusion implicit and the reaction explicit.

grayscott_imex_linear

Periodic Gray-Scott system with mpi4py-fft, IMEX with diffusion and linear reaction terms implicit, rest explicit.

grayscott_mi_diffusion

Periodic Gray-Scott system with mpi4py-fft, multi-implicit: diffusion by FFT, reaction by Newton.

grayscott_mi_linear

Periodic Gray-Scott system with mpi4py-fft, multi-implicit: diffusion and linear terms by FFT, the rest by Newton.

harmonic_oscillator

Example implementing the harmonic oscillator with mass \(1\)

fenics_heat

Forced 1D heat equation with FEniCS and Dirichlet BCs, IMEX, with the mass matrix inverted in the right-hand side.

fenics_heat_mass

Forced 1D heat equation with FEniCS and Dirichlet BCs, IMEX, with the mass matrix applied instead of inverted.

fenics_heat_mass_timebc

Forced 1D heat equation with FEniCS, IMEX with the mass matrix applied, and time-dependent Dirichlet BCs.

heat2d_petsc_forced

Example implementing the forced two-dimensional heat equation with Dirichlet boundary conditions \((x, y) \in [0,1]^2\)

Heat1DChebychev

1D Heat equation with Dirichlet Boundary conditions discretized on (-1, 1) using a Chebychev spectral method.

Heat1DUltraspherical

1D Heat equation with Dirichlet Boundary conditions discretized on (-1, 1) using an ultraspherical spectral method.

Heat2DChebychev

2D heat equation, periodic (FFT) or Dirichlet (Chebychev) in each direction, in first-order formulation.

Heat2DUltraspherical

2D heat equation, periodic (FFT) or Dirichlet (ultraspherical) in each direction, in second-order formulation.

heatNd_unforced

This class implements the unforced \(N\)-dimensional heat equation with periodic boundary conditions

heatNd_forced

This class implements the forced \(N\)-dimensional heat equation with periodic boundary conditions

Heat1DForcedFiredrake

Forced 1D heat equation with Dirichlet BCs and Firedrake finite elements, IMEX with diffusion implicit.

henon_heiles

This class implements the second-order Hénon-Heiles system

logistics_equation

Problem implementing a specific form of the Logistic Differential Equation

LorenzAttractor

Lorenz system of three chaotic ODEs, treated fully implicitly with a Newton solver.

nonlinearschroedinger_imex

Periodic nonlinear Schrödinger equation with mpi4py-fft, IMEX with the Laplacian implicit, nonlinearity explicit.

nonlinearschroedinger_fully_implicit

Periodic nonlinear Schrödinger equation with mpi4py-fft, fully implicit with SciPy’s Newton-Krylov solver.

outer_solar_system

Gravitational N-body problem of the outer solar system: the sun, Jupiter, Saturn, Uranus, Neptune and Pluto.

penningtrap

Charged particles in a 3D Penning trap with Coulomb interaction, a second-order problem for the Boris integrator.

piline

Pi-line model of a transmission line as three linear ODEs, IMEX with the constant source term explicit.

Quench

1D heat equation with a nonlinear heat source, modelling a magnet quench, fully implicit with Newton.

QuenchIMEX

1D heat equation with a nonlinear heat source, modelling a magnet quench, IMEX with diffusion implicit.

RayleighBenard

2D Rayleigh-Benard convection, FFT in x and ultraspherical in z, IMEX with the nonlinear advection explicit.

RayleighBenard3D

3D Rayleigh-Benard convection, FFT in x and y and ultraspherical in z, IMEX with the nonlinear advection explicit.

testequation0d

Dahlquist test equation for many values of \(\lambda\) at once, treated fully implicitly.

test_equation_IMEX

Test equation with the right-hand side split into an implicit and an explicit part

vanderpol

Stiff Van der Pol oscillator as a system of two first-order ODEs, fully implicit with Newton.

fenics_vortex_2d

2D periodic vorticity-velocity problem with FEniCS, IMEX (diffusion implicit), with the mass matrix inverted.

fenics_vortex_2d_mass

2D periodic vorticity-velocity problem with FEniCS, IMEX (diffusion implicit), with the mass matrix applied.

IMEX_Laplacian_MPIFFT

Generic base class for IMEX problems using a spectral method to solve the Laplacian implicitly and a possible rest explicitly.

GenericNDimFinDiff

Base class for finite difference spatial discretisation in \(N\) dimensions

GenericSpectralLinear

Generic class to solve problems of the form M u_t + L u = y, with mass matrix M, linear operator L and some right hand side y using spectral methods.

nonlinear_ODE_1

This class implements a simple nonlinear ODE with a singularity in the derivative, taken from https://www.osti.gov/servlets/purl/6111421 (Problem E-4).

ProtheroRobinson

Implement the Prothero-Robinson problem.

ProtheroRobinsonAutonomous

Implement the Prothero-Robinson problem into autonomous form.

Kaps

Implement the Kaps problem.

ChemicalReaction3Var

Chemical reaction with three components, modeled by the non-linear system.

JacobiElliptic

Implement the Jacobi Elliptic non-linear problem.

polynomial_testequation

Scalar ODE whose exact solution is a random polynomial in time, to test operations exact on polynomials.

polynomial_testequation_IMEX

IMEX version of the polynomial test problem that assigns half the derivative to the implicit part and the other half to the explicit part.

Sweepers#

The integrators within a step: SDC with its preconditioners and splittings, second-order and multistep methods, Runge-Kutta and ParaDiag.

Class

Summary

MultiStep

Base class for linear multistep methods, given by alpha and beta coefficients and a cache of previous steps.

AdamsBashforthExplicit1Step

One-step Adams-Bashforth method, which is just forward Euler.

BackwardEuler

Backward Euler written as a one-step implicit multistep method.

AdamsMoultonImplicit1Step

Trapezoidal method dressed up as a multistep method.

AdamsMoultonImplicit2Step

Third-order implicit two-step Adams-Moulton method, started with a trapezoidal rule step.

QDiagonalization

Sweeper solving the collocation problem directly via diagonalization of Q.

QDiagonalizationIMEX

Variant of QDiagonalization for ParaDiag on problems whose right hand side has implicit and explicit parts.

RungeKutta

Base class for Runge-Kutta methods with lower triangular Butcher tableaux, wrapped in the sweeper interface.

RungeKuttaIMEX

Implicit-explicit split Runge Kutta base class.

ForwardEuler

Forward Euler.

BackwardEuler

Backward Euler.

IMEXEuler

First-order IMEX Euler with one backward Euler stage, at which both parts of the right hand side are evaluated.

IMEXEulerStifflyAccurate

IMEX Euler with the explicit part evaluated at the start of the step, as a stiffly accurate two-stage method.

CrankNicolson

Implicit Runge-Kutta method of second order, A-stable.

ExplicitMidpointMethod

Explicit Runge-Kutta method of second order.

ImplicitMidpointMethod

Implicit Runge-Kutta method of second order.

RK4

Explicit Runge-Kutta of fourth order: Everybody’s darling.

Heun_Euler

Second order explicit embedded Runge-Kutta method.

Cash_Karp

Fifth order explicit embedded Runge-Kutta.

DIRK43

Embedded A-stable diagonally implicit RK pair of order 3 and 4.

DIRK43_2

L-stable Diagonally Implicit RK method with four stages of order 3.

EDIRK4

Stiffly accurate, fourth-order EDIRK with four stages.

ESDIRK53

A-stable embedded RK pair of orders 5 and 3, ESDIRK5(3)6L[2]SA.

ESDIRK43

A-stable embedded RK pair of orders 4 and 3, ESDIRK4(3)6L[2]SA.

ARK548L2SAERK

Explicit part of the ARK54 scheme.

ARK548L2SAESDIRK

Implicit part of the ARK54 scheme.

ARK54

IMEX Runge-Kutta method ARK5(4)8L[2]SA of Kennedy and Carpenter, combining ARK548L2SAERK and ARK548L2SAESDIRK.

ARK548L2SAESDIRK2

Implicit part of ARK548L2SA: an L-stable, stiffly accurate ESDIRK pair of orders 5 and 4.

ARK548L2SAERK2

Explicit part of ARK548L2SA: an explicit embedded Runge-Kutta pair of orders 5 and 4.

ARK548L2SA

Newer order-5 IMEX Runge-Kutta method ARK5(4)8L[2]SA of Kennedy and Carpenter, an alternative to ARK54.

ARK324L2SAERK

Explicit part of ARK32: an explicit embedded Runge-Kutta pair of orders 3 and 2.

ARK324L2SAESDIRK

Implicit part of ARK32: an L-stable, stiffly accurate ESDIRK pair of orders 3 and 2.

ARK32

Embedded IMEX Runge-Kutta method ARK3(2)4L[2]SA of Kennedy and Carpenter, of orders 3 and 2.

ARK2

Second order two stage singly diagonally implicit globally stiffly accurate IMEX RK method with explicit first stage.

ARK3

Third order four stage singly diagonally implicit globally stiffly accurate IMEX RK method with explicit first stage.

RungeKuttaNystrom

Base class for Runge-Kutta-Nystrom methods for second-order problems on particle data, as a sweeper.

RKN

Classical fourth-order Runge-Kutta-Nystrom method, with the nodes and weights of RK4.

Velocity_Verlet

Second-order velocity-Verlet scheme as a Runge-Kutta-Nystrom method, using a Boris solver for the velocity.

boris_2nd_order

SDC sweeper for charged particles in electromagnetic fields, with velocity-Verlet and a Boris push as base.

delta_implicit

Delta-form counterpart of generic_implicit.

delta_imex_1st_order

Delta-form counterpart of imex_1st_order.

delta_implicit_MPI

Delta-form counterpart of generic_implicit_MPI.

explicit

Fully explicit SDC sweeper, with explicit Euler as the default base integrator.

generic_implicit

Generic implicit sweeper, expecting lower triangular matrix type as input

SweeperMPI

MPI based sweeper where each rank administers one collocation node.

generic_implicit_MPI

Generic implicit sweeper parallelized across the nodes.

generic_implicit_mass

Fully implicit SDC sweeper for the mass-matrix formulation (no M^-1 anywhere).

imex_1st_order

SDC sweeper for right hand sides split into an implicitly and an explicitly treated part (IMEX-SDC).

imex_1st_order_MPI

Node-parallel IMEX-SDC sweeper, one collocation node per MPI rank, so far only with Picard for the explicit part.

imex_1st_order_mass

IMEX-SDC sweeper for problems M u’ = f(u) with a mass matrix M, as they arise from finite elements.

multi_implicit

SDC sweeper for right hand sides with two parts, each treated implicitly with its own solver and preconditioner.

verlet

SDC sweeper for second-order problems with velocity-independent forces, with velocity-Verlet as base integrator.

Controllers#

Run the steps, one after the other or in parallel, with SDC, MLSDC, PFASST or ParaDiag.

Class

Summary

controller_MPI

Controller running SDC, MLSDC and PFASST with each time step of a block on its own MPI rank.

controller_ParaDiag_MPI

ParaDiag controller with MPI parallelism across time steps: one step per rank.

controller_ParaDiag_nonMPI

ParaDiag controller with the time steps of a block emulated serially in one process.

controller_nonMPI

Controller running SDC, MLSDC and PFASST with the time steps of a block emulated serially in one process.

Convergence controllers#

Change a run while it goes: error estimates, adaptive step sizes, stopping criteria and restarts.

Class

Summary

AdaptiveAlpha

Choose the ParaDiag \(\alpha\) adaptively from the residual.

AdaptiveCollocation

This convergence controller allows to change the underlying quadrature between iterations.

AdaptivityBase

Abstract base class for adaptivity from arbitrary local error estimates and step size update rules.

AdaptivityForConvergedCollocationProblems

Base class for adaptivity from error estimates that need a converged collocation problem, restarting if it is not.

Adaptivity

Class to compute time step size adaptively based on embedded error estimate.

AdaptivityRK

Adaptivity for Runge-Kutta methods.

AdaptivityResidual

Do adaptivity based on residual.

AdaptivityCollocation

Control the step size via a collocation based estimate of the local error.

AdaptivityExtrapolationWithinQ

Compute the step size adaptively from an error estimate by extrapolation within the quadrature nodes.

AdaptivityPolynomialError

Compute the step size adaptively from an error estimate by interpolation within the quadrature nodes.

BasicRestarting

Restart every step after one that requests a restart, and limit how often a step may be restarted in a row.

BasicRestartingNonMPI

Basic restarting for the non-MPI controller, which passes restart requests between steps through shared buffers.

BasicRestartingMPI

Basic restarting for the MPI controller, which passes restart requests on to the following ranks with MPI.

CheckIterationEstimatorNonMPI

Stop iterating once the contraction of the increments predicts that errtol is reached, for the non-MPI controller.

CrashBase

Base class for convergence controllers that raise a ConvergenceError on all ranks as soon as one rank crashes.

StopAtNan

Crash all ranks when the solution contains nan or inf, or when its norm reaches the optional threshold thresh.

StopAtMaxRuntime

Abort the code when the problem has exceeded a maximum runtime.

EstimateContractionFactor

Estimate the contraction factor by using the evolution of the embedded error estimate across iterations.

EstimateEmbeddedError

Estimate the local error as the difference between two solutions of different order, such as two consecutive sweeps.

EstimateEmbeddedErrorLinearizedNonMPI

Local error in a block of steps as the embedded estimate minus that of the step before, for the non-MPI controller.

EstimateEmbeddedErrorLinearizedMPI

Local error in a block of steps as the embedded estimate minus that of the step before, for the MPI controller.

EstimateEmbeddedErrorCollocation

Estimates an embedded error based on changing the underlying quadrature rule.

EstimateExtrapolationErrorBase

Abstract base class for error estimates by Taylor extrapolation of solutions and right-hand sides from other times.

EstimateExtrapolationErrorNonMPI

Implementation of the extrapolation error estimate for the non-MPI controller.

EstimateExtrapolationErrorWithinQ

Estimate the local error by comparing the converged SDC solution to an extrapolation from other quadrature nodes.

EstimatePolynomialError

Estimate the local error by using all but one collocation node in a polynomial interpolation to that node.

EstimatePolynomialErrorFiredrake

Polynomial interpolation error estimate for Firedrake functions, combining the node solutions term by term.

HotRod

Class that incorporates the Hot Rod detector [1] for soft faults.

NewtonInexactness

Gradually refine Newton tolerance based on SDC residual.

InterpolateBetweenRestarts

Interpolate the solution and right hand side to the new set of collocation nodes after a restart.

SpreadStepSizesBlockwise

Give all steps of the next block the same step size, taken from the last step or from the first restarted one.

SpreadStepSizesBlockwiseNonMPI

Spread one step size to all steps of the next block for the non-MPI controller, reading the steps directly.

SpreadStepSizesBlockwiseMPI

Spread one step size to all steps of the next block for the MPI controller, with collectives across the time ranks.

StepSizeLimiter

Clip the new step size to [dt_min, dt_max], and add a StepSizeSlopeLimiter if slope limits are given.

StepSizeSlopeLimiter

Bound dt_new / dt to [dt_slope_min, dt_slope_max], keeping dt if the change is below dt_rel_min_slope.

StepSizeRounding

Class to round step size when using adaptive step size selection.

StoreUOld

Class to store the solution of the last iteration in a variable called ‘uold’ of the levels.

Hooks#

Record what happens during a run into the statistics.

Class

Summary

AllenCahnMonitor

Track the shrinking circle (or sphere) of an Allen-Cahn run.

GPUTimings

Hook for recording GPU timings of important operations during a pySDC run.

LogEmbeddedErrorEstimate

Store the embedded error estimate at the end of each step as “error_embedded_estimate”.

LogEmbeddedErrorEstimatePostIter

Store the embedded error estimate after each iteration as “error_embedded_estimate_post_iteration”.

LogError

Base class for hooks that log the local or global error with respect to the u_exact of the problem.

LogGlobalErrorPostStep

Log the global error with respect to u_exact at the end of each step as “e_global_post_step”.

LogGlobalErrorPostIter

Log the global error after each iteration

LogGlobalErrorPostRun

Compute the global error once after the run is finished.

LogLocalErrorPostStep

Log the local error with respect to u_exact defined in the problem class as “e_local_post_step”.

LogLocalErrorPostIter

Log the local error after each iteration

LogExtrapolationErrorEstimate

Store the extrapolated error estimate at the end of each step as “error_extrapolation_estimate”.

LogRestarts

Record restarts as restart at the beginning of the step.

LogSolution

Store the solution at the end of each step as “u”.

LogSolutionAfterIteration

Store the solution at the end of each iteration as “u”.

LogToPickleFile

Hook for logging the solution to file after the step using pickle.

LogToPickleFileAfterXS

Log to file after certain amount of time has passed instead of after every step

LogToFile

Write the solution every time_increment to one FieldsIO file set up by the problem, resuming an existing file.

LogStepSize

Store the step size at the end of each step as “dt”.

LogWork

Log the increment of all work counters in the problem between steps

LogSDCIterations

Log the number of SDC iterations between steps.

PlottingHook

Base class for hooks that plot the solution with the problem’s plot method, optionally saving each figure.

PlotPostStep

Call a plotting function of the problem after every step

Transfer#

Move data between the levels of MLSDC and PFASST: restriction and interpolation in space, and the FAS correction.

Class

Summary

delta_transfer

Space-time transfer that passes a residual down and an accumulated correction up.

delta_transfer_MPI

Node-parallel counterpart of delta_transfer.

base_transfer_MPI

Node-parallel space-time transfer for sweepers where each MPI rank holds one collocation node.

base_transfer_mass

Space-time transfer for problems with a mass matrix, which enters the FAS correction and the restricted u0.

mesh_to_mesh_fenics

This implementation can restrict and prolong between fenics meshes

MeshToMeshFiredrake

This implementation can restrict and prolong between Firedrake meshes

MeshToMeshFiredrakeHierarchy

This implementation can restrict and prolong between Firedrake meshes that are generated from a hierarchy.

mesh_to_mesh

Space transfer between nd meshes by sparse interpolation matrices of even order, restricting by their transpose.

mesh_to_mesh_fft

Space transfer between periodic 1d meshes: injection to restrict, Fourier interpolation to prolong.

mesh_to_mesh_fft2d

Space transfer between periodic square 2d meshes: injection to restrict, Fourier interpolation to prolong.

fft_to_fft

Space transfer between distributed periodic mpi4py-fft meshes: injection to restrict, spectral padding to prolong.

mesh_to_mesh

Identity space transfer for levels on the same mesh, copying the data in both directions.

mesh_to_mesh_petsc_dmda

This implementation can restrict and prolong between PETSc DMDA grids

particles_to_particles

Identity space transfer for particles, fields and accelerations, copying the data in both directions.

Data types#

What solutions and right-hand sides are stored in.

Class

Summary

MultiComponentContainer

Datatype with multiple components, each one an object of its own.

cupy_mesh

CuPy-based datatype for serial or parallel meshes.

CuPyMultiComponentMesh

CuPy-based mesh with multiple components, see MultiComponentMeshMixin.

imex_cupy_mesh

CuPy mesh with an implicit part impl and an explicit part expl, for IMEX right-hand sides.

comp2_cupy_mesh

CuPy mesh with two parts comp1 and comp2, for multi-implicit right-hand sides.

fenics_mesh

FEniCS Function data type with arbitrary dimensions

rhs_fenics_mesh

RHS data type for fenics_meshes with implicit and explicit components

firedrake_mesh

Wrapper for firedrake function data.

IMEX_firedrake_mesh

Datatype for IMEX integration with firedrake data.

mesh

Numpy-based datatype for serial or parallel meshes.

MultiComponentMeshMixin

Generic mesh with multiple components.

MultiComponentMesh

Numpy-based mesh with multiple components, see MultiComponentMeshMixin.

imex_mesh

NumPy mesh with an implicit part impl and an explicit part expl, for IMEX right-hand sides.

comp2_mesh

NumPy mesh with two parts comp1 and comp2, for multi-implicit right-hand sides.

particles

Particle data type for particles in 3 dimensions

acceleration

Mesh holding the accelerations of the particles, the right-hand side type for particles.

fields

Field data type for 3 dimensions

petsc_vec

PETSc Vec datatype, created from a DMDA or copied from another vector.

petsc_vec_imex

RHS data type for Vec with implicit and explicit components

petsc_vec_comp2

RHS data type for Vec with two components

Core#

The base classes everything above derives from, and the step and level they run on.

Class

Summary

BaseTransfer

Space-time transfer between two levels, interpolating across collocation nodes and computing the FAS correction.

CheckConvergence

Perform simple checks on convergence for SDC iterations.

CollBase

Generic collocation class, that contains everything to do integration over intervals and between nodes.

RegisterParams

Base class to register parameters.

Controller

Abstract base class of the controllers, which set up hooks and convergence controllers and run the steps in time.

Pars

Frozen parameters of a convergence controller as attributes, with defaults for control_order and useMPI.

Status

Frozen container for named variables of a convergence controller.

ConvergenceController

Abstract base class for convergence controllers, which plug into the controller to steer iterations and step sizes.

DefaultHooks

Hook added to every controller, recording the residuals and the number of iterations of each step.

DataError

Error Class handling/indicating problems with data types

ParameterError

Error Class handling/indicating problems with parameters (mostly within dictionaries)

UnlockError

Error class handling/indicating unlocked levels

CollocationError

Error class handling/indicating problems with the collocation

ConvergenceError

Error class handling/indicating problems with convergence

TransferError

Error class handling/indicating problems with the transfer processes

CommunicationError

Error class handling/indicating problems with the communication

ControllerError

Error class handling/indicating problems with the controller

ProblemError

Error class handling/indicating problems with the problem classes

ReadOnlyError

Exception thrown when setting a read-only class attribute

Hooks

Base class for hooks, with methods the controller calls around each run, step, iteration and sweep to record stats.

Level

Level class containing all management functionality for a single level

WorkCounter

Utility class for counting iterations.

Problem

Prototype class for problems, just defines the attributes essential to get started.

SpaceTransfer

Abstract base class for the restriction and prolongation of data in space between a fine and a coarse problem.

Step

Step class, referencing most of the structure needed for the time-stepping

Sweeper

Base abstract sweeper class, provides two base methods to generate QDelta matrices.

Timings

Abstract base class for hooks timing the setup, run, predictor, steps, iterations, sweeps and communication.

CPUTimings

Hook for recording CPU timings of important operations during a pySDC run.

Helpers#

Utilities for statistics, plots, setups, input and output.

Module

Summary

NCCL_communicator

NCCLComm

ParaDiagHelper

get_FFT_matrix, get_E_matrix, get_J_matrix, get_J_inv_matrix, get_weighted_FFT_matrix, get_weighted_iFFT_matrix, get_H_matrix, get_G_inv_matrix

blocks

BlockDecomposition

fft_helper

PFFT

fieldsIO

FieldsIO, Scalar, Rectilinear, initGrid, writeFields_MPI, compareFields_MPI

firedrake_ensemble_communicator

FiredrakeEnsembleCommunicator, get_ensemble

plot_helper

figsize, figsize_by_journal, setup_mpl, newfig, savefig

problem_helper

get_steps, get_finite_difference_stencil, get_finite_difference_matrix, get_1d_grid

pySDC_as_gusto_time_discretization

LogTime, pySDC_integrator

pysdc_helper

FrozenClass

setup_helper

generate_description

spectral_helper

cache, SpectralHelper1D, ChebychevHelper, UltrasphericalHelper, FFTHelper, SpectralHelper

stats_helper

filter_stats, sort_stats, get_list_of_types, get_sorted

testing

DataChecker

transfer_helper

next_neighbors_periodic, next_neighbors, continue_periodic_array, restriction_matrix_1d, interpolation_matrix_1d, border_padding

visualization_tools

show_residual_across_simulation

vtkIO

writeToVTR, readFromVTR

All modules#