Skip to main content

apply_neumann_reflection

Function apply_neumann_reflection 

Source
pub fn apply_neumann_reflection(u: &mut Vec<f64>)
Expand description

Applies Neumann (zero-flux) conditions by ghost-cell reflection.

Left ghost: u[-1] = u[1], right ghost: u[n] = u[n-2]. Modifies the first and last elements of u in-place.