From ff90a6cf3e786e56b8494a13d98f940e2398803b Mon Sep 17 00:00:00 2001 From: ablelly Date: Thu, 8 Aug 2019 00:53:25 +0200 Subject: Added input entries for do_pml_Lo, do_pml_Hi --- Source/WarpX.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'Source/WarpX.cpp') diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 1f5ade13a..63fda6d68 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -383,6 +383,22 @@ WarpX::ReadParameters () pp.query("pml_ncell", pml_ncell); pp.query("pml_delta", pml_delta); + 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 + + pp.query("dump_openpmd", dump_openpmd); pp.query("dump_plotfiles", dump_plotfiles); pp.query("plot_raw_fields", plot_raw_fields); @@ -393,7 +409,7 @@ WarpX::ReadParameters () if (not user_fields_to_plot){ // If not specified, set default values fields_to_plot = {"Ex", "Ey", "Ez", "Bx", "By", - "Bz", "jx", "jy", "jz", + "Bz", "jx", "jy", "jz", "part_per_cell"}; } // set plot_rho to true of the users requests it, so that @@ -411,9 +427,9 @@ WarpX::ReadParameters () // If user requests to plot proc_number for a serial run, // delete proc_number from fields_to_plot if (ParallelDescriptor::NProcs() == 1){ - fields_to_plot.erase(std::remove(fields_to_plot.begin(), - fields_to_plot.end(), - "proc_number"), + fields_to_plot.erase(std::remove(fields_to_plot.begin(), + fields_to_plot.end(), + "proc_number"), fields_to_plot.end()); } @@ -497,7 +513,7 @@ WarpX::ReadParameters () { ParmParse pp("algo"); // If not in RZ mode, read use_picsar_deposition - // In RZ mode, use_picsar_deposition is on, as the C++ version + // In RZ mode, use_picsar_deposition is on, as the C++ version // of the deposition does not support RZ #ifndef WARPX_RZ pp.query("use_picsar_deposition", use_picsar_deposition); -- cgit v1.2.3 From 19888b109c0c40ca4fbe472e095393964029b4a0 Mon Sep 17 00:00:00 2001 From: Dave Grote Date: Wed, 14 Aug 2019 16:51:21 -0700 Subject: For RigidInjection, fixed calculation of done_injecting --- Source/Particles/RigidInjectedParticleContainer.cpp | 3 ++- Source/WarpX.H | 2 +- Source/WarpX.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/WarpX.cpp') diff --git a/Source/Particles/RigidInjectedParticleContainer.cpp b/Source/Particles/RigidInjectedParticleContainer.cpp index 038d50d0a..6f1c5450b 100644 --- a/Source/Particles/RigidInjectedParticleContainer.cpp +++ b/Source/Particles/RigidInjectedParticleContainer.cpp @@ -348,7 +348,8 @@ RigidInjectedParticleContainer::Evolve (int lev, const Real* plo = Geom(lev).ProbLo(); const Real* phi = Geom(lev).ProbHi(); const int zdir = AMREX_SPACEDIM-1; - done_injecting[lev] = (zinject_plane_levels[lev] < plo[zdir] || zinject_plane_levels[lev] > phi[zdir]); + done_injecting[lev] = ((zinject_plane_levels[lev] < plo[zdir] && WarpX::moving_window_v > 0.) || + (zinject_plane_levels[lev] > phi[zdir] && WarpX::moving_window_v < 0.)); done_injecting_lev = done_injecting[lev]; PhysicalParticleContainer::Evolve (lev, diff --git a/Source/WarpX.H b/Source/WarpX.H index 4d72b8629..927cc1f32 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -257,6 +257,7 @@ public: static int do_moving_window; static int moving_window_dir; + static amrex::Real moving_window_v; // slice generation // void InitializeSliceMultiFabs (); @@ -504,7 +505,6 @@ private: amrex::Vector > pml; amrex::Real moving_window_x = std::numeric_limits::max(); - amrex::Real moving_window_v = std::numeric_limits::max(); amrex::Real current_injection_position = 0; // Plasma injection parameters diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 07f124820..a6a7a3399 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -30,6 +30,7 @@ Vector WarpX::B_external(3, 0.0); int WarpX::do_moving_window = 0; int WarpX::moving_window_dir = -1; +Real WarpX::moving_window_v = std::numeric_limits::max(); Real WarpX::gamma_boost = 1.; Real WarpX::beta_boost = 0.; -- cgit v1.2.3