extern "C" void TestProlongate_Check(CCTK_ARGUMENTS) {
DECLARE_CCTK_PARAMETERS;
DECLARE_CCTK_ARGUMENTS;
// there is no reduction yet, so for now I require that only 1 MPI rank be in
// use
assert(CCTK_nProcs(cctkGH) == 1 && "Must be single rank");
// get prolongation order from driver, the parmeter is private since really
// there is normally no reason to depend on it
int order_type;
const void *order_p = CCTK_ParameterGet("prolongation_order", "AMReX",
&order_type);
assert(order_p);
assert(order_type == PARAMETER_INT);
const CCTK_INT operator_order = *static_cast<const CCTK_INT*>(order_p);
CCTK_REAL my_max_diff = 0;
Loop::loop_int<1, 1, 1>(cctkGH, [&](const Loop::PointDesc &p) {
const CCTK_REAL diff = fabs(data[p.idx] -
pow(p.x * p.y * p.z, operator_order));
my_max_diff = max(diff, my_max_diff);
});
#pragma omp critical
{
*max_diff = max(*max_diff, my_max_diff);
}
}