qmat.qdelta.timestepping

Submodule for QDelta coefficients based on time-stepping scheme. Allows to build equivalent SDC sweeps as those introduced in the original paper from [Dutt, Greengard & Rokhlin, 2000].

Examples

>>> from qmat.qcoeff.collocation import Collocation
>>> coll = Collocation(nNodes=4, nodeType="LEGENDRE", quadType="RADAU-RIGHT")
>>>
>>> from qmat import genQDeltaCoeffs
>>> QDelta = genQDeltaCoeffs("IE", nodes=coll.nodes)
>>>
>>> from qmat.qdelta.timestepping import TRAP
>>> gen = TRAP(nodes=coll.nodes)
>>> SDelta, dTau = gen.genCoeffs(form="N2N", dTau=True)

Classes

TimeStepping

Base class for time-stepping based \(Q_\Delta\) approximations

BE

Approximation based on Backward Euler steps between the nodes

FE

Approximation based on Forward Euler steps between the nodes

TRAP

Approximation based on Trapezoidal Rule between the nodes

BEPAR

Approximation based on parallel Backward Euler steps from zero to nodes

TRAPAR

Approximation based on parallel Trapezoidal Rule from zero to nodes

Module Contents

class TimeStepping(nodes, tLeft=0, **kwargs)[source]
Inheritance diagram of qmat.qdelta.timestepping.TimeStepping

Base class for time-stepping based \(Q_\Delta\) approximations

Parameters:
  • nodes (list-like) – Normalized nodes in increasing order.

  • tLeft (float, optional) – Left bound for the nodes. The default is 0.

  • **kwargs – Additional parameters given in a generic call, ignored by this class.

deltas: numpy.ndarray

Differences between nodes

nodes: numpy.ndarray

Array of normalized nodes

tLeft: float = 0

Left bound for the nodes

static extractParams(qGen: qmat.qdelta.QGenerator) dict[source]

Extract from a \(Q\)-generator object all parameters required to instantiate the \(Q_\Delta\)-generator

property size: int

Dimension of the approximated \(Q\)-coefficients (number of nodes)

class BE(nodes, tLeft=0, **kwargs)[source]
Inheritance diagram of qmat.qdelta.timestepping.BE

Approximation based on Backward Euler steps between the nodes

aliases = ['IE']
computeQDelta(k=None)[source]

Compute and returns the \(Q_\Delta\) matrix, has to be implemented in the specialized class.

Parameters:

k (int, optional) – Iteration number of the approximation. The default is None.

Returns:

QDelta

Return type:

np.ndarray

class FE(nodes, tLeft=0, **kwargs)[source]
Inheritance diagram of qmat.qdelta.timestepping.FE

Approximation based on Forward Euler steps between the nodes

aliases = ['EE']
computeQDelta(k=None)[source]

Compute and returns the \(Q_\Delta\) matrix, has to be implemented in the specialized class.

Parameters:

k (int, optional) – Iteration number of the approximation. The default is None.

Returns:

QDelta

Return type:

np.ndarray

property dTau: numpy.ndarray

The \(\delta_\tau\) coefficients associated to \(Q_\Delta\)

class TRAP(nodes, tLeft=0, **kwargs)[source]
Inheritance diagram of qmat.qdelta.timestepping.TRAP

Approximation based on Trapezoidal Rule between the nodes

aliases = ['CN']
computeQDelta(k=None)[source]

Compute and returns the \(Q_\Delta\) matrix, has to be implemented in the specialized class.

Parameters:

k (int, optional) – Iteration number of the approximation. The default is None.

Returns:

QDelta

Return type:

np.ndarray

property dTau: numpy.ndarray

The \(\delta_\tau\) coefficients associated to \(Q_\Delta\)

class BEPAR(nodes, tLeft=0, **kwargs)[source]
Inheritance diagram of qmat.qdelta.timestepping.BEPAR

Approximation based on parallel Backward Euler steps from zero to nodes

aliases = ['IEpar']
computeQDelta(k=None)[source]

Compute and returns the \(Q_\Delta\) matrix, has to be implemented in the specialized class.

Parameters:

k (int, optional) – Iteration number of the approximation. The default is None.

Returns:

QDelta

Return type:

np.ndarray

class TRAPAR(nodes, tLeft=0, **kwargs)[source]
Inheritance diagram of qmat.qdelta.timestepping.TRAPAR

Approximation based on parallel Trapezoidal Rule from zero to nodes

computeQDelta(k=None)[source]

Compute and returns the \(Q_\Delta\) matrix, has to be implemented in the specialized class.

Parameters:

k (int, optional) – Iteration number of the approximation. The default is None.

Returns:

QDelta

Return type:

np.ndarray

property dTau: numpy.ndarray

The \(\delta_\tau\) coefficients associated to \(Q_\Delta\)