KKTKXFG5Y7B3JZDRV6EFR3MRIQEK3SSHFYC2X5TFLP3FAU34EPAQC
BOOLEAN scale_by_resolution "Scale error estimate by geometric mean of grid spacing"
KEYWORD region_shape "Shape of refined region" STEERABLE=always
{
"sphere" :: ""
"cube" :: ""
} "sphere"
BOOLEAN scale_by_resolution "Scale error estimate by geometric mean of grid spacing" STEERABLE=always
namespace {
template <typename T> T pow2(T x) { return x * x; }
template <typename T> constexpr T fmax3(const T x, const T y, const T z) {
return fmax(fmax(x, y), z);
}
enum class shape_t { sphere, cube };
template <typename T>
constexpr T radius_sphere(const T x, const T y, const T z) {
return sqrt(pow2(x) + pow2(y) + pow2(z));
}
template <typename T> constexpr T radius_cube(const T x, const T y, const T z) {
return fmax3(fabs(x), fabs(y), fabs(z));
}