Changed from using scalar product with an identity matrix to using trace() of a gradient to get divergences.