UZAKARMGORRQG733ZUPJOEGL5FG243I32NCC2SRSFDCZKUQ5A52QC
WASO7G5FJXRXWNH2U2FLUNEKU6VE63OI3HUYP64BVD4LMD6KE7OQC
722HZ7UFINNE3YKSYKP2NHZ5XEG5QQLQHSKC7PREJZR3EX6RDYUAC
RCLGQ2LZMFVPBPTU2G55DJ6HZPOGGTPZRZCY54VGP6YLHANJ2LAQC
UUGQGVC4WEKN64WAP7F5QPS2UHGQB5ZLMFRIYNWKMIEBDO3QRX4AC
BVR7DVINVPQG7PA6Z7QYVYNQ43YZL7XCC6AOMSMWMGAAB2Q43STAC
RTNZAS3UPI6GG3KY4Z5WVXJ4R2YF5427BB6WAV3GHRS5W7XPOSUQC
WE6MDRN5SPK3THM4COLQFE3IUWBCQ5ZYUIAUCBJAZVEMMOVTNBOAC
AEVGZIZEUIC52MCK3J4V547YEV2R4YQL3JUJW7FSP4R34PSZ43DAC
ORAAQXS3UNKXYDJBCTHNEIDJIZDHWMM5EVCZKVMFRKQK2NIQNJGAC
// Allocate grid hierarchy
groupdata.mfab =
MultiFab(level.grids, level.dmap,
groupdata.numvars * groupdata.numtimelevels, 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>(
level.grids, level.dmap, groupdata.numvars, ghost_size);
}
string groupname = unique_ptr<char>(CCTK_GroupName(gi)).get();
groupname = regex_replace(groupname, regex("::"), "-");
for (auto &c : groupname)
c = tolower(c);
ostringstream buf;
buf << "wavetoy/" << groupname;
buf << ".rl" << setw(2) << setfill('0') << level.level;
buf << ".it" << setw(6) << setfill('0') << cctk_iteration;
string filename = buf.str();
string groupname = unique_ptr<char>(CCTK_GroupName(gi)).get();
groupname = regex_replace(groupname, regex("::"), "-");
for (auto &c : groupname)
c = tolower(c);
ostringstream buf;
buf << "wavetoy/" << groupname;
buf << ".rl" << setw(2) << setfill('0') << level.level;
buf << ".it" << setw(6) << setfill('0') << cctk_iteration;
string filename = buf.str();
// TODO: Output only current time level. This might require having one
// mfab per time level
// TODO: Output all levels into a single file
// TODO: Output everything into a single file
WriteSingleLevelPlotfile(filename, groupdata.mfab, varnames, level.geom,
cctk_time, cctk_iteration);
const Array4<CCTK_REAL> &vars = groupdata.mfab.array(mfi);
for (int tl = 0; tl < groupdata.numtimelevels; ++tl)
for (int n = 0; n < groupdata.numvars; ++n)
for (int tl = 0; tl < int(groupdata.mfab.size()); ++tl) {
const Array4<CCTK_REAL> &vars = groupdata.mfab.at(tl)->array(mfi);
for (int n = 0; n < groupdata.numvars; ++n) {
for (int tl = groupdata.numtimelevels - 1; tl > 0; --tl)
MultiFab::Copy(groupdata.mfab, groupdata.mfab,
(tl - 1) * groupdata.numvars, tl * groupdata.numvars,
groupdata.numvars, ghost_size);
const int ntls = groupdata.mfab.size();
if (ntls > 1) {
unique_ptr<MultiFab> tmp = move(groupdata.mfab.at(ntls - 1));
for (int tl = ntls - 1; tl > 0; --tl)
groupdata.mfab.at(tl) = move(groupdata.mfab.at(tl - 1));
groupdata.mfab.at(0) = move(tmp);
}
// we always sync all directions
groupdata.mfab.FillBoundary(level.geom.periodicity());
// We always sync all directions.
// If there is more than one time level, then we don't sync the
// oldest.
int ntls = groupdata.mfab.size();
int sync_tl = ntls > 1 ? ntls - 1 : ntls;
for (int tl = 0; tl < sync_tl; ++tl)
groupdata.mfab.at(tl)->FillBoundary(level.geom.periodicity());