From 1140e9f8c3c20c969363dddfc184696f27c2ac72 Mon Sep 17 00:00:00 2001 From: David Grote Date: Mon, 26 Oct 2020 13:09:50 -0700 Subject: Filter diagnostic rho (#1295) * First cut of adding filtering of rho diagnostic - not yet working * Fixed the handling of parallel transfers in RhoFunctor when filtering is turned on * Fixed end of line space * In RhoFunctor, only do kspace filter with RZ and PSATD * PICMI analytic applied fields (#1306) * PICMI Added applied fields * PICMI fixed typo in Constants * Change picmistandard version requirement to 0.0.9 * Increment required picmi version Co-authored-by: Remi Lehe * Updated checksums with filter of diagnostic rho * Fix comment in rho diagnostic * Updated LaserIonAcc2d benchmark after filtering rho * Update galilean_rz_psatd benchmark with filtering of rho Co-authored-by: Remi Lehe --- Source/Parallelization/WarpXComm.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index 667be0696..daee24054 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -873,17 +873,23 @@ void WarpX::ApplyFilterandSumBoundaryRho (int lev, PatchType patch_type, int icomp, int ncomp) { const int glev = (patch_type == PatchType::fine) ? lev : lev-1; - const auto& period = Geom(glev).periodicity(); auto& r = (patch_type == PatchType::fine) ? rho_fp[lev] : rho_cp[lev]; if (r == nullptr) return; + ApplyFilterandSumBoundaryRho(lev, glev, *r, icomp, ncomp); +} + +void +WarpX::ApplyFilterandSumBoundaryRho (int lev, int glev, amrex::MultiFab& rho, int icomp, int ncomp) +{ + const auto& period = Geom(glev).periodicity(); if (use_filter) { - IntVect ng = r->nGrowVect(); + IntVect ng = rho.nGrowVect(); ng += bilinear_filter.stencil_length_each_dir-1; - MultiFab rf(r->boxArray(), r->DistributionMap(), ncomp, ng); - bilinear_filter.ApplyStencil(rf, *r, icomp, 0, ncomp); - WarpXSumGuardCells(*r, rf, period, icomp, ncomp ); + MultiFab rf(rho.boxArray(), rho.DistributionMap(), ncomp, ng); + bilinear_filter.ApplyStencil(rf, rho, icomp, 0, ncomp); + WarpXSumGuardCells(rho, rf, period, icomp, ncomp ); } else { - WarpXSumGuardCells(*r, period, icomp, ncomp); + WarpXSumGuardCells(rho, period, icomp, ncomp); } } -- cgit v1.2.3