// Find output groups
const vector<bool> group_enabled = [&] {
vector<bool> enabled(CCTK_NumGroups(), false);
const auto callback{
[](const int index, const char *const optstring, void *const arg) {
vector<bool> &enabled = *static_cast<vector<bool> *>(arg);
enabled.at(CCTK_GroupIndexFromVarI(index)) = true;
}};
CCTK_TraverseString(out_norm_vars, callback, &enabled, CCTK_GROUP_OR_VAR);
if (verbose) {
CCTK_VINFO("TSV output for groups:");
for (int gi = 0; gi < CCTK_NumGroups(); ++gi) {
if (group_enabled.at(gi)) {
char *const groupname = CCTK_GroupName(gi);
CCTK_VINFO(" %s", groupname);
free(groupname);
}
}
}
return enabled;
}();
const auto num_out_groups =
count(group_enabled.begin(), group_enabled.end(), true);
if (num_out_groups == 0)
return;