aboutsummaryrefslogtreecommitdiff
path: root/Source/Parallelization
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Parallelization')
-rw-r--r--Source/Parallelization/GuardCellManager.H1
-rw-r--r--Source/Parallelization/GuardCellManager.cpp27
-rw-r--r--Source/Parallelization/WarpXComm.cpp49
3 files changed, 51 insertions, 26 deletions
diff --git a/Source/Parallelization/GuardCellManager.H b/Source/Parallelization/GuardCellManager.H
index e241eed75..93f1e9fd1 100644
--- a/Source/Parallelization/GuardCellManager.H
+++ b/Source/Parallelization/GuardCellManager.H
@@ -32,6 +32,7 @@ public:
// Guard cells to exchange data
amrex::IntVect ng_FieldSolver = amrex::IntVect::TheZeroVector();
amrex::IntVect ng_FieldGather = amrex::IntVect::TheZeroVector();
+ amrex::IntVect ng_FieldGatherAndNCIFilter = amrex::IntVect::TheZeroVector();
amrex::IntVect ngJ_CurrentDepo = amrex::IntVect::TheZeroVector();
amrex::IntVect ng_MovingWindow = amrex::IntVect::TheZeroVector();
amrex::IntVect ng_NCIFilter = amrex::IntVect::TheZeroVector();
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp
index a67e15eb7..9f3e5b18d 100644
--- a/Source/Parallelization/GuardCellManager.cpp
+++ b/Source/Parallelization/GuardCellManager.cpp
@@ -110,7 +110,7 @@ guardCellManager::Init(
ng_required = std::max( ng_required, ngE[i_dim] );
ng_required = std::max( ng_required, ngJ[i_dim] );
ng_required = std::max( ng_required, ngRho[i_dim] );
- ng_required = std::max( ng_required, ngF[i_dim] );
+v ng_required = std::max( ng_required, ngF[i_dim] );
// Set the guard cells to this max
ngE[i_dim] = ng_required;
ngJ[i_dim] = ng_required;
@@ -122,11 +122,6 @@ guardCellManager::Init(
ngF = IntVect(AMREX_D_DECL(ngF_int, ngF_int, ngF_int));
#endif
- Print()<<"rrr ngE : "<<ngE <<'\n';
- Print()<<"rrr ngJ : "<<ngJ <<'\n';
- Print()<<"rrr ngRho: "<<ngRho<<'\n';
- Print()<<"rrr ngF : "<<ngF <<'\n';
-
ngExtra = IntVect(static_cast<int>(aux_is_nodal and !do_nodal));
// Guard cells for field solver
@@ -134,12 +129,28 @@ guardCellManager::Init(
ng_MovingWindow = IntVect(AMREX_D_DECL(0,0,0)); // Multiplied by number of cells moved at each timestep
ng_MovingWindow[moving_window_dir] = 1;
int FGcell[4] = {0,1,1,2}; // Index is nox
- ng_FieldGather = IntVect(AMREX_D_DECL(FGcell[nox],FGcell[nox],FGcell[nox]));
- ngJ_CurrentDepo = ng_FieldGather;
+ ng_FieldGather = IntVect(AMREX_D_DECL(FGcell[nox],FGcell[nox],FGcell[nox])) + 2*ngExtra;
+
+ ng_FieldGather = ng_FieldGather.min(ngE);
if (do_fdtd_nci_corr){
ng_NCIFilter = IntVect::TheZeroVector();
ng_NCIFilter[AMREX_SPACEDIM-1] = 4;
}
+
+ ng_FieldGatherAndNCIFilter = ng_FieldGather + ng_NCIFilter;
+ ng_FieldGatherAndNCIFilter = ng_FieldGatherAndNCIFilter.min(ngE);
+
ng_Aux = 2*ng_FieldGather+ng_NCIFilter;
ng_Aux = ng_Aux.min(ngE);
+
+ Print()<<"rrr ngE : "<<ngE <<'\n';
+ Print()<<"rrr ngJ : "<<ngJ <<'\n';
+ Print()<<"rrr ngRho : "<<ngRho <<'\n';
+ Print()<<"rrr ngF : "<<ngF <<'\n';
+ Print()<<"rrr ng_Aux: "<<ng_Aux<<'\n';
+
+ Print()<<"ttt ng_FieldSolver "<< ng_FieldSolver <<'\n';
+ Print()<<"ttt ng_FieldGather "<< ng_FieldGather <<'\n';
+ Print()<<"ttt ngJ_CurrentDepo "<< ngJ_CurrentDepo <<'\n';
+ Print()<<"ttt ngExtra "<< ngExtra <<'\n';
}
diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp
index 7d2473f30..60f6f3db0 100644
--- a/Source/Parallelization/WarpXComm.cpp
+++ b/Source/Parallelization/WarpXComm.cpp
@@ -2,6 +2,7 @@
#include <WarpX.H>
#include <WarpX_f.H>
#include <WarpXSumGuardCells.H>
+#include "WarpXAlgorithmSelection.H"
#include <Parallelization/InterpolateCurrentFineToCoarse.H>
#include <Parallelization/InterpolateDensityFineToCoarse.H>
@@ -321,20 +322,20 @@ WarpX::UpdateAuxilaryDataSameType ()
}
void
-WarpX::FillBoundaryB (IntVect ng)
+WarpX::FillBoundaryB (IntVect ng, IntVect ng_extra_fine)
{
for (int lev = 0; lev <= finest_level; ++lev)
{
- FillBoundaryB(lev, ng);
+ FillBoundaryB(lev, ng, ng_extra_fine);
}
}
void
-WarpX::FillBoundaryE (IntVect ng)
+WarpX::FillBoundaryE (IntVect ng, IntVect ng_extra_fine)
{
for (int lev = 0; lev <= finest_level; ++lev)
{
- FillBoundaryE(lev, ng);
+ FillBoundaryE(lev, ng, ng_extra_fine);
}
}
@@ -348,9 +349,11 @@ WarpX::FillBoundaryF (IntVect ng)
}
void
-WarpX::FillBoundaryE(int lev, IntVect ng)
+WarpX::FillBoundaryE(int lev, IntVect ng, IntVect ng_extra_fine)
{
- FillBoundaryE(lev, PatchType::fine, ng);
+ Print()<<"FillBoundaryE ng_extra_fine "<< ng_extra_fine <<'\n';
+ Print()<<"FillBoundaryE exchanges "<< ng+ng_extra_fine <<'\n';
+ FillBoundaryE(lev, PatchType::fine, ng+ng_extra_fine);
if (lev > 0) FillBoundaryE(lev, PatchType::coarse, ng);
}
@@ -370,11 +373,12 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type, IntVect ng)
}
const auto& period = Geom(lev).periodicity();
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ ng <= Efield_fp[lev][0]->nGrowVect(),
+ "Error: in FillBoundaryE, requested more guard cells than allocated");
Efield_fp[lev][0]->FillBoundary(0, Efield_fp[lev][0]->nComp(), ng, period);
Efield_fp[lev][1]->FillBoundary(0, Efield_fp[lev][1]->nComp(), ng, period);
Efield_fp[lev][2]->FillBoundary(0, Efield_fp[lev][2]->nComp(), ng, period);
- // Vector<MultiFab*> mf{Efield_fp[lev][0].get(),Efield_fp[lev][1].get(),Efield_fp[lev][2].get()};
- // amrex::FillBoundary(mf, period);
}
else if (patch_type == PatchType::coarse)
{
@@ -389,18 +393,21 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type, IntVect ng)
}
const auto& cperiod = Geom(lev-1).periodicity();
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ ng <= Efield_cp[lev][0]->nGrowVect(),
+ "Error: in FillBoundaryE, requested more guard cells than allocated");
Efield_cp[lev][0]->FillBoundary(0, Efield_cp[lev][0]->nComp(), ng, cperiod);
Efield_cp[lev][1]->FillBoundary(0, Efield_cp[lev][1]->nComp(), ng, cperiod);
Efield_cp[lev][2]->FillBoundary(0, Efield_cp[lev][2]->nComp(), ng, cperiod);
- // Vector<MultiFab*> mf{Efield_cp[lev][0].get(),Efield_cp[lev][1].get(),Efield_cp[lev][2].get()};
- // amrex::FillBoundary(mf, cperiod);
}
}
void
-WarpX::FillBoundaryB (int lev, IntVect ng)
+WarpX::FillBoundaryB (int lev, IntVect ng, IntVect ng_extra_fine)
{
- FillBoundaryB(lev, PatchType::fine, ng);
+ Print()<<"FillBoundaryB ng_extra_fine "<< ng_extra_fine <<'\n';
+ Print()<<"FillBoundaryB exchanges "<< ng+ng_extra_fine <<'\n';
+ FillBoundaryB(lev, PatchType::fine, ng + ng_extra_fine);
if (lev > 0) FillBoundaryB(lev, PatchType::coarse, ng);
}
@@ -419,11 +426,12 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type, IntVect ng)
pml[lev]->FillBoundaryB(patch_type);
}
const auto& period = Geom(lev).periodicity();
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ ng <= Bfield_fp[lev][0]->nGrowVect(),
+ "Error: in FillBoundaryB, requested more guard cells than allocated");
Bfield_fp[lev][0]->FillBoundary(0, Bfield_fp[lev][0]->nComp(), ng, period);
Bfield_fp[lev][1]->FillBoundary(0, Bfield_fp[lev][1]->nComp(), ng, period);
Bfield_fp[lev][2]->FillBoundary(0, Bfield_fp[lev][2]->nComp(), ng, period);
- // Vector<MultiFab*> mf{Bfield_fp[lev][0].get(),Bfield_fp[lev][1].get(),Bfield_fp[lev][2].get()};
- // amrex::FillBoundary(mf, period);
}
else if (patch_type == PatchType::coarse)
{
@@ -437,11 +445,12 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type, IntVect ng)
pml[lev]->FillBoundaryB(patch_type);
}
const auto& cperiod = Geom(lev-1).periodicity();
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ ng <= Bfield_cp[lev][0]->nGrowVect(),
+ "Error: in FillBoundaryB, requested more guard cells than allocated");
Bfield_cp[lev][0]->FillBoundary(0, Bfield_cp[lev][0]->nComp(), ng, cperiod);
Bfield_cp[lev][1]->FillBoundary(0, Bfield_cp[lev][1]->nComp(), ng, cperiod);
Bfield_cp[lev][2]->FillBoundary(0, Bfield_cp[lev][2]->nComp(), ng, cperiod);
- // Vector<MultiFab*> mf{Bfield_cp[lev][0].get(),Bfield_cp[lev][1].get(),Bfield_cp[lev][2].get()};
- // amrex::FillBoundary(mf, cperiod);
}
}
@@ -465,8 +474,10 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type, IntVect ng)
}
const auto& period = Geom(lev).periodicity();
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ ng <= F_fp[lev]->nGrowVect(),
+ "Error: in FillBoundaryF, requested more guard cells than allocated");
F_fp[lev]->FillBoundary(0, F_fp[lev]->nComp(), ng, period);
- // F_fp[lev]->FillBoundary(period);
}
else if (patch_type == PatchType::coarse && F_cp[lev])
{
@@ -478,8 +489,10 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type, IntVect ng)
}
const auto& cperiod = Geom(lev-1).periodicity();
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ ng <= F_cp[lev]->nGrowVect(),
+ "Error: in FillBoundaryF, requested more guard cells than allocated");
F_cp[lev]->FillBoundary(0, F_cp[lev]->nComp(), ng, cperiod);
- // F_cp[lev]->FillBoundary(cperiod);
}
}