pub fn poisson_2d<F, G>(
f: F,
boundary: G,
width: f64,
height: f64,
nx: usize,
ny: usize,
) -> Result<Vec<Vec<f64>>, ErrorsJSL>Expand description
Solves −∇²u = f on [0, width] × [0, height] with u = g on the boundary, on an
nx × ny grid of points including the boundary. Returns u[j][i] at (i Δx, j Δy). The
five-point system is symmetric positive definite and is solved by conjugate gradients to a
relative residual of 1e-12.