% Written by Vesa Kaarnioja, 2022
function stiffness = UpdateStiffness(grad,a)
n = sqrt(size(grad,1));
stiffness = reshape(grad*sparse(a),n,n);