sph_kernel — DRIVE swarmflow op

• Data kinds: signal × scalar → signal

• Call: import fullseye as fs; fs.ledger.sph_kernel(r, h: 'float', dim: 'int' = 2, derivative: 'bool' = False) -> 'np.ndarray' (to call the implementation directly, import swarmflow; swarmflow.sph_kernel(r, h: 'float', dim: 'int' = 2, derivative: 'bool' = False) -> 'np.ndarray'; from the registry, opsdrive.get("sph_kernel"))

Usage

Cubic (3rd-order) spline kernel W(r, h) (M4, support radius 2h). With derivative=True, dW/dr (derivative along r, ≤ 0).

W = σ_d [1 − 1.5 q² + 0.75 q³] (0 ≤ q < 1), σ_d · 0.25 (2 − q)³ (1 ≤ q < 2), 0 (q ≥ 2), q = r/h. σ_1 = 2/(3h), σ_2 = 10/(7π h²), σ_3 = 1/(π h³). With these constants ∫ W dV = 1 (an identity; a gate compares it with numerical quadrature).

Args:

r: array of distances (≥ 0, any shape).

h: smoothing length (> 0).

dim: 1, 2, 3.

derivative: if True, returns dW/dr.

Returns:

array of the same shape as r.

Raises:

ValueError: h ≤ 0, dim not in 1 to 3, r contains negative or non-finite values.

Empty input (r with 0 elements) raises ValueError.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_swarm_obstacle_from_flow — py -3.11 examples/poc_swarm_obstacle_from_flow.py

Ops the type connects to (they accept signal as input)

flight_vacuum · magnus_lift_coefficient · drag_coefficient_sphere · restitution_from_apexes · restitution_from_intervals · fit_parabola · flight_fit · fit_aero

Same category (swarmflow)

sph_density_pressure · swarm_simulate · swarm_render_overhead · swarm_field_from_tracks · swarm_field_from_piv · potential_flow_cylinder · velocity_deficit_map · stagnation_from_centerline


*Provenance: swarmflow.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.