postgkyl.integrate¶
- postgkyl.integrate(data, axis=None, *, op='none', inplace=False, tag=None, label=None)¶
Integrate over all or a subset of a dataset’s spatial axes.
Integrating every axis is terminal and returns one number per field. Integrating a strict subset returns a dataset over the surviving axes. Native modal input uses Gkeyll for both cases and remains modal/native after a partial integration; no interpolation or point sampling occurs. Quadrature input uses its stored projection rule and the same native kernels for full integration. Partial quadrature integration requires an explicit conversion to modal form, since projection can change the retained point values. Cell-local nodal input uses its exact inverse transform before integration, preserving cell boundaries and discontinuities. Plain edge-located values use cell widths; plain point samples use the trapezoidal rule on their supplied domain, without extrapolating beyond its endpoints. Missing native kernels emit a warning and raise rather than approximate.
- Parameters:
data – Dataset to integrate. Modal and quadrature data use native DG kernels; other point-value data use their physical point grid.
axis – Axis or axes to integrate: an integer, tuple of integers, comma-separated string (
"0,1"), colon slice string ("0:2"), orNonefor every spatial axis.op – Full native-DG integrand operation:
"none","abs", or"sq". Partial and point-value integration support"none"only.inplace – Mutate
datafor partial integration; unavailable for a full, terminal integration.tag – Optional tag for a partial-integration result.
label – Optional label for a partial-integration result.
- Returns:
A float (one field) or NumPy array (multiple fields) when every axis is integrated; otherwise a dataset over the surviving axes. A partial modal result is exact, modal, and Gkeyll-native.
- Raises:
NotImplementedError – Gkeyll lacks the requested integration kernel or quadrature transform. A RuntimeWarning also reports the limitation.
ValueError – If the axes are invalid; a partial curvilinear mapped block is requested;
opis used outside a full native-DG integration; or dataset-only result options are used for a terminal integration.