Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carpet: added logic check to presync recursion #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions Carpet/src/PreSync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,26 @@ void PreSyncGroups(cFunctionData *attribute, cGH *cctkGH,
cctkGH->cctk_time = previous_time;
}

// ask Carpet to do the SYNC, this will apply BC as well
SyncProlongateGroups(cctkGH, pre_groups, attribute);
std::vector<int> check_groups;
std::set<int> tmpgroups;
for (int g = 0; g < pre_groups.size(); g++) {
int gi = pre_groups[g];
for (int vi = 0; vi < CCTK_NumVarsInGroupI(gi); vi++) {
int const map0 = 0;
ggf *const ff = arrdata.AT(gi).AT(map0).data.AT(vi);
assert(ff);
int const valid = ff->valid(mglevel, reflevel, timelevel);
if (not is_set(valid, CCTK_VALID_EVERYWHERE)) {
tmpgroups.insert(gi);
break;
}
}
}
check_groups.assign(tmpgroups.begin(), tmpgroups.end());
if(!check_groups.empty()) {
// ask Carpet to do the SYNC, this will apply BC as well
SyncProlongateGroups(cctkGH, pre_groups, attribute);
}
}

/**
Expand Down