Solution (source code)

= Solution

The <divergence> is the sum of the three diagonal <partial derivatives>:
$$
\boxed{\nabla\cdot\mathbf f=-6-6-2=-14.}
$$