aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 3e1b225ac..a2590de84 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);
@@ -556,10 +555,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
@@ -612,10 +613,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