From bf8bedf9fe8ba979f676ff7fce34630632e302a1 Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Fri, 2 Aug 2019 11:37:23 -0700 Subject: add doc --- Docs/source/running_cpp/parameters.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 7b2d2c0e6..f63930c77 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -219,6 +219,14 @@ Particle initialization ``electrons.density_function(x,y,z) = "n0+n0*x**2*1.e12"`` where ``n0`` is a user-defined constant, see above. +* ``.density_min`` (`float`) optional (default `0.`) + Minimum plasma density. No particle is injected where the density is below + this value. + +* ``.density_max`` (`float`) optional (default `infinity`) + Maximum plasma density. The density at each point is the minimum between + the value given in the profile, and `density_max`. + * ``.radially_weighted`` (`bool`) optional (default `true`) Whether particle's weight is varied with their radius. This only applies to cylindrical geometry. The only valid value is true. -- cgit v1.2.3 From b7415c04b7299dd17fb4a2c05a8e7f2a4387a5c2 Mon Sep 17 00:00:00 2001 From: ablelly Date: Thu, 8 Aug 2019 18:58:07 +0200 Subject: Minor correction so that the choice of direction is only valid on mother grid. Added the new input parameters in documentation. --- Bin/warox_3d_choose_pml_direction.ex | Bin 0 -> 81646872 bytes Bin/warpx_2d_choose_pml_direction.ex | Bin 0 -> 80559872 bytes Docs/source/running_cpp/parameters.rst | 6 ++++++ Source/Initialization/WarpXInitData.cpp | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 Bin/warox_3d_choose_pml_direction.ex create mode 100755 Bin/warpx_2d_choose_pml_direction.ex (limited to 'Docs/source/running_cpp') diff --git a/Bin/warox_3d_choose_pml_direction.ex b/Bin/warox_3d_choose_pml_direction.ex new file mode 100755 index 000000000..0a2bf6a8d Binary files /dev/null and b/Bin/warox_3d_choose_pml_direction.ex differ diff --git a/Bin/warpx_2d_choose_pml_direction.ex b/Bin/warpx_2d_choose_pml_direction.ex new file mode 100755 index 000000000..d484eafb0 Binary files /dev/null and b/Bin/warpx_2d_choose_pml_direction.ex differ diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index f63930c77..b7d0d0664 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -661,6 +661,12 @@ Boundary conditions The characteristic depth, in number of cells, over which the absorption coefficients of the PML increases. +* ``warpx.do_pml_Lo`` (`2 ints in 2D`, `3 ints in 3D`; default: `1 1 1`) + The directions along which one wants a pml boundary condition for lower boundaries on mother grid. + +* ``warpx.do_pml_Hi`` (`2 floats in 2D`, `3 floats in 3D`;; default: `1 1 1`) + The directions along which one wants a pml boundary condition for upper boundaries on mother grid. + Diagnostics and output ---------------------- diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 7ca8e14c4..912db5f26 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -147,7 +147,7 @@ WarpX::InitPML () dt[lev], nox_fft, noy_fft, noz_fft, do_nodal, #endif do_dive_cleaning, do_moving_window, - do_pml_Lo, do_pml_Hi)); + amrex::IntVect::TheUnitVector(), amrex::IntVect::TheUnitVector())); } } } -- cgit v1.2.3 From 7ac15cf206ba20f5673729476903323d2ad30f16 Mon Sep 17 00:00:00 2001 From: ablelly Date: Fri, 9 Aug 2019 00:26:56 +0200 Subject: For RZ mode: - pml automatically desabled along z axis (x=0) - for MR: if the MR patch lower boundary is along (x=0), the pml is automatically desabled along (xmin) --- Bin/warox_3d_choose_pml_direction.ex | Bin 81646872 -> 0 bytes Bin/warpx_2d_choose_pml_direction.ex | Bin 80559872 -> 0 bytes Docs/source/running_cpp/parameters.rst | 2 +- Source/Initialization/WarpXInitData.cpp | 16 ++++++++++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) delete mode 100755 Bin/warox_3d_choose_pml_direction.ex delete mode 100755 Bin/warpx_2d_choose_pml_direction.ex (limited to 'Docs/source/running_cpp') diff --git a/Bin/warox_3d_choose_pml_direction.ex b/Bin/warox_3d_choose_pml_direction.ex deleted file mode 100755 index 0a2bf6a8d..000000000 Binary files a/Bin/warox_3d_choose_pml_direction.ex and /dev/null differ diff --git a/Bin/warpx_2d_choose_pml_direction.ex b/Bin/warpx_2d_choose_pml_direction.ex deleted file mode 100755 index d484eafb0..000000000 Binary files a/Bin/warpx_2d_choose_pml_direction.ex and /dev/null differ diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index b7d0d0664..790956474 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -664,7 +664,7 @@ Boundary conditions * ``warpx.do_pml_Lo`` (`2 ints in 2D`, `3 ints in 3D`; default: `1 1 1`) The directions along which one wants a pml boundary condition for lower boundaries on mother grid. -* ``warpx.do_pml_Hi`` (`2 floats in 2D`, `3 floats in 3D`;; default: `1 1 1`) +* ``warpx.do_pml_Hi`` (`2 floats in 2D`, `3 floats in 3D`; default: `1 1 1`) The directions along which one wants a pml boundary condition for upper boundaries on mother grid. Diagnostics and output diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 912db5f26..10a7af8c7 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -131,15 +131,27 @@ WarpX::InitPML () { if (do_pml) { + amrex::IntVect do_pml_Lo_corrected = do_pml_Lo; + // amrex::IntVect do_pml_Hi_corrected = do_pml_Hi; + +#ifdef WARPX_DIM_RZ + do_pml_Lo_corrected[0] = 0; //no PML along z-axis +#endif pml[0].reset(new PML(boxArray(0), DistributionMap(0), &Geom(0), nullptr, pml_ncell, pml_delta, 0, #ifdef WARPX_USE_PSATD dt[0], nox_fft, noy_fft, noz_fft, do_nodal, #endif do_dive_cleaning, do_moving_window, - do_pml_Lo, do_pml_Hi)); + do_pml_Lo_corrected, do_pml_Hi)); for (int lev = 1; lev <= finest_level; ++lev) { + amrex::IntVect do_pml_Lo_MR = amrex::IntVect::TheUnitVector(); +#ifdef WARPX_DIM_RZ + if ((max_level > 0) && (fine_tag_lo[0]==0.)) { //if the border of the patch matches with the z-axis + do_pml_Lo_MR[0] = 0; + } +#endif pml[lev].reset(new PML(boxArray(lev), DistributionMap(lev), &Geom(lev), &Geom(lev-1), pml_ncell, pml_delta, refRatio(lev-1)[0], @@ -147,7 +159,7 @@ WarpX::InitPML () dt[lev], nox_fft, noy_fft, noz_fft, do_nodal, #endif do_dive_cleaning, do_moving_window, - amrex::IntVect::TheUnitVector(), amrex::IntVect::TheUnitVector())); + do_pml_Lo_MR, amrex::IntVect::TheUnitVector())); } } } -- cgit v1.2.3 From 64f3cc66744a913cdba77d915d30b146ff889441 Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Wed, 14 Aug 2019 11:23:42 -0700 Subject: add doc --- Docs/source/running_cpp/parameters.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 790956474..733d90d32 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -703,6 +703,11 @@ Diagnostics and output The time interval inbetween the lab-frame snapshots (where this time interval is expressed in the laboratory frame). +* ``warpx.dz_snapshots_lab`` (`float`, in meters) + Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. + Distance between the lab-frame snapshots (expressed in the laboratory + frame). Either `dt_snapshots_lab` or `dz_snapshot_lab` is required. + * ``warpx.do_boosted_frame_fields`` (`0 or 1`) Whether to use the **back-transformed diagnostics** for the fields. -- cgit v1.2.3 From d090a5c377fb85badb10dbdd3ffa2f525956710f Mon Sep 17 00:00:00 2001 From: Diana Amorim Date: Fri, 16 Aug 2019 13:51:15 -0700 Subject: Changed to the parameter that is currently defined in the code --- Docs/source/running_cpp/parameters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 790956474..2bb9b7850 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -301,7 +301,7 @@ Particle initialization following parameters, in this order: :math:`L_{ramp,up}` :math:`L_{plateau}` :math:`L_{ramp,down}` :math:`R_c` :math:`n_0` -* ``.do_backward_injection`` (`bool`) +* ``.do_backward_propagation`` (`bool`) Inject a backward-propagating beam to reduce the effect of charge-separation fields when running in the boosted frame. See examples. -- cgit v1.2.3 From ada7e94c1d4938c800919a9611b94ee6e8e5584e Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Fri, 16 Aug 2019 16:04:38 -0700 Subject: explicitly set dt_snapshots_lab = dz_snapshots_lab/c --- Docs/source/running_cpp/parameters.rst | 4 +++- Source/WarpX.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 733d90d32..948d928d1 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -706,7 +706,9 @@ Diagnostics and output * ``warpx.dz_snapshots_lab`` (`float`, in meters) Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. Distance between the lab-frame snapshots (expressed in the laboratory - frame). Either `dt_snapshots_lab` or `dz_snapshot_lab` is required. + frame). ``dt_snapshots_lab`` is then computed by + ``dt_snapshots_lab = dz_snapshots_lab/c``. Either `dt_snapshots_lab` + or `dz_snapshot_lab` is required. * ``warpx.do_boosted_frame_fields`` (`0 or 1`) Whether to use the **back-transformed diagnostics** for the fields. diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index cf474d2eb..50f255c11 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -340,7 +340,7 @@ WarpX::ReadParameters () Real dz_snapshots_lab = 0; snapshot_interval_is_specified += pp.query("dt_snapshots_lab", dt_snapshots_lab); if ( pp.query("dz_snapshots_lab", dz_snapshots_lab) ){ - dt_snapshots_lab = dz_snapshots_lab/moving_window_v; + dt_snapshots_lab = dz_snapshots_lab/PhysConst::c; snapshot_interval_is_specified = 1; } AMREX_ALWAYS_ASSERT_WITH_MESSAGE( -- cgit v1.2.3