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

CarpetX: Add MultiPatch systems #187

Merged
merged 16 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions CarpetX/src/driver.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1332,13 +1332,13 @@ GHExt::PatchData::LevelData::LevelData(const int patch, const int level,
cGH *const cctkGH = ghext->get_level_cctkGH(level);
enter_patch_mode(cctkGH, leveldata);
patch_cctkGH = GHExt::cctkGHptr(copy_cctkGH(cctkGH));
int block = 0;
int component = 0;
const auto mfitinfo = amrex::MFItInfo().EnableTiling();
for (amrex::MFIter mfi(*leveldata.fab, mfitinfo); mfi.isValid();
++mfi, ++block) {
++mfi, ++component) {
const MFPointer mfp(mfi);
enter_local_mode(cctkGH, leveldata, mfp);
assert(int(local_cctkGHs.size()) == block);
assert(int(local_cctkGHs.size()) == component);
local_cctkGHs.emplace_back(copy_cctkGH(cctkGH));
leave_local_mode(cctkGH, leveldata, mfp);
}
Expand Down Expand Up @@ -1494,7 +1494,7 @@ void GHExt::PatchData::LevelData::GroupData::apply_boundary_conditions(
if (geom.isPeriodic(d))
gdomain.grow(d, mfab.nGrow(d));

loop_over_blocks(mfab, [&](int index, int block) {
loop_over_components(mfab, [&](int index, int component) {
amrex::FArrayBox &dest = mfab[index];
// const amrex::Box &box = mfp.fabbox();
// const amrex::Box &box = dest.box();
Expand Down
10 changes: 5 additions & 5 deletions CarpetX/src/driver.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ struct GHExt {
unique_ptr<amrex::FabArrayBase> fab;

cctkGHptr patch_cctkGH;
vector<cctkGHptr> local_cctkGHs; // [block]
vector<cctkGHptr> local_cctkGHs; // [component]

cGH *get_patch_cctkGH() const { return patch_cctkGH.get(); }
cGH *get_local_cctkGH(const int block) const {
return local_cctkGHs.at(block).get();
cGH *get_local_cctkGH(const int component) const {
return local_cctkGHs.at(component).get();
}

struct GroupData : public CommonGroupData {
Expand Down Expand Up @@ -330,10 +330,10 @@ struct GHExt {
return patchdata.at(patch).leveldata.at(level).patch_cctkGH.get();
}
cGH *get_local_cctkGH(const int level, const int patch,
const int block) const {
const int component) const {
return patchdata.at(patch)
.leveldata.at(level)
.local_cctkGHs.at(block)
.local_cctkGHs.at(component)
.get();
}

Expand Down
Loading