archimedes.quadrature.composite_quad¶
- archimedes.quadrature.composite_quad(
- base: QuadratureRule | Sequence[QuadratureRule],
- breakpoints: ndarray,
Tile
baseacross elements of its reference domain.Partitions
base.measure.supportatbreakpointsand appliesbase, affinely rescaled, to each element, concatenating the resulting nodes and weights. The result is itself aQuadratureRuleon the same reference domain – its nodes are just clustered at the element boundaries rather than spread uniformly – so it can be mapped onto a target domain/measure viamap_to/integrateexactly like any other rule ofbase.measure. This works becausemeasure.affine_paramsmaps affinely, and affine maps commute with subdivision: rescaling the whole composite pattern onto[a, b]is the same as building the elements directly on the rescaled sub-intervals of[a, b].basemay instead be a sequence of rules, one per element, letting each element carry its own order (or even its own family) – e.g.composite_quad([gauss_legendre(2), gauss_legendre(4)], breakpoints)for two elements of different degree. A singlebaserule is exactly equivalent to passing that same rulelen(breakpoints) - 1times.Only defined for families whose reference weight is uniform (see
Measure.uniform_weight) – otherwise each interior element boundary would pick up a spurious copy of the weight’s shape, which is only meaningful at the true endpoints of the reference domain.- Parameters:
base (QuadratureRule or sequence of QuadratureRule) – Rule (or per-element rules) to tile across elements. Every rule’s
measure.uniform_weightmust beTrue, and (since the result has a singlemeasurefield) every rule must share the samemeasure. A sequence must have exactlylen(breakpoints) - 1entries, one per element.breakpoints (array_like) – Element boundaries, shape
(k + 1,)forkelements. Must be strictly increasing and spanbase.measure.supportexactly (first/last entries equal to its endpoints).
- Returns:
rule – Composite rule on the same reference domain as
base, withsum(len(r) for r in rules)nodes (k * len(base)whenbaseis a single rule).nameis the common rule name if every per-element rule shares one, else the generic"composite".- Return type:
- Raises:
ValueError – If any rule’s
measure.uniform_weightisFalse, if the rules do not all share the samemeasure, if a sequence of rules does not have one entry per element, ifbreakpointshas fewer than 2 entries or is not strictly increasing, or if it does not spanbase.measure.supportexactly.