Seven-point Dirichlet Laplacian (source code)

= Seven-point Dirichlet Laplacian

On a three-dimensional Cartesian grid, the seven-point Dirichlet Laplacian adds the six nearest-neighbour values and subtracts six times the central value. Extending a grid vector by zero on the boundary gives the discrete energy identity
$$
v^TL_hv=-\sum_{\{i,j\}\text{ grid edge}}(v_i-v_j)^2,
$$
so its matrix is symmetric negative definite.