From 8d35c76154e4de1022fa75b0b4060ce47c3fe56d Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Mon, 24 Sep 2018 12:52:23 -0700 Subject: also use a buffer region for charge deposition --- Source/WarpX.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/WarpX.cpp') diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index ea54db2b7..009f31b73 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -161,6 +161,7 @@ WarpX::WarpX () current_buffer_masks.resize(nlevs_max); gather_buffer_masks.resize(nlevs_max); current_buf.resize(nlevs_max); + charge_buf.resize(nlevs_max); pml.resize(nlevs_max); @@ -463,6 +464,8 @@ WarpX::ClearLevel (int lev) current_buf[lev][i].reset(); } + charge_buf[lev].reset(); + current_buffer_masks[lev].reset(); gather_buffer_masks[lev].reset(); @@ -644,6 +647,7 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d current_buf[lev][0].reset( new MultiFab(amrex::convert(cba,jx_nodal_flag),dm,1,ngJ)); current_buf[lev][1].reset( new MultiFab(amrex::convert(cba,jy_nodal_flag),dm,1,ngJ)); current_buf[lev][2].reset( new MultiFab(amrex::convert(cba,jz_nodal_flag),dm,1,ngJ)); + charge_buf[lev].reset( new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho)); current_buffer_masks[lev].reset( new iMultiFab(ba, dm, 1, 0) ); } } -- cgit v1.2.3 From d22f38e55e466a50c32f67f721f87d55e37e6995 Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Mon, 24 Sep 2018 13:12:32 -0700 Subject: only turn on the current buffers if dive cleaning is on. --- Source/WarpX.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source/WarpX.cpp') diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 009f31b73..9ca17c759 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -647,7 +647,9 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d current_buf[lev][0].reset( new MultiFab(amrex::convert(cba,jx_nodal_flag),dm,1,ngJ)); current_buf[lev][1].reset( new MultiFab(amrex::convert(cba,jy_nodal_flag),dm,1,ngJ)); current_buf[lev][2].reset( new MultiFab(amrex::convert(cba,jz_nodal_flag),dm,1,ngJ)); - charge_buf[lev].reset( new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho)); + if (do_dive_cleaning) { + charge_buf[lev].reset( new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho)); + } current_buffer_masks[lev].reset( new iMultiFab(ba, dm, 1, 0) ); } } -- cgit v1.2.3