1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// SPDX-License-Identifier: AGPL-3.0-or-later
//! Structured Grid Operations
//!
//! **Physics-Agnostic Grid Primitives**
//!
//! Finite-difference and interpolation operations on structured grids.
//!
//! ## Operations
//!
//! - **Gradient**: First derivatives via central/forward/backward FD
//! - **Laplacian**: Second derivatives (∇²)
//! - **Gradient magnitude**: |∇f|
//! - **Coordinate systems**: Cartesian 1D/2D/3D, Cylindrical (ρ,z)
//!
//! ## Applications
//!
//! - **Fluid dynamics**: Navier-Stokes, pressure Poisson
//! - **Heat transfer**: Diffusion equation
//! - **Electrostatics**: Poisson, Laplace equations
//! - **Wave propagation**: Acoustic, seismic, EM
//! - **Image processing**: Edge detection, smoothing
//! - **Nuclear physics**: HFB density gradients (validated by hotSpring)
//!
//! ## Stencil Accuracy
//!
//! - **Interior**: 2nd order central difference (3-point stencil)
//! - **Boundaries**: 1st order forward/backward (2-point stencil)
//!
//! Higher-order stencils (4th, 6th order) can be added as needed.
//!
//! ## Grid Conventions
//!
//! - **Row-major**: index = ix * ny + iy (C-style)
//! - **Cylindrical**: ρ starts at dρ (not 0), z centered
//!
//! ## Usage
//!
//! ```rust,ignore
//! use barracuda::ops::grid::{Gradient2D, Laplacian2D};
//!
//! let grad = Gradient2D::new(device, nx, ny, dx, dy)?;
//! let (gx, gy) = grad.compute(&field).await?;
//!
//! let laplacian = Laplacian2D::new(device, nx, ny, dx, dy)?;
//! let nabla2_f = laplacian.compute(&field).await?;
//! ```
//!
//! ## Deep Debt Compliance
//!
//! - Pure WGSL (f64 via `SHADER_F64`)
//! - Physics-agnostic (no domain-specific parameters)
//! - Validated by hotSpring nuclear EOS (169/169 acceptance checks)
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;