diff options
author | 2021-05-03 12:48:21 -0700 | |
---|---|---|
committer | 2021-05-03 12:48:21 -0700 | |
commit | 1f8862084391fbeb4b87f765eea01beaf5f21074 (patch) | |
tree | 75c526dbafbd6fb14b5602970087552b72ae9f26 /Source/Parallelization/WarpXComm.cpp | |
parent | 7113d7e9ce4fe89c87ba5e2c490a24595f85bc74 (diff) | |
download | WarpX-1f8862084391fbeb4b87f765eea01beaf5f21074.tar.gz WarpX-1f8862084391fbeb4b87f765eea01beaf5f21074.tar.zst WarpX-1f8862084391fbeb4b87f765eea01beaf5f21074.zip |
Implement div(B) Cleaning With FDTD (#1829)
* Implement div(B) Cleaning With FDTD
* Add CI Test
* Clean Up
Diffstat (limited to 'Source/Parallelization/WarpXComm.cpp')
-rw-r--r-- | Source/Parallelization/WarpXComm.cpp | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index d92cffb11..3badbdf2d 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -457,6 +457,15 @@ WarpX::FillBoundaryF (IntVect ng) } void +WarpX::FillBoundaryG (IntVect ng) +{ + for (int lev = 0; lev <= finest_level; ++lev) + { + FillBoundaryG(lev, ng); + } +} + +void WarpX::FillBoundaryB_avg (IntVect ng) { for (int lev = 0; lev <= finest_level; ++lev) @@ -702,7 +711,6 @@ WarpX::FillBoundaryB_avg (int lev, PatchType patch_type, IntVect ng) } } - void WarpX::FillBoundaryF (int lev, IntVect ng) { @@ -753,6 +761,56 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type, IntVect ng) } } +void WarpX::FillBoundaryG (int lev, IntVect ng) +{ + FillBoundaryG(lev, PatchType::fine, ng); + + if (lev > 0) + { + FillBoundaryG(lev, PatchType::coarse, ng); + } +} + +void WarpX::FillBoundaryG (int lev, PatchType patch_type, IntVect ng) +{ + if (patch_type == PatchType::fine && G_fp[lev]) + { + // TODO Exchange in PML cells will go here + + const auto& period = Geom(lev).periodicity(); + + if (safe_guard_cells) + { + G_fp[lev]->FillBoundary(period); + } + else + { + AMREX_ALWAYS_ASSERT_WITH_MESSAGE(ng <= G_fp[lev]->nGrowVect(), + "Error: in FillBoundaryG, requested more guard cells than allocated"); + + G_fp[lev]->FillBoundary(ng, period); + } + } + else if (patch_type == PatchType::coarse && G_cp[lev]) + { + // TODO Exchange in PML cells will go here + + const auto& cperiod = Geom(lev-1).periodicity(); + + if (safe_guard_cells) + { + G_cp[lev]->FillBoundary(cperiod); + } + else + { + AMREX_ALWAYS_ASSERT_WITH_MESSAGE(ng <= G_cp[lev]->nGrowVect(), + "Error: in FillBoundaryG, requested more guard cells than allocated"); + + G_cp[lev]->FillBoundary(ng, cperiod); + } + } +} + void WarpX::FillBoundaryAux (IntVect ng) { |