aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 22debe82e..8c1dded61 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -142,7 +142,6 @@ WarpX::ResetInstance ()
WarpX::WarpX ()
{
m_instance = this;
-
ReadParameters();
BackwardCompatibility();
@@ -190,11 +189,16 @@ WarpX::WarpX ()
Efield_aux.resize(nlevs_max);
Bfield_aux.resize(nlevs_max);
+ Efield_avg_aux.resize(nlevs_max);
+ Bfield_avg_aux.resize(nlevs_max);
+
F_fp.resize(nlevs_max);
rho_fp.resize(nlevs_max);
current_fp.resize(nlevs_max);
Efield_fp.resize(nlevs_max);
Bfield_fp.resize(nlevs_max);
+ Efield_avg_fp.resize(nlevs_max);
+ Bfield_avg_fp.resize(nlevs_max);
current_store.resize(nlevs_max);
@@ -203,6 +207,8 @@ WarpX::WarpX ()
current_cp.resize(nlevs_max);
Efield_cp.resize(nlevs_max);
Bfield_cp.resize(nlevs_max);
+ Efield_avg_cp.resize(nlevs_max);
+ Bfield_avg_cp.resize(nlevs_max);
Efield_cax.resize(nlevs_max);
Bfield_cax.resize(nlevs_max);
@@ -608,6 +614,7 @@ WarpX::ReadParameters ()
pp.query("current_correction", current_correction);
pp.query("update_with_rho", update_with_rho);
pp.query("v_galilean", v_galilean);
+ pp.query("do_time_averaging", fft_do_time_averaging);
// Scale the velocity by the speed of light
for (int i=0; i<3; i++) v_galilean[i] *= PhysConst::c;
}
@@ -860,6 +867,15 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
current_fp[lev][1].reset( new MultiFab(amrex::convert(ba,jy_nodal_flag),dm,ncomps,ngJ));
current_fp[lev][2].reset( new MultiFab(amrex::convert(ba,jz_nodal_flag),dm,ncomps,ngJ));
+
+ Bfield_avg_fp[lev][0].reset( new MultiFab(amrex::convert(ba,Bx_nodal_flag),dm,ncomps,ngE));
+ Bfield_avg_fp[lev][1].reset( new MultiFab(amrex::convert(ba,By_nodal_flag),dm,ncomps,ngE));
+ Bfield_avg_fp[lev][2].reset( new MultiFab(amrex::convert(ba,Bz_nodal_flag),dm,ncomps,ngE));
+
+ Efield_avg_fp[lev][0].reset( new MultiFab(amrex::convert(ba,Ex_nodal_flag),dm,ncomps,ngE));
+ Efield_avg_fp[lev][1].reset( new MultiFab(amrex::convert(ba,Ey_nodal_flag),dm,ncomps,ngE));
+ Efield_avg_fp[lev][2].reset( new MultiFab(amrex::convert(ba,Ez_nodal_flag),dm,ncomps,ngE));
+
if (do_dive_cleaning || (plot_rho && do_back_transformed_diagnostics))
{
rho_fp[lev].reset(new MultiFab(amrex::convert(ba,rho_nodal_flag),dm,2*ncomps,ngRho));
@@ -932,6 +948,9 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
for (int idir = 0; idir < 3; ++idir) {
Efield_aux[lev][idir].reset(new MultiFab(*Efield_fp[lev][idir], amrex::make_alias, 0, ncomps));
Bfield_aux[lev][idir].reset(new MultiFab(*Bfield_fp[lev][idir], amrex::make_alias, 0, ncomps));
+
+ Efield_avg_aux[lev][idir].reset(new MultiFab(*Efield_avg_fp[lev][idir], amrex::make_alias, 0, ncomps));
+ Bfield_avg_aux[lev][idir].reset(new MultiFab(*Bfield_avg_fp[lev][idir], amrex::make_alias, 0, ncomps));
}
}
else
@@ -943,6 +962,16 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
Efield_aux[lev][0].reset( new MultiFab(amrex::convert(ba,Ex_nodal_flag),dm,ncomps,ngE));
Efield_aux[lev][1].reset( new MultiFab(amrex::convert(ba,Ey_nodal_flag),dm,ncomps,ngE));
Efield_aux[lev][2].reset( new MultiFab(amrex::convert(ba,Ez_nodal_flag),dm,ncomps,ngE));
+
+
+ Bfield_avg_aux[lev][0].reset( new MultiFab(amrex::convert(ba,Bx_nodal_flag),dm,ncomps,ngE));
+ Bfield_avg_aux[lev][1].reset( new MultiFab(amrex::convert(ba,By_nodal_flag),dm,ncomps,ngE));
+ Bfield_avg_aux[lev][2].reset( new MultiFab(amrex::convert(ba,Bz_nodal_flag),dm,ncomps,ngE));
+
+ Efield_avg_aux[lev][0].reset( new MultiFab(amrex::convert(ba,Ex_nodal_flag),dm,ncomps,ngE));
+ Efield_avg_aux[lev][1].reset( new MultiFab(amrex::convert(ba,Ey_nodal_flag),dm,ncomps,ngE));
+ Efield_avg_aux[lev][2].reset( new MultiFab(amrex::convert(ba,Ez_nodal_flag),dm,ncomps,ngE));
+
}
//
@@ -964,6 +993,16 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
Efield_cp[lev][1].reset( new MultiFab(amrex::convert(cba,Ey_nodal_flag),dm,ncomps,ngE));
Efield_cp[lev][2].reset( new MultiFab(amrex::convert(cba,Ez_nodal_flag),dm,ncomps,ngE));
+ // Create the MultiFabs for B_avg
+ Bfield_avg_cp[lev][0].reset( new MultiFab(amrex::convert(cba,Bx_nodal_flag),dm,ncomps,ngE));
+ Bfield_avg_cp[lev][1].reset( new MultiFab(amrex::convert(cba,By_nodal_flag),dm,ncomps,ngE));
+ Bfield_avg_cp[lev][2].reset( new MultiFab(amrex::convert(cba,Bz_nodal_flag),dm,ncomps,ngE));
+
+ // Create the MultiFabs for E_avg
+ Efield_avg_cp[lev][0].reset( new MultiFab(amrex::convert(cba,Ex_nodal_flag),dm,ncomps,ngE));
+ Efield_avg_cp[lev][1].reset( new MultiFab(amrex::convert(cba,Ey_nodal_flag),dm,ncomps,ngE));
+ Efield_avg_cp[lev][2].reset( new MultiFab(amrex::convert(cba,Ez_nodal_flag),dm,ncomps,ngE));
+
// Create the MultiFabs for the current
current_cp[lev][0].reset( new MultiFab(amrex::convert(cba,jx_nodal_flag),dm,ncomps,ngJ));
current_cp[lev][1].reset( new MultiFab(amrex::convert(cba,jy_nodal_flag),dm,ncomps,ngJ));