2DD222JSYRPHTXKSRXLSOMSCQPZUORNFLLO2P3GMIDELAAMD5MEQC
UZAKARMGORRQG733ZUPJOEGL5FG243I32NCC2SRSFDCZKUQ5A52QC
WASO7G5FJXRXWNH2U2FLUNEKU6VE63OI3HUYP64BVD4LMD6KE7OQC
722HZ7UFINNE3YKSYKP2NHZ5XEG5QQLQHSKC7PREJZR3EX6RDYUAC
U77PE56ICORZNQW33NXGSEMW7GDHCSSZ4EXB6OHBJSHEG6WHYSSQC
RTNZAS3UPI6GG3KY4Z5WVXJ4R2YF5427BB6WAV3GHRS5W7XPOSUQC
UUGQGVC4WEKN64WAP7F5QPS2UHGQB5ZLMFRIYNWKMIEBDO3QRX4AC
BVR7DVINVPQG7PA6Z7QYVYNQ43YZL7XCC6AOMSMWMGAAB2Q43STAC
RCLGQ2LZMFVPBPTU2G55DJ6HZPOGGTPZRZCY54VGP6YLHANJ2LAQC
AEVGZIZEUIC52MCK3J4V547YEV2R4YQL3JUJW7FSP4R34PSZ43DAC
PQB3EKQ6MBCXPTW4HB7SGMSTOTYMB3EFZX2573OFCQI6PSOEKCSQC
WE6MDRN5SPK3THM4COLQFE3IUWBCQ5ZYUIAUCBJAZVEMMOVTNBOAC
const int nlevels = 1;
ghext->levels.resize(nlevels);
const int lev = 0;
GHExt::Level &level = ghext->levels.at(lev);
level.level = lev;
const int nlevels = 2;
ghext->leveldata.resize(nlevels);
for (int level = 0; level < nlevels; ++level) {
GHExt::LevelData &leveldata = ghext->leveldata.at(level);
leveldata.level = level;
// Define box array
IntVect dom_lo(AMREX_D_DECL(0, 0, 0));
IntVect dom_hi(AMREX_D_DECL(ncells_x - 1, ncells_y - 1, ncells_z - 1));
Box domain(dom_lo, dom_hi);
level.grids.define(domain);
// Define box array
IntVect box_lo(AMREX_D_DECL(0, 0, 0));
IntVect box_hi(AMREX_D_DECL(ncells_x - 1, ncells_y - 1, ncells_z - 1));
Box box(box_lo, box_hi);
leveldata.grids.define(box);
// Break up box array into chunks no larger than max_grid_size along
// each direction
const int max_grid_size = 32;
level.grids.maxSize(max_grid_size);
// Break up box array into chunks no larger than max_grid_size along
// each direction
const int max_grid_size = 32;
leveldata.grids.maxSize(max_grid_size);
// Define geometry
Vector<int> is_periodic(AMREX_SPACEDIM, 1); // periodic in all directions
level.geom.define(domain, &real_box, CoordSys::cartesian, is_periodic.data());
// Define geometry
Vector<int> is_periodic(AMREX_SPACEDIM, 1); // periodic in all directions
leveldata.geom.define(box, &domain, CoordSys::cartesian,
is_periodic.data());
const int numgroups = CCTK_NumGroups();
level.groupdata.resize(numgroups);
for (int gi = 0; gi < numgroups; ++gi) {
cGroup group;
int ierr = CCTK_GroupData(gi, &group);
assert(!ierr);
assert(group.grouptype == CCTK_GF);
assert(group.vartype == CCTK_VARIABLE_REAL);
assert(group.disttype == CCTK_DISTRIB_DEFAULT);
assert(group.dim == dim);
const int numgroups = CCTK_NumGroups();
leveldata.groupdata.resize(numgroups);
for (int gi = 0; gi < numgroups; ++gi) {
cGroup group;
int ierr = CCTK_GroupData(gi, &group);
assert(!ierr);
assert(group.grouptype == CCTK_GF);
assert(group.vartype == CCTK_VARIABLE_REAL);
assert(group.disttype == CCTK_DISTRIB_DEFAULT);
assert(group.dim == dim);
GHExt::Level::GroupData &groupdata = level.groupdata.at(gi);
groupdata.firstvarindex = CCTK_FirstVarIndexI(gi);
groupdata.numvars = group.numvars;
GHExt::LevelData::GroupData &groupdata = leveldata.groupdata.at(gi);
groupdata.firstvarindex = CCTK_FirstVarIndexI(gi);
groupdata.numvars = group.numvars;
// Allocate grid hierarchies
groupdata.mfab.resize(group.numtimelevels);
for (int tl = 0; tl < int(groupdata.mfab.size()); ++tl) {
groupdata.mfab.at(tl) = make_unique<MultiFab>(
level.grids, level.dmap, groupdata.numvars, ghost_size);
// Allocate grid hierarchies
groupdata.mfab.resize(group.numtimelevels);
for (int tl = 0; tl < int(groupdata.mfab.size()); ++tl) {
groupdata.mfab.at(tl) = make_unique<MultiFab>(
leveldata.grids, leveldata.dmap, groupdata.numvars, ghost_size);
}
for (auto &restrict level : ghext->levels) {
for (auto &restrict groupdata : level.groupdata) {
for (auto &restrict leveldata : ghext->leveldata) {
for (auto &restrict groupdata : leveldata.groupdata) {
for (auto &restrict level : ghext->levels) {
MultiFab &mfab = *level.groupdata.at(0).mfab.at(0);
enter_level_mode(threadGH, level);
for (auto &restrict leveldata : ghext->leveldata) {
MultiFab &mfab = *leveldata.groupdata.at(0).mfab.at(0);
enter_level_mode(threadGH, leveldata);