From e53c2b72b6a44b2507377eae9f66fff3bc813f2c Mon Sep 17 00:00:00 2001 From: ablelly Date: Tue, 16 Jul 2019 18:29:37 +0200 Subject: Started to add flag do_pml_in_domain for the merge request. --- Source/Parallelization/WarpXComm.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index 9d85783b0..7c00a5297 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -18,7 +18,7 @@ WarpX::ExchangeWithPmlB (int lev) Bfield_fp[lev][2].get() }, { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }); + Bfield_cp[lev][2].get() }, do_pml_in_domain); } } @@ -31,7 +31,7 @@ WarpX::ExchangeWithPmlE (int lev) Efield_fp[lev][2].get() }, { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), - Efield_cp[lev][2].get() }); + Efield_cp[lev][2].get() }, do_pml_in_domain); } } @@ -40,7 +40,7 @@ WarpX::ExchangeWithPmlF (int lev) { if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeF(F_fp[lev].get(), - F_cp[lev].get()); + F_cp[lev].get(), do_pml_in_domain); } } @@ -252,7 +252,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) pml[lev]->ExchangeE(patch_type, { Efield_fp[lev][0].get(), Efield_fp[lev][1].get(), - Efield_fp[lev][2].get() }); + Efield_fp[lev][2].get() }, do_pml_in_domain); pml[lev]->FillBoundaryE(patch_type); } @@ -267,7 +267,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) pml[lev]->ExchangeE(patch_type, { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), - Efield_cp[lev][2].get() }); + Efield_cp[lev][2].get() }, do_pml_in_domain); pml[lev]->FillBoundaryE(patch_type); } @@ -294,7 +294,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) pml[lev]->ExchangeB(patch_type, { Bfield_fp[lev][0].get(), Bfield_fp[lev][1].get(), - Bfield_fp[lev][2].get() }); + Bfield_fp[lev][2].get() }, do_pml_in_domain); pml[lev]->FillBoundaryB(patch_type); } const auto& period = Geom(lev).periodicity(); @@ -308,7 +308,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) pml[lev]->ExchangeB(patch_type, { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }); + Bfield_cp[lev][2].get() }, do_pml_in_domain); pml[lev]->FillBoundaryB(patch_type); } const auto& cperiod = Geom(lev-1).periodicity(); @@ -331,7 +331,7 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) { if (do_pml && pml[lev]->ok()) { - pml[lev]->ExchangeF(patch_type, F_fp[lev].get()); + pml[lev]->ExchangeF(patch_type, F_fp[lev].get(), do_pml_in_domain); pml[lev]->FillBoundaryF(patch_type); } @@ -342,7 +342,7 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) { if (do_pml && pml[lev]->ok()) { - pml[lev]->ExchangeF(patch_type, F_cp[lev].get()); + pml[lev]->ExchangeF(patch_type, F_cp[lev].get(), do_pml_in_domain); pml[lev]->FillBoundaryF(patch_type); } -- cgit v1.2.3 From 065b2d9eaaaf1dc6edfc62cfbc01291178426e9f Mon Sep 17 00:00:00 2001 From: ablelly Date: Thu, 25 Jul 2019 01:45:29 +0200 Subject: [WIP] Adding flags do_pml_Lo, do_pml_hi --- Source/BoundaryConditions/PML.H | 14 +++---- Source/BoundaryConditions/PML.cpp | 59 ++++++++++++++++-------------- Source/BoundaryConditions/PML_routines.F90 | 2 +- Source/FieldSolver/WarpXPushFieldsEM.cpp | 2 +- Source/Parallelization/WarpXComm.cpp | 18 ++++----- Source/WarpX.H | 4 +- Source/WarpX.cpp | 15 ++++++++ 7 files changed, 67 insertions(+), 47 deletions(-) (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Source/BoundaryConditions/PML.H b/Source/BoundaryConditions/PML.H index c64eb8193..3f64db558 100644 --- a/Source/BoundaryConditions/PML.H +++ b/Source/BoundaryConditions/PML.H @@ -149,25 +149,25 @@ public: { return *sigba_cp; } void ExchangeB (const std::array& B_fp, - const std::array& B_cp, int do_pml_in_domain); + const std::array& B_cp, int do_pml_in_domain, int ncell); void ExchangeE (const std::array& E_fp, - const std::array& E_cp, int do_pml_in_domain); + const std::array& E_cp, int do_pml_in_domain, int ncell); void CopyJinPMLs (const std::array& j_fp, const std::array& j_cp); void CopyJinReg (const std::array& j_fp, const std::array& j_cp); void ExchangeB (PatchType patch_type, - const std::array& Bp, int do_pml_in_domain); + const std::array& Bp, int do_pml_in_domain, int ncell); void ExchangeE (PatchType patch_type, - const std::array& Ep, int do_pml_in_domain); + const std::array& Ep, int do_pml_in_domain, int ncell); void CopyJinPMLs (PatchType patch_type, const std::array& jp); void CopyJinReg (PatchType patch_type, const std::array& jp); - void ExchangeF (amrex::MultiFab* F_fp, amrex::MultiFab* F_cp, int do_pml_in_domain); - void ExchangeF (PatchType patch_type, amrex::MultiFab* Fp, int do_pml_in_domain); + void ExchangeF (amrex::MultiFab* F_fp, amrex::MultiFab* F_cp, int do_pml_in_domain, int ncell); + void ExchangeF (PatchType patch_type, amrex::MultiFab* Fp, int do_pml_in_domain, int ncell); void FillBoundary (); void FillBoundaryE (); @@ -205,7 +205,7 @@ private: static amrex::BoxArray MakeBoxArray (const amrex::Geometry& geom, const amrex::BoxArray& grid_ba, int ncell); - static void Exchange (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom, int do_pml_in_domain); + static void Exchange (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom, int do_pml_in_domain, int ncell); static void CopyRegInPMLs (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom); static void CopyPMLsInReg (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom); }; diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp index 51107b498..0e6c24131 100644 --- a/Source/BoundaryConditions/PML.cpp +++ b/Source/BoundaryConditions/PML.cpp @@ -708,53 +708,53 @@ PML::GetF_cp () void PML::ExchangeB (const std::array& B_fp, - const std::array& B_cp, int do_pml_in_domain) + const std::array& B_cp, int do_pml_in_domain, int ncell) { - ExchangeB(PatchType::fine, B_fp, do_pml_in_domain); - ExchangeB(PatchType::coarse, B_cp, do_pml_in_domain); + ExchangeB(PatchType::fine, B_fp, do_pml_in_domain, ncell); + ExchangeB(PatchType::coarse, B_cp, do_pml_in_domain, ncell); } void PML::ExchangeB (PatchType patch_type, - const std::array& Bp, int do_pml_in_domain) + const std::array& Bp, int do_pml_in_domain, int ncell) { if (patch_type == PatchType::fine && pml_B_fp[0] && Bp[0]) { - Exchange(*pml_B_fp[0], *Bp[0], *m_geom, do_pml_in_domain); - Exchange(*pml_B_fp[1], *Bp[1], *m_geom, do_pml_in_domain); - Exchange(*pml_B_fp[2], *Bp[2], *m_geom, do_pml_in_domain); + Exchange(*pml_B_fp[0], *Bp[0], *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_B_fp[1], *Bp[1], *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_B_fp[2], *Bp[2], *m_geom, do_pml_in_domain, ncell); } else if (patch_type == PatchType::coarse && pml_B_cp[0] && Bp[0]) { - Exchange(*pml_B_cp[0], *Bp[0], *m_cgeom, do_pml_in_domain); - Exchange(*pml_B_cp[1], *Bp[1], *m_cgeom, do_pml_in_domain); - Exchange(*pml_B_cp[2], *Bp[2], *m_cgeom, do_pml_in_domain); + Exchange(*pml_B_cp[0], *Bp[0], *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_B_cp[1], *Bp[1], *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_B_cp[2], *Bp[2], *m_cgeom, do_pml_in_domain, ncell); } } void PML::ExchangeE (const std::array& E_fp, - const std::array& E_cp, int do_pml_in_domain) + const std::array& E_cp, int do_pml_in_domain, int ncell) { - ExchangeE(PatchType::fine, E_fp, do_pml_in_domain); - ExchangeE(PatchType::coarse, E_cp, do_pml_in_domain); + ExchangeE(PatchType::fine, E_fp, do_pml_in_domain, ncell); + ExchangeE(PatchType::coarse, E_cp, do_pml_in_domain, ncell); } void PML::ExchangeE (PatchType patch_type, - const std::array& Ep, int do_pml_in_domain) + const std::array& Ep, int do_pml_in_domain, int ncell) { if (patch_type == PatchType::fine && pml_E_fp[0] && Ep[0]) { - Exchange(*pml_E_fp[0], *Ep[0], *m_geom, do_pml_in_domain); - Exchange(*pml_E_fp[1], *Ep[1], *m_geom, do_pml_in_domain); - Exchange(*pml_E_fp[2], *Ep[2], *m_geom, do_pml_in_domain); + Exchange(*pml_E_fp[0], *Ep[0], *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_E_fp[1], *Ep[1], *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_E_fp[2], *Ep[2], *m_geom, do_pml_in_domain, ncell); } else if (patch_type == PatchType::coarse && pml_E_cp[0] && Ep[0]) { - Exchange(*pml_E_cp[0], *Ep[0], *m_cgeom, do_pml_in_domain); - Exchange(*pml_E_cp[1], *Ep[1], *m_cgeom, do_pml_in_domain); - Exchange(*pml_E_cp[2], *Ep[2], *m_cgeom, do_pml_in_domain); + Exchange(*pml_E_cp[0], *Ep[0], *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_E_cp[1], *Ep[1], *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_E_cp[2], *Ep[2], *m_cgeom, do_pml_in_domain, ncell); } } @@ -811,29 +811,32 @@ PML::CopyJinReg (const std::array& j_fp, } void -PML::ExchangeF (MultiFab* F_fp, MultiFab* F_cp, int do_pml_in_domain) +PML::ExchangeF (MultiFab* F_fp, MultiFab* F_cp, int do_pml_in_domain, int ncell) { - ExchangeF(PatchType::fine, F_fp, do_pml_in_domain); - ExchangeF(PatchType::coarse, F_cp, do_pml_in_domain); + ExchangeF(PatchType::fine, F_fp, do_pml_in_domain, ncell); + ExchangeF(PatchType::coarse, F_cp, do_pml_in_domain, ncell); } void -PML::ExchangeF (PatchType patch_type, MultiFab* Fp, int do_pml_in_domain) +PML::ExchangeF (PatchType patch_type, MultiFab* Fp, int do_pml_in_domain, int ncell) { if (patch_type == PatchType::fine && pml_F_fp && Fp) { - Exchange(*pml_F_fp, *Fp, *m_geom, do_pml_in_domain); + Exchange(*pml_F_fp, *Fp, *m_geom, do_pml_in_domain, ncell); } else if (patch_type == PatchType::coarse && pml_F_cp && Fp) { - Exchange(*pml_F_cp, *Fp, *m_cgeom, do_pml_in_domain); + Exchange(*pml_F_cp, *Fp, *m_cgeom, do_pml_in_domain, ncell); } } void -PML::Exchange (MultiFab& pml, MultiFab& reg, const Geometry& geom, int do_pml_in_domain) +PML::Exchange (MultiFab& pml, MultiFab& reg, const Geometry& geom, int do_pml_in_domain, int ncell) { if (do_pml_in_domain){ const IntVect& ngr = reg.nGrowVect(); const IntVect& ngp = pml.nGrowVect(); + // amrex::Print()<< "##### PML EXCHANGE #####"<ok()) { - if (F) pml[lev]->ExchangeF(patch_type, F, do_pml_in_domain); + if (F) pml[lev]->ExchangeF(patch_type, F, do_pml_in_domain, pml_ncell); const auto& pml_B = (patch_type == PatchType::fine) ? pml[lev]->GetB_fp() : pml[lev]->GetB_cp(); const auto& pml_E = (patch_type == PatchType::fine) ? pml[lev]->GetE_fp() : pml[lev]->GetE_cp(); diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index 7c00a5297..17d87c73f 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -18,7 +18,7 @@ WarpX::ExchangeWithPmlB (int lev) Bfield_fp[lev][2].get() }, { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }, do_pml_in_domain); + Bfield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); } } @@ -31,7 +31,7 @@ WarpX::ExchangeWithPmlE (int lev) Efield_fp[lev][2].get() }, { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), - Efield_cp[lev][2].get() }, do_pml_in_domain); + Efield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); } } @@ -40,7 +40,7 @@ WarpX::ExchangeWithPmlF (int lev) { if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeF(F_fp[lev].get(), - F_cp[lev].get(), do_pml_in_domain); + F_cp[lev].get(), do_pml_in_domain, pml_ncell); } } @@ -252,7 +252,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) pml[lev]->ExchangeE(patch_type, { Efield_fp[lev][0].get(), Efield_fp[lev][1].get(), - Efield_fp[lev][2].get() }, do_pml_in_domain); + Efield_fp[lev][2].get() }, do_pml_in_domain, pml_ncell); pml[lev]->FillBoundaryE(patch_type); } @@ -267,7 +267,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) pml[lev]->ExchangeE(patch_type, { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), - Efield_cp[lev][2].get() }, do_pml_in_domain); + Efield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); pml[lev]->FillBoundaryE(patch_type); } @@ -294,7 +294,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) pml[lev]->ExchangeB(patch_type, { Bfield_fp[lev][0].get(), Bfield_fp[lev][1].get(), - Bfield_fp[lev][2].get() }, do_pml_in_domain); + Bfield_fp[lev][2].get() }, do_pml_in_domain, pml_ncell); pml[lev]->FillBoundaryB(patch_type); } const auto& period = Geom(lev).periodicity(); @@ -308,7 +308,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) pml[lev]->ExchangeB(patch_type, { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }, do_pml_in_domain); + Bfield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); pml[lev]->FillBoundaryB(patch_type); } const auto& cperiod = Geom(lev-1).periodicity(); @@ -331,7 +331,7 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) { if (do_pml && pml[lev]->ok()) { - pml[lev]->ExchangeF(patch_type, F_fp[lev].get(), do_pml_in_domain); + pml[lev]->ExchangeF(patch_type, F_fp[lev].get(), do_pml_in_domain, pml_ncell); pml[lev]->FillBoundaryF(patch_type); } @@ -342,7 +342,7 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) { if (do_pml && pml[lev]->ok()) { - pml[lev]->ExchangeF(patch_type, F_cp[lev].get(), do_pml_in_domain); + pml[lev]->ExchangeF(patch_type, F_cp[lev].get(), do_pml_in_domain, pml_ncell); pml[lev]->FillBoundaryF(patch_type); } diff --git a/Source/WarpX.H b/Source/WarpX.H index 54cad9ae0..20db5c75d 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -489,10 +489,12 @@ private: // PML int do_pml = 1; int pml_ncell = 10; - int pml_delta = 10; + int pml_delta = 5; int pml_has_particles = 0; int do_pml_j_damping = 0; int do_pml_in_domain = 0; + amrex::IntVect do_pml_Lo; + amrex::IntVect do_pml_Hi; amrex::Vector > pml; amrex::Real moving_window_x = std::numeric_limits::max(); diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 08a8b7b88..46b1926a0 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -384,6 +384,21 @@ WarpX::ReadParameters () pp.query("do_pml_j_damping", do_pml_j_damping); pp.query("do_pml_in_domain", do_pml_in_domain); + Vector parse_do_pml_Lo(AMREX_SPACEDIM,1); + pp.queryarr("do_pml_Lo", parse_do_pml_Lo); + do_pml_Lo[0] = parse_do_pml_Lo[0]; + do_pml_Lo[1] = parse_do_pml_Lo[1]; +#if (AMREX_SPACEDIM == 3) + do_pml_Lo[2] = parse_do_pml_Lo[2]; +#endif + Vector parse_do_pml_Hi(AMREX_SPACEDIM,1); + pp.queryarr("do_pml_Hi", parse_do_pml_Hi); + do_pml_Hi[0] = parse_do_pml_Hi[0]; + do_pml_Hi[1] = parse_do_pml_Hi[1]; +#if (AMREX_SPACEDIM == 3) + do_pml_Hi[2] = parse_do_pml_Hi[2]; +#endif + if ( (do_pml_j_damping==1)&&(do_pml_in_domain==0) ){ amrex::Abort("J-damping can only be done when PML are inside simulation domain (do_pml_in_domain=1)"); } -- cgit v1.2.3 From c619b64253695f797121fc91def7c722a72ba3ab Mon Sep 17 00:00:00 2001 From: ablelly Date: Fri, 2 Aug 2019 20:15:56 +0200 Subject: Modifications for communications --- Source/BoundaryConditions/PML.H | 24 +++- Source/BoundaryConditions/PML.cpp | 154 ++++++++++++++----------- Source/Evolve/WarpXEvolveEM.cpp | 26 ++--- Source/Parallelization/WarpXComm.cpp | 36 ++++-- Source/Particles/PhysicalParticleContainer.cpp | 25 ++++ 5 files changed, 169 insertions(+), 96 deletions(-) (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Source/BoundaryConditions/PML.H b/Source/BoundaryConditions/PML.H index ca200d6e5..9601dfec9 100644 --- a/Source/BoundaryConditions/PML.H +++ b/Source/BoundaryConditions/PML.H @@ -152,25 +152,37 @@ public: { return *sigba_cp; } void ExchangeB (const std::array& B_fp, - const std::array& B_cp, int do_pml_in_domain, int ncell); + const std::array& B_cp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), + const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); void ExchangeE (const std::array& E_fp, - const std::array& E_cp, int do_pml_in_domain, int ncell); + const std::array& E_cp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), + const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); void CopyJinPMLs (const std::array& j_fp, const std::array& j_cp); void CopyJinReg (const std::array& j_fp, const std::array& j_cp); void ExchangeB (PatchType patch_type, - const std::array& Bp, int do_pml_in_domain, int ncell); + const std::array& Bp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), + const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); void ExchangeE (PatchType patch_type, - const std::array& Ep, int do_pml_in_domain, int ncell); + const std::array& Ep, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), + const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); void CopyJinPMLs (PatchType patch_type, const std::array& jp); void CopyJinReg (PatchType patch_type, const std::array& jp); - void ExchangeF (amrex::MultiFab* F_fp, amrex::MultiFab* F_cp, int do_pml_in_domain, int ncell); - void ExchangeF (PatchType patch_type, amrex::MultiFab* Fp, int do_pml_in_domain, int ncell); + void ExchangeF (amrex::MultiFab* F_fp, amrex::MultiFab* F_cp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), + const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + void ExchangeF (PatchType patch_type, amrex::MultiFab* Fp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), + const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); void FillBoundary (); void FillBoundaryE (); diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp index f880ebc56..3c75d358f 100644 --- a/Source/BoundaryConditions/PML.cpp +++ b/Source/BoundaryConditions/PML.cpp @@ -738,53 +738,57 @@ PML::GetF_cp () void PML::ExchangeB (const std::array& B_fp, - const std::array& B_cp, int do_pml_in_domain, int ncell) + const std::array& B_cp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) { - ExchangeB(PatchType::fine, B_fp, do_pml_in_domain, ncell); - ExchangeB(PatchType::coarse, B_cp, do_pml_in_domain, ncell); + ExchangeB(PatchType::fine, B_fp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + ExchangeB(PatchType::coarse, B_cp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } void PML::ExchangeB (PatchType patch_type, - const std::array& Bp, int do_pml_in_domain, int ncell) + const std::array& Bp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) { if (patch_type == PatchType::fine && pml_B_fp[0] && Bp[0]) { - Exchange(*pml_B_fp[0], *Bp[0], *m_geom, do_pml_in_domain, ncell); - Exchange(*pml_B_fp[1], *Bp[1], *m_geom, do_pml_in_domain, ncell); - Exchange(*pml_B_fp[2], *Bp[2], *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_B_fp[0], *Bp[0], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_B_fp[1], *Bp[1], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_B_fp[2], *Bp[2], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } else if (patch_type == PatchType::coarse && pml_B_cp[0] && Bp[0]) { - Exchange(*pml_B_cp[0], *Bp[0], *m_cgeom, do_pml_in_domain, ncell); - Exchange(*pml_B_cp[1], *Bp[1], *m_cgeom, do_pml_in_domain, ncell); - Exchange(*pml_B_cp[2], *Bp[2], *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_B_cp[0], *Bp[0], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_B_cp[1], *Bp[1], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_B_cp[2], *Bp[2], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } } void PML::ExchangeE (const std::array& E_fp, - const std::array& E_cp, int do_pml_in_domain, int ncell) + const std::array& E_cp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) { - ExchangeE(PatchType::fine, E_fp, do_pml_in_domain, ncell); - ExchangeE(PatchType::coarse, E_cp, do_pml_in_domain, ncell); + ExchangeE(PatchType::fine, E_fp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + ExchangeE(PatchType::coarse, E_cp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } void PML::ExchangeE (PatchType patch_type, - const std::array& Ep, int do_pml_in_domain, int ncell) + const std::array& Ep, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) { if (patch_type == PatchType::fine && pml_E_fp[0] && Ep[0]) { - Exchange(*pml_E_fp[0], *Ep[0], *m_geom, do_pml_in_domain, ncell); - Exchange(*pml_E_fp[1], *Ep[1], *m_geom, do_pml_in_domain, ncell); - Exchange(*pml_E_fp[2], *Ep[2], *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_E_fp[0], *Ep[0], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_E_fp[1], *Ep[1], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_E_fp[2], *Ep[2], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } else if (patch_type == PatchType::coarse && pml_E_cp[0] && Ep[0]) { - Exchange(*pml_E_cp[0], *Ep[0], *m_cgeom, do_pml_in_domain, ncell); - Exchange(*pml_E_cp[1], *Ep[1], *m_cgeom, do_pml_in_domain, ncell); - Exchange(*pml_E_cp[2], *Ep[2], *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_E_cp[0], *Ep[0], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_E_cp[1], *Ep[1], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_E_cp[2], *Ep[2], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } } @@ -841,19 +845,21 @@ PML::CopyJinReg (const std::array& j_fp, } void -PML::ExchangeF (MultiFab* F_fp, MultiFab* F_cp, int do_pml_in_domain, int ncell) +PML::ExchangeF (MultiFab* F_fp, MultiFab* F_cp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) { - ExchangeF(PatchType::fine, F_fp, do_pml_in_domain, ncell); - ExchangeF(PatchType::coarse, F_cp, do_pml_in_domain, ncell); + ExchangeF(PatchType::fine, F_fp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + ExchangeF(PatchType::coarse, F_cp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } void -PML::ExchangeF (PatchType patch_type, MultiFab* Fp, int do_pml_in_domain, int ncell) +PML::ExchangeF (PatchType patch_type, MultiFab* Fp, int do_pml_in_domain, int ncell, + const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) { if (patch_type == PatchType::fine && pml_F_fp && Fp) { - Exchange(*pml_F_fp, *Fp, *m_geom, do_pml_in_domain, ncell); + Exchange(*pml_F_fp, *Fp, *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } else if (patch_type == PatchType::coarse && pml_F_cp && Fp) { - Exchange(*pml_F_cp, *Fp, *m_cgeom, do_pml_in_domain, ncell); + Exchange(*pml_F_cp, *Fp, *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); } } @@ -881,8 +887,18 @@ PML::Exchange (MultiFab& pml, MultiFab& reg, const Geometry& geom, int do_pml_in MultiFab::Add(totpmlmf,pml,2,0,1,0); } totpmlmf.setVal(0.0, 1, ncp-1, 0); - // reg.ParallelCopy(totpmlmf, 0, 0, 1, IntVect(0), ngr, period); //old - reg.ParallelCopy(totpmlmf, 0, 0, 1, IntVect(0), IntVect(0), period); //new + // reg.ParallelCopy(totpmlmf, 0, 0, 1, IntVect(0), ngr, period); //old - not really working + reg.ParallelCopy(totpmlmf, 0, 0, 1, IntVect(0), IntVect(0), period); //new - works better + + // amrex::Print()<<"##### BOXES EXCHANGE PML #####"< 0) // Copy from pml to the ghost cells of regular data { @@ -890,50 +906,53 @@ PML::Exchange (MultiFab& pml, MultiFab& reg, const Geometry& geom, int do_pml_in MultiFab::Copy(totpmlmf, pml, 0, 0, ncp, ngp); tmpregmf.setVal(0.0, 1, ncp-1, 0); - // totpmlmf.ParallelCopy(tmpregmf,0, 0, 1, IntVect(0), ngp, period); + // ce qui foncitonne a peu pres pour le moment tmpregmf.ParallelCopy(totpmlmf,0, 0, ncp, IntVect(0), IntVect(0), period); - // totpmlmf.ParallelCopy(tmpregmf,0, 0, 1, ngr, ngp, period); totpmlmf.ParallelCopy(tmpregmf,0, 0, ncp, IntVect(0), ngp, period); + + MultiFab::Copy(pml, totpmlmf, 0, 0, ncp, ngp); //test // #ifdef _OPENMP // #pragma omp parallel // #endif - // amrex::Print()<<"####### EXCHANGE INFORMATIONS GHOST CELLS PML #######"<>> EXCHANGE BOXES <<<<<" <>> EXCHANGE BOXES <<<<<" <ok()){ - pml[lev]->CopyJinReg({ current_fp[lev][0].get(), - current_fp[lev][1].get(), - current_fp[lev][2].get() }, - { current_cp[lev][0].get(), - current_cp[lev][1].get(), - current_cp[lev][2].get() }); - } - } - } + // if (do_pml && pml_has_particles){ + // for (int lev = 0; lev <= finest_level; ++lev) + // { + // if (pml[lev]->ok()){ + // pml[lev]->CopyJinReg({ current_fp[lev][0].get(), + // current_fp[lev][1].get(), + // current_fp[lev][2].get() }, + // { current_cp[lev][0].get(), + // current_cp[lev][1].get(), + // current_cp[lev][2].get() }); + // } + // } + // } EvolveB(0.5*dt[0]); // We now have B^{n+1} if (do_pml) { diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index 17d87c73f..06cbf157a 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -18,7 +18,9 @@ WarpX::ExchangeWithPmlB (int lev) Bfield_fp[lev][2].get() }, { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); + Bfield_cp[lev][2].get() }, + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); } } @@ -31,7 +33,9 @@ WarpX::ExchangeWithPmlE (int lev) Efield_fp[lev][2].get() }, { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), - Efield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); + Efield_cp[lev][2].get() }, + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); } } @@ -40,7 +44,9 @@ WarpX::ExchangeWithPmlF (int lev) { if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeF(F_fp[lev].get(), - F_cp[lev].get(), do_pml_in_domain, pml_ncell); + F_cp[lev].get(), + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); } } @@ -252,7 +258,9 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) pml[lev]->ExchangeE(patch_type, { Efield_fp[lev][0].get(), Efield_fp[lev][1].get(), - Efield_fp[lev][2].get() }, do_pml_in_domain, pml_ncell); + Efield_fp[lev][2].get() }, + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryE(patch_type); } @@ -267,7 +275,9 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) pml[lev]->ExchangeE(patch_type, { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), - Efield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); + Efield_cp[lev][2].get() }, + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryE(patch_type); } @@ -294,7 +304,9 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) pml[lev]->ExchangeB(patch_type, { Bfield_fp[lev][0].get(), Bfield_fp[lev][1].get(), - Bfield_fp[lev][2].get() }, do_pml_in_domain, pml_ncell); + Bfield_fp[lev][2].get() }, + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryB(patch_type); } const auto& period = Geom(lev).periodicity(); @@ -308,7 +320,9 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) pml[lev]->ExchangeB(patch_type, { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell); + Bfield_cp[lev][2].get() }, + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryB(patch_type); } const auto& cperiod = Geom(lev-1).periodicity(); @@ -331,7 +345,9 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) { if (do_pml && pml[lev]->ok()) { - pml[lev]->ExchangeF(patch_type, F_fp[lev].get(), do_pml_in_domain, pml_ncell); + pml[lev]->ExchangeF(patch_type, F_fp[lev].get(), + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryF(patch_type); } @@ -342,7 +358,9 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) { if (do_pml && pml[lev]->ok()) { - pml[lev]->ExchangeF(patch_type, F_cp[lev].get(), do_pml_in_domain, pml_ncell); + pml[lev]->ExchangeF(patch_type, F_cp[lev].get(), + do_pml_in_domain, pml_ncell, + do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryF(patch_type); } diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index ae4d80552..f4b218947 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -1518,6 +1518,31 @@ PhysicalParticleContainer::Evolve (int lev, BL_PROFILE_VAR_STOP(blp_pxr_fg); + // auto& attribs = pti.GetAttribs(); + // + // Real* AMREX_RESTRICT zzp = m_zp[thread_num].dataPtr(); + // Real* AMREX_RESTRICT exp = attribs[PIdx::Ex].dataPtr(); + // Real* AMREX_RESTRICT eyp = attribs[PIdx::Ey].dataPtr(); + // Real* AMREX_RESTRICT ezp = attribs[PIdx::Ez].dataPtr(); + // Real* AMREX_RESTRICT bxp = attribs[PIdx::Bx].dataPtr(); + // Real* AMREX_RESTRICT byp = attribs[PIdx::By].dataPtr(); + // Real* AMREX_RESTRICT bzp = attribs[PIdx::Bz].dataPtr(); + // // const std::array& xyzmax_grid = WarpX::UpperCorner(box, lev); + // + // const long np = pti.numParticles(); + // + // ParallelFor( np_gather, + // [=] AMREX_GPU_DEVICE (long i) { + // if (zzp[i] < xyzmin_grid[1] + 20 * dx[1]){ //xyzmin_grid[2] + 10 * dx[2] + // exp[i] = 0.; + // eyp[i] = 0.; + // ezp[i] = 0.; + // bxp[i] = 0.; + // byp[i] = 0.; + // bzp[i] = 0.; + // } + // } + // ); // // Particle Push // -- cgit v1.2.3 From 7a5adaa22b1e1830b2046aba6ba38de90c96138c Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Wed, 21 Aug 2019 13:13:23 -0700 Subject: Code cleanup + add test --- Examples/Tests/particles_in_PML/analysis_2d.py | 26 ++++++ Examples/Tests/particles_in_PML/inputs2d | 56 ++++++++++++ Source/BoundaryConditions/PML.cpp | 115 ++----------------------- Source/Evolve/WarpXEvolveEM.cpp | 18 +--- Source/FieldSolver/WarpXPushFieldsEM.cpp | 1 - Source/Parallelization/WarpXComm.cpp | 12 +-- Source/Particles/PhysicalParticleContainer.cpp | 32 +++---- Source/WarpX.H | 1 - Source/WarpX.cpp | 1 - 9 files changed, 113 insertions(+), 149 deletions(-) create mode 100755 Examples/Tests/particles_in_PML/analysis_2d.py create mode 100644 Examples/Tests/particles_in_PML/inputs2d (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Examples/Tests/particles_in_PML/analysis_2d.py b/Examples/Tests/particles_in_PML/analysis_2d.py new file mode 100755 index 000000000..5b0279a9b --- /dev/null +++ b/Examples/Tests/particles_in_PML/analysis_2d.py @@ -0,0 +1,26 @@ +""" +This script tests the absorption of particles in the PML. + +The input file inputs_2d is used: it features a positive and a +negative particle, going in opposite direction and eventually +leaving the box. This script tests that the field in the box +is close to 0 once the particles have left. With regular +PML, this test fails, since the particles leave a spurious +charge, with associated fields, behind them. +""" +import sys +import yt +import numpy as np +yt.funcs.mylog.setLevel(0) + +# Open plotfile specified in command line +filename = sys.argv[1] +ds = yt.load( filename ) + +# Check that the field is low enough +ad0 = ds.covering_grid(level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions) +Ex_array = ad0['Ex'].to_ndarray() +Ey_array = ad0['Ey'].to_ndarray() +Ez_array = ad0['Ez'].to_ndarray() +max_Efield = max(Ex_array.max(), Ey_array.max(), Ez_array.max()) +assert max_Efield < 0.0003 \ No newline at end of file diff --git a/Examples/Tests/particles_in_PML/inputs2d b/Examples/Tests/particles_in_PML/inputs2d new file mode 100644 index 000000000..733032c53 --- /dev/null +++ b/Examples/Tests/particles_in_PML/inputs2d @@ -0,0 +1,56 @@ +max_step = 200 +amr.plot_int = 30 +amr.n_cell = 224 224 + +amr.blocking_factor = 8 +amr.max_grid_size = 1024 +amr.max_level = 0 + +warpx.dump_plotfiles = 1 + +# Geometry +geometry.coord_sys = 0 # 0: Cartesian +geometry.is_periodic = 0 0 # Is periodic? +geometry.prob_lo = -32.e-6 -32.e-6 # physical domain +geometry.prob_hi = 32.e-6 32.e-6 + +# PML +warpx.do_pml = 1 +warpx.pml_ncell = 12 +warpx.pml_delta = 6 +warpx.pml_has_particles = 0 +warpx.do_pml_in_domain = 0 +warpx.do_pml_j_damping = 0 + + +# Algorithms +algo.current_deposition = esirkepov +algo.charge_deposition = standard +algo.field_gathering = vectorized +algo.particle_pusher = vay +algo.maxwell_fdtd_solver = ckc +warpx.cfl = 1.0 +warpx.use_filter = 1 + +# Particle species +particles.nspecies = 2 +particles.species_names = electron proton + +electron.charge = -q_e +electron.mass = m_e +electron.injection_style = "singleparticle" +electron.single_particle_pos = 0. 0. 0. +electron.single_particle_vel = 2. 0. 0. +electron.single_particle_weight = 1. + +proton.charge = q_e +proton.mass = m_p # Very heavy ; should not move +proton.injection_style = "singleparticle" +proton.single_particle_pos = 0. 0. 0. +proton.single_particle_vel = -2. 0. 0. +proton.single_particle_weight = 1. + +# Particle shape factor in each direction +interpolation.nox = 3 +interpolation.noy = 3 +interpolation.noz = 3 diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp index 0b73859b4..15f18201b 100644 --- a/Source/BoundaryConditions/PML.cpp +++ b/Source/BoundaryConditions/PML.cpp @@ -24,22 +24,19 @@ namespace int slo = sigma.m_lo; int shi = sigma.m_hi; int sslo = sigma_star.m_lo; - Real x = 10.0; - Real theta = 10.0; - Real coeff_damp = 1.; //std::sin(theta*MathConst::pi/180.); for (int i = olo; i <= ohi+1; ++i) { Real offset = static_cast(glo-i); sigma[i-slo] = fac*(offset*offset); - sigma_cum[i-slo] = coeff_damp*(fac*(offset*offset*offset)/3.)/(PhysConst::c*x/std::sqrt(1+x*x)); + sigma_cum[i-slo] = (fac*(offset*offset*offset)/3.)/PhysConst::c; } for (int i = olo; i <= ohi; ++i) { Real offset = static_cast(glo-i) - 0.5; sigma_star[i-sslo] = fac*(offset*offset); - sigma_star_cum[i-sslo] = coeff_damp*(fac*(offset*offset*offset)/3.)/(PhysConst::c*x/std::sqrt(1+x*x)); + sigma_star_cum[i-sslo] = (fac*(offset*offset*offset)/3.)/PhysConst::c; } } @@ -52,20 +49,17 @@ namespace int slo = sigma.m_lo; int shi = sigma.m_hi; int sslo = sigma_star.m_lo; - Real x = 10.0; - Real theta = 10.0; - Real coeff_damp = 1.;//std::sin(theta*MathConst::pi/180.); for (int i = olo; i <= ohi+1; ++i) { Real offset = static_cast(i-ghi-1); sigma[i-slo] = fac*(offset*offset); - sigma_cum[i-slo] = coeff_damp*(fac*(offset*offset*offset)/3.)/(PhysConst::c*x/std::sqrt(1+x*x)); + sigma_cum[i-slo] = coeff_damp*(fac*(offset*offset*offset)/3.)/PhysConst::c; } for (int i = olo; i <= ohi; ++i) { Real offset = static_cast(i-ghi) - 0.5; sigma_star[i-sslo] = fac*(offset*offset); - sigma_star_cum[i-sslo] = coeff_damp*(fac*(offset*offset*offset)/3.)/(PhysConst::c*x/std::sqrt(1+x*x)); + sigma_star_cum[i-sslo] = coeff_damp*(fac*(offset*offset*offset)/3.)/PhysConst::c; } } @@ -119,8 +113,6 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n sigma_star_cum_fac[idim].m_hi = hi[idim]; } - amrex::Print()< 0){pml_type[2]=idim+'0';} //std::to_string(idim) + if (idim > 0){pml_type[2]=idim+'0';} } const Box& hibox = amrex::adjCellHi(grid_box, idim, ncell); Box hioverlap = hibox & box; if (hioverlap.ok()) { - amrex::Print()<<"["< 1, Box gaps not wide enough?\n"); } } - amrex::Print()< 0) // Copy from pml to the ghost cells of regular data { - MultiFab::Copy(tmpregmf, reg, 0, 0, 1, IntVect(0)); //ngr); + MultiFab::Copy(tmpregmf, reg, 0, 0, 1, IntVect(0)); MultiFab::Copy(totpmlmf, pml, 0, 0, ncp, ngp); tmpregmf.setVal(0.0, 1, ncp-1, 0); - // ce qui foncitonne a peu pres pour le moment tmpregmf.ParallelCopy(totpmlmf,0, 0, ncp, IntVect(0), IntVect(0), period); totpmlmf.ParallelCopy(tmpregmf,0, 0, ncp, IntVect(0), ngp, period); - MultiFab::Copy(pml, totpmlmf, 0, 0, ncp, ngp); //test -// #ifdef _OPENMP -// #pragma omp parallel -// #endif - // // amrex::Print()<<"####### EXCHANGE INFORMATIONS GHOST CELLS PML #######"<>> EXCHANGE BOXES <<<<<" <>> EXCHANGE BOXES <<<<<" < 0 && step < load_balance_max_step && (step+1) % load_balance_int == 0) + if (step > 0 && (step+1) % load_balance_int == 0) { LoadBalance(); // Reset the costs to 0 @@ -329,22 +329,6 @@ WarpX::OneStep_nosub (Real cur_time) EvolveE(dt[0]); // We now have E^{n+1} FillBoundaryE(); EvolveF(0.5*dt[0], DtType::SecondHalf); - - - // if (do_pml && pml_has_particles){ - // for (int lev = 0; lev <= finest_level; ++lev) - // { - // if (pml[lev]->ok()){ - // pml[lev]->CopyJinReg({ current_fp[lev][0].get(), - // current_fp[lev][1].get(), - // current_fp[lev][2].get() }, - // { current_cp[lev][0].get(), - // current_cp[lev][1].get(), - // current_cp[lev][2].get() }); - // } - // } - // } - EvolveB(0.5*dt[0]); // We now have B^{n+1} if (do_pml) { DampPML(); diff --git a/Source/FieldSolver/WarpXPushFieldsEM.cpp b/Source/FieldSolver/WarpXPushFieldsEM.cpp index 18c98b8f8..011d9cfcc 100644 --- a/Source/FieldSolver/WarpXPushFieldsEM.cpp +++ b/Source/FieldSolver/WarpXPushFieldsEM.cpp @@ -241,7 +241,6 @@ WarpX::EvolveB (int lev, PatchType patch_type, amrex::Real a_dt) { const auto& pml_B = (patch_type == PatchType::fine) ? pml[lev]->GetB_fp() : pml[lev]->GetB_cp(); const auto& pml_E = (patch_type == PatchType::fine) ? pml[lev]->GetE_fp() : pml[lev]->GetE_cp(); - // const auto& pml_j = (patch_type == PatchType::fine) ? pml[lev]->Getj_fp() : pml[lev]->Getj_cp(); #ifdef _OPENMP #pragma omp parallel if (Gpu::notInLaunchRegion()) diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index 06cbf157a..c539cd89a 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -256,7 +256,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeE(patch_type, - { Efield_fp[lev][0].get(), + { Efield_fp[lev][0].get(), Efield_fp[lev][1].get(), Efield_fp[lev][2].get() }, do_pml_in_domain, pml_ncell, @@ -273,7 +273,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeE(patch_type, - { Efield_cp[lev][0].get(), + { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), Efield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell, @@ -302,7 +302,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeB(patch_type, - { Bfield_fp[lev][0].get(), + { Bfield_fp[lev][0].get(), Bfield_fp[lev][1].get(), Bfield_fp[lev][2].get() }, do_pml_in_domain, pml_ncell, @@ -318,9 +318,9 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeB(patch_type, - { Bfield_cp[lev][0].get(), - Bfield_cp[lev][1].get(), - Bfield_cp[lev][2].get() }, + { Bfield_cp[lev][0].get(), + Bfield_cp[lev][1].get(), + Bfield_cp[lev][2].get() }, do_pml_in_domain, pml_ncell, do_pml_Lo, do_pml_Hi); pml[lev]->FillBoundaryB(patch_type); diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 20819a78c..d10390204 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -33,7 +33,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp pp.query("do_splitting", do_splitting); pp.query("split_type", split_type); pp.query("do_continuous_injection", do_continuous_injection); - // Whether to plot back-transformed (lab-frame) diagnostics + // Whether to plot back-transformed (lab-frame) diagnostics // for this species. pp.query("do_boosted_frame_diags", do_boosted_frame_diags); @@ -42,7 +42,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp do_user_plot_vars = pp.queryarr("plot_vars", plot_vars); if (not do_user_plot_vars){ // By default, all particle variables are dumped to plotfiles, - // including {x,y,z,ux,uy,uz}old variables when running in a + // including {x,y,z,ux,uy,uz}old variables when running in a // boosted frame if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags){ plot_flags.resize(PIdx::nattribs + 6, 1); @@ -59,9 +59,9 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp // If not none, set plot_flags values to 1 for elements in plot_vars. if (plot_vars[0] != "none"){ for (const auto& var : plot_vars){ - // Return error if var not in PIdx. - AMREX_ALWAYS_ASSERT_WITH_MESSAGE( - ParticleStringNames::to_index.count(var), + // Return error if var not in PIdx. + AMREX_ALWAYS_ASSERT_WITH_MESSAGE( + ParticleStringNames::to_index.count(var), "plot_vars argument not in ParticleStringNames"); plot_flags[ParticleStringNames::to_index.at(var)] = 1; } @@ -130,7 +130,7 @@ void PhysicalParticleContainer::MapParticletoBoostedFrame(Real& x, Real& y, Real void PhysicalParticleContainer::AddGaussianBeam(Real x_m, Real y_m, Real z_m, Real x_rms, Real y_rms, Real z_rms, - Real q_tot, long npart, + Real q_tot, long npart, int do_symmetrize) { const Geometry& geom = m_gdb->Geom(0); @@ -203,7 +203,7 @@ PhysicalParticleContainer::CheckAndAddParticle(Real x, Real y, Real z, particle_tile.push_back_real(particle_comps["xold"], x); particle_tile.push_back_real(particle_comps["yold"], y); particle_tile.push_back_real(particle_comps["zold"], z); - + particle_tile.push_back_real(particle_comps["uxold"], u[0]); particle_tile.push_back_real(particle_comps["uyold"], u[1]); particle_tile.push_back_real(particle_comps["uzold"], u[2]); @@ -931,11 +931,11 @@ PhysicalParticleContainer::Evolve (int lev, BL_PROFILE_VAR_NS("PICSAR::FieldGather", blp_pxr_fg); BL_PROFILE_VAR_NS("PPC::ParticlePush", blp_ppc_pp); BL_PROFILE_VAR_NS("PPC::Evolve::partition", blp_partition); - + const std::array& dx = WarpX::CellSize(lev); const std::array& cdx = WarpX::CellSize(std::max(lev-1,0)); - // Get instances of NCI Godfrey filters + // Get instances of NCI Godfrey filters const auto& nci_godfrey_filter_exeybz = WarpX::GetInstance().nci_godfrey_filter_exeybz; const auto& nci_godfrey_filter_bxbyez = WarpX::GetInstance().nci_godfrey_filter_bxbyez; @@ -949,7 +949,7 @@ PhysicalParticleContainer::Evolve (int lev, bool has_buffer = cEx || cjx; #ifdef _OPENMP -#pragma omp parallel +#pragma omp parallel #endif { #ifdef _OPENMP @@ -1227,13 +1227,13 @@ PhysicalParticleContainer::Evolve (int lev, eyeli = filtered_Ey.elixir(); nci_godfrey_filter_exeybz[lev-1]->ApplyStencil(filtered_Ey, (*cEy)[pti], filtered_Ey.box()); ceyfab = &filtered_Ey; - + // Filter Bx filtered_Bx.resize(amrex::convert(tbox,WarpX::Bx_nodal_flag)); bxeli = filtered_Bx.elixir(); nci_godfrey_filter_bxbyez[lev-1]->ApplyStencil(filtered_Bx, (*cBx)[pti], filtered_Bx.box()); cbxfab = &filtered_Bx; - + // Filter Bz filtered_Bz.resize(amrex::convert(tbox,WarpX::Bz_nodal_flag)); bzeli = filtered_Bz.elixir(); @@ -1453,7 +1453,7 @@ PhysicalParticleContainer::SplitParticles(int lev) } // Add local arrays psplit_x etc. to the temporary // particle container pctmp_split. Split particles - // are tagged with p.id()=NoSplitParticleID so that + // are tagged with p.id()=NoSplitParticleID so that // they are not re-split when entering a higher level // AddNParticles calls Redistribute, so that particles // in pctmp_split are in the proper grids and tiles @@ -1550,7 +1550,7 @@ PhysicalParticleContainer::PushP (int lev, Real dt, int thread_num = omp_get_thread_num(); #else int thread_num = 0; -#endif +#endif for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { const Box& box = pti.validbox(); @@ -1694,7 +1694,7 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real slice_box.setHi(direction, z_max); diagnostic_particles.resize(finestLevel()+1); - + for (int lev = 0; lev < nlevs; ++lev) { const Real* dx = Geom(lev).CellSize(); @@ -1776,7 +1776,7 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real Real uzp = uz_old_p *weight_old + uz_new_p *weight_new; diagnostic_particles[lev][index].GetRealData(DiagIdx::w).push_back(wp[i]); - + diagnostic_particles[lev][index].GetRealData(DiagIdx::x).push_back(xp); diagnostic_particles[lev][index].GetRealData(DiagIdx::y).push_back(yp); diagnostic_particles[lev][index].GetRealData(DiagIdx::z).push_back(zp); diff --git a/Source/WarpX.H b/Source/WarpX.H index b4dfe9ae4..3e8d45f49 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -524,7 +524,6 @@ private: amrex::Real const_dt = 0.5e-11; int load_balance_int = -1; - int load_balance_max_step = std::numeric_limits::max(); amrex::Vector > costs; int load_balance_with_sfc = 0; amrex::Real load_balance_knapsack_factor = 1.24; diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 6abf27216..305fedbb4 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -498,7 +498,6 @@ WarpX::ReadParameters () } pp.query("load_balance_int", load_balance_int); - pp.query("load_balance_max_step", load_balance_max_step); pp.query("load_balance_with_sfc", load_balance_with_sfc); pp.query("load_balance_knapsack_factor", load_balance_knapsack_factor); -- cgit v1.2.3 From a025c00a7436299a754879edae0d70abe5fec1d3 Mon Sep 17 00:00:00 2001 From: ablelly Date: Thu, 29 Aug 2019 22:32:01 +0200 Subject: Removed useless variables in PML Exchange functions --- Source/BoundaryConditions/PML.H | 28 ++++----------- Source/BoundaryConditions/PML.cpp | 62 ++++++++++++++------------------ Source/FieldSolver/WarpXPushFieldsEM.cpp | 2 +- Source/Parallelization/WarpXComm.cpp | 27 +++++--------- 4 files changed, 44 insertions(+), 75 deletions(-) (limited to 'Source/Parallelization/WarpXComm.cpp') diff --git a/Source/BoundaryConditions/PML.H b/Source/BoundaryConditions/PML.H index ad7326dbb..0a9b23b7f 100644 --- a/Source/BoundaryConditions/PML.H +++ b/Source/BoundaryConditions/PML.H @@ -134,33 +134,21 @@ public: #endif void ExchangeB (const std::array& B_fp, - const std::array& B_cp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + const std::array& B_cp, int do_pml_in_domain); void ExchangeE (const std::array& E_fp, - const std::array& E_cp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + const std::array& E_cp, int do_pml_in_domain); void CopyJtoPMLs (const std::array& j_fp, const std::array& j_cp); void ExchangeB (PatchType patch_type, - const std::array& Bp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + const std::array& Bp, int do_pml_in_domain); void ExchangeE (PatchType patch_type, - const std::array& Ep, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + const std::array& Ep, int do_pml_in_domain); void CopyJtoPMLs (PatchType patch_type, const std::array& jp); - void ExchangeF (amrex::MultiFab* F_fp, amrex::MultiFab* F_cp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); - void ExchangeF (PatchType patch_type, amrex::MultiFab* Fp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + void ExchangeF (amrex::MultiFab* F_fp, amrex::MultiFab* F_cp, int do_pml_in_domain); + void ExchangeF (PatchType patch_type, amrex::MultiFab* Fp, int do_pml_in_domain); void FillBoundary (); void FillBoundaryE (); @@ -205,9 +193,7 @@ private: const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); - static void Exchange (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo = amrex::IntVect::TheUnitVector(), - const amrex::IntVect do_pml_Hi = amrex::IntVect::TheUnitVector()); + static void Exchange (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom, int do_pml_in_domain); static void CopyToPML (amrex::MultiFab& pml, amrex::MultiFab& reg, const amrex::Geometry& geom); }; diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp index 8c35e34e2..7d1906525 100644 --- a/Source/BoundaryConditions/PML.cpp +++ b/Source/BoundaryConditions/PML.cpp @@ -638,57 +638,53 @@ PML::GetF_cp () void PML::ExchangeB (const std::array& B_fp, - const std::array& B_cp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) + const std::array& B_cp, int do_pml_in_domain) { - ExchangeB(PatchType::fine, B_fp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - ExchangeB(PatchType::coarse, B_cp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + ExchangeB(PatchType::fine, B_fp, do_pml_in_domain); + ExchangeB(PatchType::coarse, B_cp, do_pml_in_domain); } void PML::ExchangeB (PatchType patch_type, - const std::array& Bp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) + const std::array& Bp, int do_pml_in_domain) { if (patch_type == PatchType::fine && pml_B_fp[0] && Bp[0]) { - Exchange(*pml_B_fp[0], *Bp[0], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_B_fp[1], *Bp[1], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_B_fp[2], *Bp[2], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_B_fp[0], *Bp[0], *m_geom, do_pml_in_domain); + Exchange(*pml_B_fp[1], *Bp[1], *m_geom, do_pml_in_domain); + Exchange(*pml_B_fp[2], *Bp[2], *m_geom, do_pml_in_domain); } else if (patch_type == PatchType::coarse && pml_B_cp[0] && Bp[0]) { - Exchange(*pml_B_cp[0], *Bp[0], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_B_cp[1], *Bp[1], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_B_cp[2], *Bp[2], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_B_cp[0], *Bp[0], *m_cgeom, do_pml_in_domain); + Exchange(*pml_B_cp[1], *Bp[1], *m_cgeom, do_pml_in_domain); + Exchange(*pml_B_cp[2], *Bp[2], *m_cgeom, do_pml_in_domain); } } void PML::ExchangeE (const std::array& E_fp, - const std::array& E_cp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) + const std::array& E_cp, int do_pml_in_domain) { - ExchangeE(PatchType::fine, E_fp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - ExchangeE(PatchType::coarse, E_cp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + ExchangeE(PatchType::fine, E_fp, do_pml_in_domain); + ExchangeE(PatchType::coarse, E_cp, do_pml_in_domain); } void PML::ExchangeE (PatchType patch_type, - const std::array& Ep, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) + const std::array& Ep, int do_pml_in_domain) { if (patch_type == PatchType::fine && pml_E_fp[0] && Ep[0]) { - Exchange(*pml_E_fp[0], *Ep[0], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_E_fp[1], *Ep[1], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_E_fp[2], *Ep[2], *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_E_fp[0], *Ep[0], *m_geom, do_pml_in_domain); + Exchange(*pml_E_fp[1], *Ep[1], *m_geom, do_pml_in_domain); + Exchange(*pml_E_fp[2], *Ep[2], *m_geom, do_pml_in_domain); } else if (patch_type == PatchType::coarse && pml_E_cp[0] && Ep[0]) { - Exchange(*pml_E_cp[0], *Ep[0], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_E_cp[1], *Ep[1], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - Exchange(*pml_E_cp[2], *Ep[2], *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_E_cp[0], *Ep[0], *m_cgeom, do_pml_in_domain); + Exchange(*pml_E_cp[1], *Ep[1], *m_cgeom, do_pml_in_domain); + Exchange(*pml_E_cp[2], *Ep[2], *m_cgeom, do_pml_in_domain); } } @@ -720,30 +716,26 @@ PML::CopyJtoPMLs (const std::array& j_fp, void -PML::ExchangeF (MultiFab* F_fp, MultiFab* F_cp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) +PML::ExchangeF (MultiFab* F_fp, MultiFab* F_cp, int do_pml_in_domain) { - ExchangeF(PatchType::fine, F_fp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); - ExchangeF(PatchType::coarse, F_cp, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + ExchangeF(PatchType::fine, F_fp, do_pml_in_domain); + ExchangeF(PatchType::coarse, F_cp, do_pml_in_domain); } void -PML::ExchangeF (PatchType patch_type, MultiFab* Fp, int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, const amrex::IntVect do_pml_Hi) +PML::ExchangeF (PatchType patch_type, MultiFab* Fp, int do_pml_in_domain) { if (patch_type == PatchType::fine && pml_F_fp && Fp) { - Exchange(*pml_F_fp, *Fp, *m_geom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_F_fp, *Fp, *m_geom, do_pml_in_domain); } else if (patch_type == PatchType::coarse && pml_F_cp && Fp) { - Exchange(*pml_F_cp, *Fp, *m_cgeom, do_pml_in_domain, ncell, do_pml_Lo, do_pml_Hi); + Exchange(*pml_F_cp, *Fp, *m_cgeom, do_pml_in_domain); } } void PML::Exchange (MultiFab& pml, MultiFab& reg, const Geometry& geom, - int do_pml_in_domain, int ncell, - const amrex::IntVect do_pml_Lo, - const amrex::IntVect do_pml_Hi) + int do_pml_in_domain) { if (do_pml_in_domain){ const IntVect& ngr = reg.nGrowVect(); diff --git a/Source/FieldSolver/WarpXPushFieldsEM.cpp b/Source/FieldSolver/WarpXPushFieldsEM.cpp index 94e49f0bc..dae18002d 100644 --- a/Source/FieldSolver/WarpXPushFieldsEM.cpp +++ b/Source/FieldSolver/WarpXPushFieldsEM.cpp @@ -461,7 +461,7 @@ WarpX::EvolveE (int lev, PatchType patch_type, amrex::Real a_dt) if (do_pml && pml[lev]->ok()) { - if (F) pml[lev]->ExchangeF(patch_type, F, do_pml_in_domain, pml_ncell); + if (F) pml[lev]->ExchangeF(patch_type, F, do_pml_in_domain); const auto& pml_B = (patch_type == PatchType::fine) ? pml[lev]->GetB_fp() : pml[lev]->GetB_cp(); const auto& pml_E = (patch_type == PatchType::fine) ? pml[lev]->GetE_fp() : pml[lev]->GetE_cp(); diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index c539cd89a..feb9d3564 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -19,8 +19,7 @@ WarpX::ExchangeWithPmlB (int lev) { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), Bfield_cp[lev][2].get() }, - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); } } @@ -34,8 +33,7 @@ WarpX::ExchangeWithPmlE (int lev) { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), Efield_cp[lev][2].get() }, - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); } } @@ -45,8 +43,7 @@ WarpX::ExchangeWithPmlF (int lev) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeF(F_fp[lev].get(), F_cp[lev].get(), - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); } } @@ -259,8 +256,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) { Efield_fp[lev][0].get(), Efield_fp[lev][1].get(), Efield_fp[lev][2].get() }, - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); pml[lev]->FillBoundaryE(patch_type); } @@ -276,8 +272,7 @@ WarpX::FillBoundaryE (int lev, PatchType patch_type) { Efield_cp[lev][0].get(), Efield_cp[lev][1].get(), Efield_cp[lev][2].get() }, - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); pml[lev]->FillBoundaryE(patch_type); } @@ -305,8 +300,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) { Bfield_fp[lev][0].get(), Bfield_fp[lev][1].get(), Bfield_fp[lev][2].get() }, - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); pml[lev]->FillBoundaryB(patch_type); } const auto& period = Geom(lev).periodicity(); @@ -321,8 +315,7 @@ WarpX::FillBoundaryB (int lev, PatchType patch_type) { Bfield_cp[lev][0].get(), Bfield_cp[lev][1].get(), Bfield_cp[lev][2].get() }, - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); pml[lev]->FillBoundaryB(patch_type); } const auto& cperiod = Geom(lev-1).periodicity(); @@ -346,8 +339,7 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeF(patch_type, F_fp[lev].get(), - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); pml[lev]->FillBoundaryF(patch_type); } @@ -359,8 +351,7 @@ WarpX::FillBoundaryF (int lev, PatchType patch_type) if (do_pml && pml[lev]->ok()) { pml[lev]->ExchangeF(patch_type, F_cp[lev].get(), - do_pml_in_domain, pml_ncell, - do_pml_Lo, do_pml_Hi); + do_pml_in_domain); pml[lev]->FillBoundaryF(patch_type); } -- cgit v1.2.3