postgkyl.apply¶
- postgkyl.apply(data, fn, *, num_quad=None, inplace=False, tag=None, label=None)¶
Apply
fnpointwise via quadrature: modal -> quad -> fn -> modal.The explicit spelling of nonlinear pointwise operations on DG data (e.g.
d.apply(np.sqrt)): evaluate at Gkeyll’s basis quadrature nodes, applyfnto the values, and project back. The result stays modal and gkyl-native. Explicitnum_quadselects a uniform Gauss rule with that many points per direction for de-aliasing.- Parameters:
data – Native modal dataset to transform.
fn – Python callable applied to the quadrature-point values.
num_quad – Optional Gauss points per direction; omitted uses Gkeyll’s rule.
inplace – Mutate and return
datainstead of creating a dataset.tag – Optional tag for the returned dataset.
label – Optional label for the returned dataset.
- Returns:
A modal dataset containing the projected pointwise result.
- Raises:
ValueError – If
datais not native modal data or lacks basis metadata.