aboutsummaryrefslogtreecommitdiff
path: root/Source/Parallelization
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2021-03-04 10:23:06 -0800
committerGravatar GitHub <noreply@github.com> 2021-03-04 10:23:06 -0800
commitf51c8bdf36077b3f53cc60ea9633f42a6346f103 (patch)
tree5b6f92bf03d9256346fce5a9403b4400b8a4ab09 /Source/Parallelization
parent279e5266ab50977ba8ea7a3ca20e848eb9ba16d2 (diff)
downloadWarpX-f51c8bdf36077b3f53cc60ea9633f42a6346f103.tar.gz
WarpX-f51c8bdf36077b3f53cc60ea9633f42a6346f103.tar.zst
WarpX-f51c8bdf36077b3f53cc60ea9633f42a6346f103.zip
Remove extra ghost cell used with momentum-conserving gathering (#1758)
Diffstat (limited to 'Source/Parallelization')
-rw-r--r--Source/Parallelization/GuardCellManager.H7
-rw-r--r--Source/Parallelization/GuardCellManager.cpp7
-rw-r--r--Source/Parallelization/WarpXComm.cpp32
3 files changed, 16 insertions, 30 deletions
diff --git a/Source/Parallelization/GuardCellManager.H b/Source/Parallelization/GuardCellManager.H
index 0e6daea3e..84aa45d38 100644
--- a/Source/Parallelization/GuardCellManager.H
+++ b/Source/Parallelization/GuardCellManager.H
@@ -42,7 +42,6 @@ public:
const bool do_fdtd_nci_corr,
const bool do_nodal,
const bool do_moving_window,
- const bool aux_is_nodal,
const int moving_window_dir,
const int nox,
const int nox_fft, const int noy_fft, const int noz_fft,
@@ -76,12 +75,6 @@ public:
// Number of guard cells of all MultiFabs that must exchanged before moving window
amrex::IntVect ng_MovingWindow = amrex::IntVect::TheZeroVector();
- // When the auxiliary grid is nodal but the field solver is staggered
- // (typically with momentum-conserving gather with FDTD Yee solver),
- // An extra guard cell is needed on the fine grid to do the interpolation
- // for E and B.
- amrex::IntVect ng_Extra = amrex::IntVect::TheZeroVector();
-
// Number of guard cells for local deposition of J and rho
amrex::IntVect ng_depos_J = amrex::IntVect::TheZeroVector();
amrex::IntVect ng_depos_rho = amrex::IntVect::TheZeroVector();
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp
index cd295b205..541964cef 100644
--- a/Source/Parallelization/GuardCellManager.cpp
+++ b/Source/Parallelization/GuardCellManager.cpp
@@ -22,7 +22,6 @@ guardCellManager::Init (
const bool do_fdtd_nci_corr,
const bool do_nodal,
const bool do_moving_window,
- const bool aux_is_nodal,
const int moving_window_dir,
const int nox,
const int nox_fft, const int noy_fft, const int noz_fft,
@@ -161,8 +160,6 @@ guardCellManager::Init (
ng_alloc_F = IntVect(AMREX_D_DECL(ng_alloc_F_int, ng_alloc_F_int, ng_alloc_F_int));
}
- ng_Extra = IntVect(static_cast<int>(aux_is_nodal and !do_nodal));
-
// Compute number of cells required for Field Solver
if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) {
ng_FieldSolver = ng_alloc_EB;
@@ -189,10 +186,6 @@ guardCellManager::Init (
// Compute number of cells required for Field Gather
int FGcell[4] = {0,1,1,2}; // Index is nox
IntVect ng_FieldGather_noNCI = IntVect(AMREX_D_DECL(FGcell[nox],FGcell[nox],FGcell[nox]));
- // Add one cell if momentum_conserving gather in a staggered-field simulation
- ng_FieldGather_noNCI += ng_Extra;
- // Not sure why, but need one extra guard cell when using MR
- if (max_level >= 1) ng_FieldGather_noNCI += ng_Extra;
ng_FieldGather_noNCI = ng_FieldGather_noNCI.min(ng_alloc_EB);
// If NCI filter, add guard cells in the z direction
IntVect ng_NCIFilter = IntVect::TheZeroVector();
diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp
index caf0c0584..d96106671 100644
--- a/Source/Parallelization/WarpXComm.cpp
+++ b/Source/Parallelization/WarpXComm.cpp
@@ -356,20 +356,20 @@ WarpX::UpdateAuxilaryDataSameType ()
}
void
-WarpX::FillBoundaryB (IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryB (IntVect ng)
{
for (int lev = 0; lev <= finest_level; ++lev)
{
- FillBoundaryB(lev, ng, ng_extra_fine);
+ FillBoundaryB(lev, ng);
}
}
void
-WarpX::FillBoundaryE (IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryE (IntVect ng)
{
for (int lev = 0; lev <= finest_level; ++lev)
{
- FillBoundaryE(lev, ng, ng_extra_fine);
+ FillBoundaryE(lev, ng);
}
}
@@ -383,28 +383,28 @@ WarpX::FillBoundaryF (IntVect ng)
}
void
-WarpX::FillBoundaryB_avg (IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryB_avg (IntVect ng)
{
for (int lev = 0; lev <= finest_level; ++lev)
{
- FillBoundaryB_avg(lev, ng, ng_extra_fine);
+ FillBoundaryB_avg(lev, ng);
}
}
void
-WarpX::FillBoundaryE_avg (IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryE_avg (IntVect ng)
{
for (int lev = 0; lev <= finest_level; ++lev)
{
- FillBoundaryE_avg(lev, ng, ng_extra_fine);
+ FillBoundaryE_avg(lev, ng);
}
}
void
-WarpX::FillBoundaryE(int lev, IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryE(int lev, IntVect ng)
{
- FillBoundaryE(lev, PatchType::fine, ng+ng_extra_fine);
+ FillBoundaryE(lev, PatchType::fine, ng);
if (lev > 0) FillBoundaryE(lev, PatchType::coarse, ng);
}
@@ -464,9 +464,9 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type, IntVect ng)
}
void
-WarpX::FillBoundaryB (int lev, IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryB (int lev, IntVect ng)
{
- FillBoundaryB(lev, PatchType::fine, ng + ng_extra_fine);
+ FillBoundaryB(lev, PatchType::fine, ng);
if (lev > 0) FillBoundaryB(lev, PatchType::coarse, ng);
}
@@ -524,9 +524,9 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type, IntVect ng)
}
void
-WarpX::FillBoundaryE_avg(int lev, IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryE_avg(int lev, IntVect ng)
{
- FillBoundaryE_avg(lev, PatchType::fine, ng+ng_extra_fine);
+ FillBoundaryE_avg(lev, PatchType::fine, ng);
if (lev > 0) FillBoundaryE_avg(lev, PatchType::coarse, ng);
}
@@ -578,9 +578,9 @@ WarpX::FillBoundaryE_avg (int lev, PatchType patch_type, IntVect ng)
void
-WarpX::FillBoundaryB_avg (int lev, IntVect ng, IntVect ng_extra_fine)
+WarpX::FillBoundaryB_avg (int lev, IntVect ng)
{
- FillBoundaryB_avg(lev, PatchType::fine, ng + ng_extra_fine);
+ FillBoundaryB_avg(lev, PatchType::fine, ng);
if (lev > 0) FillBoundaryB_avg(lev, PatchType::coarse, ng);
}