pub fn multigrid_vcycle(
u: &mut Vec<f64>,
f: &[f64],
h: f64,
n_smooth: usize,
depth: usize,
)Expand description
Multigrid V-cycle for a 1-D Poisson problem.
Recursively applies pre-smoothing, coarse-grid correction, and post-smoothing via Gauss-Seidel.
§Arguments
u– Current solution approximation (modified in place).f– Right-hand side.h– Grid spacing.n_smooth– Number of Gauss-Seidel smoothing steps.depth– Remaining recursion depth (0 = direct solve).