archimedes.quadrature.Quadrature¶

class archimedes.quadrature.Quadrature(*args, **kwargs)¶

The interface every quadrature rule provides, whatever its dimension.

Deliberately minimal: this is only what’s needed by FunctionSpace to define an inner product.

Methods

map_to(*params, **kwparams)

A new rule mapped onto the target domain.

sum(values, *[, axis, density])

Quadrature applied to values already sampled at the nodes.

Attributes

breakpoints

Element boundaries, for a rule assembled from sub-elements.

elements

Which sub-element each node came from, or None for a rule with no element structure.

measures

The measure integrated against in each dimension, always a tuple of length ndim.

ndim

Number of dimensions of the domain integrated over.

nodes

Nodes on the currently-mapped target domain (see map_to), shape (n,) for a one-dimensional rule or (n, ndim) otherwise.

weights

Weights including the Jacobian of the currently-mapped target domain (see map_to), shape (n,).

__init__(*args, **kwargs)¶
map_to(
*params: Any,
**kwparams: Any,
) → Quadrature¶

A new rule mapped onto the target domain.

sum(
values: ndarray,
*,
axis: int = ...,
density: bool = False,
) → ndarray¶

Quadrature applied to values already sampled at the nodes.

The default axis is rule-specific; see each rule’s sum.

property breakpoints: Any¶

Element boundaries, for a rule assembled from sub-elements.

np.ndarray | None for a one-dimensional rule; a per-dimension tuple of those for a multi-dimensional one.

property elements: Any¶

Which sub-element each node came from, or None for a rule with no element structure.

Shape (n,) for a one-dimensional rule and (n, ndim) for a multi-dimensional one, mirroring nodes.

This is provenance that can’t be determined by coordinates alone. A composite rule places nodes on its element boundaries, so a basis that is discontinuous needs to know which element each copy belongs to.

property measures: tuple[Measure, ...]¶

The measure integrated against in each dimension, always a tuple of length ndim.

property ndim: int¶

Number of dimensions of the domain integrated over.

property nodes: ndarray¶

Nodes on the currently-mapped target domain (see map_to), shape (n,) for a one-dimensional rule or (n, ndim) otherwise.

property weights: ndarray¶

Weights including the Jacobian of the currently-mapped target domain (see map_to), shape (n,).