The enclosed patch improves the finite differencing that is used in Exact to calculate the extrinsic curvature. These finite differences are independent of the Cactus grid spacing. This is prompted by a remark by Peter Diener that the current finite differencing accuracy for the extrinsic curvature from thorn Exact is only about nine digits.
It introduces new parameters "exact_order" and "exact_eps" that choose the order (2nd or 4th) and stencil size (default 1e-6). It also introduces new functions Exact__metric_deriv and Exact__metric_deriv2 that evaluate these finite differences.
Some finite differencing terms for the spatial derivative of the shift have to be rewritten, which may lead to differences on the order of the finite differencing accuracy.
The code could be rewritten to evaluate each stencil point only once in all calls to the new finite differencing operators. This would reduce the number of evaluations. Since thorn Exact is often very fast, this does not seem necessary at this point.
Unfortunately, this patch causes five of the AHFinderDirect test cases to fail.
-erik