IUYUWJZ3KF2ZNIZREWYZO6DX4SRBLTXJ4ZL4L44H5RES6ZCQ6FFAC
OCFE75FHYG23SJVJPU4TBQUUB3FKOHPJG5QFBFPLLETZVAYGDRFAC
PQB3EKQ6MBCXPTW4HB7SGMSTOTYMB3EFZX2573OFCQI6PSOEKCSQC
BVR7DVINVPQG7PA6Z7QYVYNQ43YZL7XCC6AOMSMWMGAAB2Q43STAC
RTNZAS3UPI6GG3KY4Z5WVXJ4R2YF5427BB6WAV3GHRS5W7XPOSUQC
2DD222JSYRPHTXKSRXLSOMSCQPZUORNFLLO2P3GMIDELAAMD5MEQC
AEVGZIZEUIC52MCK3J4V547YEV2R4YQL3JUJW7FSP4R34PSZ43DAC
3HNJG5IS4BVIRA47H3KYFWIKVWG5VIDOC776ZJGPZMPSZNOPMVAAC
FEMASUBNU32NSG4DNXZX54CGCA57PVRGYO46L3A6F2EJ4BCSJ3SAC
WASO7G5FJXRXWNH2U2FLUNEKU6VE63OI3HUYP64BVD4LMD6KE7OQC
5XGIB7XMEZNBLA5ZLQTXRTC3AZ5CTRGMXWBPVMWXG4DPHKWDF4ZAC
}
enum class mode_t { unknown, local, level, global, meta };
mode_t current_mode(const cGH *restrict cctkGH) {
if (cctkGH->cctk_lsh[0] != undefined)
return mode_t::local;
else if(cctkGH->cctk_gsh[0] != undefined)
return mode_t::level;
else if(cctkGH->cctk_nghostzones[0] != undefined)
return mode_t::global;
else
return mode_t::meta;
bool in_local_mode(const cGH *restrict cctkGH) {
return current_mode(cctkGH) == mode_t::local;
}
bool in_level_mode(const cGH *restrict cctkGH) {
return current_mode(cctkGH) == mode_t::level;
}
bool in_global_mode(const cGH *restrict cctkGH) {
return current_mode(cctkGH) == mode_t::global;
}
bool in_meta_mode(const cGH *restrict cctkGH) {
return current_mode(cctkGH) == mode_t::meta;
}
bool in_level_mode(const cGH *restrict cctkGH) {
if (in_local_mode(cctkGH))
return false;
if (cctkGH->cctk_gsh[0] == undefined)
return false;
return true;
}
bool in_global_mode(const cGH *restrict cctkGH) {
if(in_local_mode(cctkGH))
return false;
if(in_level_mode(cctkGH))
return false;
if(cctkGH->cctk_nghostzones[0] == undefined)
return false;
return true;
}