Skip to content

Commit

Permalink
Merge pull request #187 from eschnett/eschnett/interpolate
Browse files Browse the repository at this point in the history
CarpetX: Add MultiPatch systems
  • Loading branch information
eschnett authored Aug 2, 2023
2 parents be867e1 + c78c8e0 commit 683fcc6
Show file tree
Hide file tree
Showing 10 changed files with 670 additions and 392 deletions.
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

0 comments on commit 683fcc6

Please sign in to comment.