diff options
author | 2018-10-05 15:54:49 -0700 | |
---|---|---|
committer | 2018-10-05 15:54:49 -0700 | |
commit | 40b9896ca405df802cd844e102a938b092f45cf4 (patch) | |
tree | c19b52d26d9e75b087c23a5c5f206b48935b7452 /Source/WarpX.cpp | |
parent | f98df173fb6c97d6c1cd13e204ee37f478f6680a (diff) | |
download | WarpX-40b9896ca405df802cd844e102a938b092f45cf4.tar.gz WarpX-40b9896ca405df802cd844e102a938b092f45cf4.tar.zst WarpX-40b9896ca405df802cd844e102a938b092f45cf4.zip |
allocate rho multifabs if plot_rho=1
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 9ca17c759..fc226a1b4 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -335,11 +335,10 @@ WarpX::ReadParameters () pp.query("plot_divb" , plot_divb); pp.query("plot_rho" , plot_rho); pp.query("plot_F" , plot_F); - if (plot_rho || plot_F){ - AMREX_ALWAYS_ASSERT_WITH_MESSAGE(do_dive_cleaning, - "plot_rho and plot_F only work if warpx.do_dive_cleaning = 1"); - } - + if (plot_F){ + AMREX_ALWAYS_ASSERT_WITH_MESSAGE(do_dive_cleaning, + "plot_F only works if warpx.do_dive_cleaning = 1"); + } if (maxLevel() > 0) { pp.query("plot_finepatch", plot_finepatch); pp.query("plot_crsepatch", plot_crsepatch); @@ -552,10 +551,12 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d current_fp[lev][1].reset( new MultiFab(amrex::convert(ba,jy_nodal_flag),dm,1,ngJ)); current_fp[lev][2].reset( new MultiFab(amrex::convert(ba,jz_nodal_flag),dm,1,ngJ)); + if (do_dive_cleaning || plot_rho){ + rho_fp[lev].reset(new MultiFab(amrex::convert(ba,IntVect::TheUnitVector()),dm,2,ngRho)); + } if (do_dive_cleaning) { F_fp[lev].reset (new MultiFab(amrex::convert(ba,IntVect::TheUnitVector()),dm,1, ngF)); - rho_fp[lev].reset(new MultiFab(amrex::convert(ba,IntVect::TheUnitVector()),dm,2,ngRho)); } #ifdef WARPX_USE_PSATD else @@ -608,10 +609,12 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d current_cp[lev][1].reset( new MultiFab(amrex::convert(cba,jy_nodal_flag),dm,1,ngJ)); current_cp[lev][2].reset( new MultiFab(amrex::convert(cba,jz_nodal_flag),dm,1,ngJ)); + if (do_dive_cleaning || plot_rho){ + rho_cp[lev].reset(new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho)); + } if (do_dive_cleaning) { F_cp[lev].reset (new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,1, ngF)); - rho_cp[lev].reset(new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho)); } #ifdef WARPX_USE_PSATD else |