Correctness tests for KerrSchild thorn

<<nrmma`

ClearAllMemos[];

Compare with Exact

runs={"ks_a","ks_b","ks_c"};
einsteinexact="ks_ee";

Check non-finite differenced variables are identical

vars={"alp.h5","dtalp.h5","betax.h5","betay.h5","betaz.h5","dtbetax.h5","dtbetay.h5","dtbetaz.h5","gxx.h5","gxy.h5","gxz.h5","gyy.h5","gyz.h5","gzz.h5"};

compare[var_]:=Module[{e,ee,eeu},
e=ReadGridFunction[runs[[1]],var,0];
ee=ReadGridFunction[einsteinexact,var,0];
Manipulate[Show[MapThread[DataRegionPlot[SliceData[#1,{1,2},{x,y}],Joined->True,PlotStyle->#2]&,{{e,ee},{Red,Directive[Black,Dotted]}}]],{x,3.1,3.9,0.1},{y,3.1,3.9,0.1}]
]

compare/@vars

Check that Exact agrees with EinsteinExact for finite differenced variables

Because Kerr-Schild is stationary, we can expect Exact to calculate the extrinsic curvature to within roundoff.

fdvars = {"kxx.h5", "kxy.h5", "kxz.h5", "kyy.h5", "kyz.h5", "kzz.h5"};

comparefd[var_]:=Module[{a,b,c,ee,erra,errb,errc},
{a, b, c} = ReadGridFunction[#, var, 0] & /@ runs;
ee = ReadGridFunction[einsteinexact, var, 0];
erra = a - ee;
errb = b - ee;
errc = c - ee;
Manipulate[Show[MapThread[DataRegionPlot[SliceData[#1,{1,2},{x,y}],Joined->True,PlotStyle->#2]&,{{erra,16errb,(16^2)errc},{Red,Directive[Black,Dotted],Directive[Blue,Dashed]}}]],{x,3.1,3.9,0.1},{y,3.1,3.9,0.1}]
]

comparefd/@vars

Constraints

Check Hamiltonian constraint converges to 0 at second order

Manipulate[
low=SliceData[ReadGridFunction["ks_constraints_low","H.h5",0],{1,2},{x,y}];
high=SliceData[ReadGridFunction["ks_constraints_high","H.h5",0],{1,2},{x,y}];
ListLinePlot[{low,(2^2)high}],
{x,3.1,3.9,0.1},{y,3.1,3.9,0.1}]