From dd33670ae963cca96f7ae465c59e9372ae520c25 Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Thu, 31 Oct 2019 16:40:10 -0700 Subject: Each call to FillBoundary in regular PIC loop (FDTD) uses fewer guard cells --- Source/Parallelization/GuardCellManager.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'Source/Parallelization/GuardCellManager.cpp') 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 : "<(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 : "<