aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.github/workflows/source.yml4
-rwxr-xr-x.github/workflows/source/inputsNotTested37
-rwxr-xr-x.github/workflows/source/wrongFileNameInExamples38
-rw-r--r--CONTRIBUTING.md1
-rw-r--r--Docs/source/running_cpp/parameters.rst29
-rw-r--r--Docs/source/running_cpp/platforms.rst4
-rw-r--r--Examples/Modules/RigidInjection/inputs.BoostedFrame2
-rw-r--r--Examples/Modules/boosted_diags/inputs.2d95
-rw-r--r--Examples/Modules/boosted_diags/inputs.3d95
-rw-r--r--Examples/Modules/boosted_diags/inputs.3d.slice8
-rw-r--r--Examples/Modules/charged_beam/inputs50
-rw-r--r--Examples/Modules/gaussian_beam/PICMI_inputs_gaussian_beam.py (renamed from Examples/Modules/gaussian_beam/gaussian_beam_PICMI.py)4
-rw-r--r--Examples/Modules/gaussian_beam/inputs100
-rwxr-xr-xExamples/Modules/ionization/analysis_ionization.py (renamed from Examples/Modules/ionization/ionization_analysis.py)0
-rw-r--r--Examples/Modules/laser_injection/Visualization.ipynb137
-rwxr-xr-xExamples/Modules/laser_injection/analysis_laser.py (renamed from Examples/Modules/laser_injection/laser_analysis.py)0
-rwxr-xr-xExamples/Modules/nci_corrector/analysis_ncicorr.py (renamed from Examples/Modules/nci_corrector/ncicorr_analysis.py)0
-rw-r--r--Examples/Modules/nci_corrector/inputs.2d (renamed from Examples/Modules/nci_corrector/inputs2d)2
-rwxr-xr-xExamples/Modules/qed/breit_wheeler/analysis_2d_tau_init.py (renamed from Examples/Modules/qed/breit_wheeler/check_2d_tau_init.py)0
-rw-r--r--Examples/Modules/qed/breit_wheeler/inputs.2d_test_tau_init7
-rwxr-xr-xExamples/Modules/qed/quantum_synchrotron/analysis_2d_tau_init.py (renamed from Examples/Modules/qed/quantum_synchrotron/check_2d_tau_init.py)0
-rw-r--r--Examples/Modules/qed/quantum_synchrotron/inputs.2d_test_tau_init6
-rw-r--r--Examples/Modules/restart/inputs18
-rw-r--r--Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py (renamed from Examples/Physics_applications/laser_acceleration/laser_acceleration_PICMI.py)2
-rw-r--r--Examples/Physics_applications/laser_acceleration/inputs.2d10
-rw-r--r--Examples/Physics_applications/laser_acceleration/inputs.2d.boost10
-rw-r--r--Examples/Physics_applications/laser_acceleration/inputs.3d8
-rwxr-xr-xExamples/Physics_applications/laser_acceleration/inputs.rz2
-rw-r--r--Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py (renamed from Examples/Physics_applications/plasma_acceleration/plasma_acceleration_PICMI.py)2
-rw-r--r--Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py (renamed from Examples/Physics_applications/plasma_acceleration/plasma_acceleration_PICMI.mr.py)2
-rw-r--r--Examples/Physics_applications/plasma_acceleration/inputs.2d.boost6
-rw-r--r--Examples/Physics_applications/plasma_acceleration/inputs.3d.boost4
-rw-r--r--Examples/Tests/Langmuir/PICMI_inputs_langmuir2d.py (renamed from Examples/Tests/Langmuir/langmuir2d_PICMI.py)2
-rw-r--r--Examples/Tests/Langmuir/PICMI_inputs_langmuir_rt.py (renamed from Examples/Tests/Langmuir/langmuir_PICMI_rt.py)0
-rw-r--r--Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz.py (renamed from Examples/Tests/Langmuir/langmuir_PICMI_rz.py)0
-rw-r--r--Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py (renamed from Examples/Tests/Langmuir/langmuir_PICMI_rz_multimode_analyze.py)2
-rwxr-xr-xExamples/Tests/Langmuir/analysis_langmuir.py (renamed from Examples/Tests/Langmuir/langmuir_analysis.py)0
-rwxr-xr-xExamples/Tests/Langmuir/analysis_langmuir2d.py (renamed from Examples/Tests/Langmuir/langmuir2d_analysis.py)0
-rwxr-xr-xExamples/Tests/Langmuir/analysis_langmuir_multi.py (renamed from Examples/Tests/Langmuir/langmuir_multi_analysis.py)0
-rwxr-xr-xExamples/Tests/Langmuir/analysis_langmuir_multi_2d.py (renamed from Examples/Tests/Langmuir/langmuir_multi_2d_analysis.py)0
-rwxr-xr-xExamples/Tests/Langmuir/analysis_langmuir_multi_rz.py (renamed from Examples/Tests/Langmuir/langmuir_multi_rz_analysis.py)0
-rw-r--r--Examples/Tests/Langmuir/inputs.2d.rz55
-rw-r--r--Examples/Tests/Langmuir/inputs.lb59
-rw-r--r--Examples/Tests/Langmuir/inputs.multi.2d.rt2
-rw-r--r--Examples/Tests/Langmuir/inputs.multi.rt2
-rw-r--r--Examples/Tests/Langmuir/inputs.multi.rz.rt2
-rw-r--r--Examples/Tests/Langmuir/inputs.nolb59
-rw-r--r--Examples/Tests/Langmuir/inputs.rt2
-rw-r--r--Examples/Tests/Langmuir/langmuir_PICMI.py52
-rw-r--r--Examples/Tests/Larmor/inputs77
-rw-r--r--Examples/Tests/Larmor/inputs.mr (renamed from Examples/Tests/Larmor/inputs.ml)3
-rw-r--r--Examples/Tests/PML/inputs.2d (renamed from Examples/Tests/PML/inputs2d)0
-rwxr-xr-xExamples/Tests/SingleParticle/analysis_bilinear_filter.py (renamed from Examples/Tests/SingleParticle/bilinear_filter_analysis.py)0
-rw-r--r--Examples/Tests/SingleParticle/inputs2
-rw-r--r--Examples/Tests/gpu_test/inputs2
-rw-r--r--Examples/Tests/laser_on_fine/inputs73
-rw-r--r--Examples/Tests/laser_on_fine/inputs.2d6
-rwxr-xr-xExamples/Tests/particle_pusher/inputs2
-rwxr-xr-xExamples/Tests/particles_in_PML/analysis_particles_in_pml.py (renamed from Examples/Tests/particles_in_PML/analysis.py)0
-rw-r--r--Examples/Tests/particles_in_PML/inputs.2d (renamed from Examples/Tests/particles_in_PML/inputs2d)0
-rwxr-xr-xExamples/Tests/photon_pusher/analysis_photon_pusher.py (renamed from Examples/Tests/photon_pusher/check.py)2
-rw-r--r--Examples/Tests/photon_pusher/inputs2
-rwxr-xr-xExamples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py (renamed from Examples/Tests/radiation_reaction/test_const_B_analytical/check.py)2
-rw-r--r--Examples/Tests/radiation_reaction/test_const_B_analytical/inputs2
-rw-r--r--Examples/Tests/self_force_test/inputs70
-rw-r--r--Python/pywarpx/picmi.py8
-rw-r--r--Regression/WarpX-tests.ini376
-rw-r--r--Source/Diagnostics/BackTransformedDiagnostic.H (renamed from Source/Diagnostics/BoostedFrameDiagnostic.H)12
-rw-r--r--Source/Diagnostics/BackTransformedDiagnostic.cpp (renamed from Source/Diagnostics/BoostedFrameDiagnostic.cpp)76
-rw-r--r--Source/Diagnostics/Make.package4
-rw-r--r--Source/Evolve/WarpXEvolveEM.cpp6
-rw-r--r--Source/Initialization/InjectorPosition.H28
-rw-r--r--Source/Initialization/WarpXInitData.cpp4
-rw-r--r--Source/Laser/LaserParticleContainer.cpp34
-rw-r--r--Source/Laser/LaserProfiles.cpp14
-rw-r--r--Source/Parallelization/InterpolateCurrentFineToCoarse.H56
-rw-r--r--Source/Parallelization/WarpXComm.cpp151
-rw-r--r--Source/Parallelization/WarpXComm_K.H577
-rw-r--r--Source/Parallelization/WarpXRegrid.cpp2
-rw-r--r--Source/Particles/Deposition/CurrentDeposition.H121
-rw-r--r--Source/Particles/MultiParticleContainer.H22
-rw-r--r--Source/Particles/MultiParticleContainer.cpp31
-rw-r--r--Source/Particles/PhotonParticleContainer.cpp9
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp20
-rw-r--r--Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H3
-rw-r--r--Source/Particles/WarpXParticleContainer.H4
-rw-r--r--Source/Utils/WarpXAlgorithmSelection.H4
-rw-r--r--Source/Utils/WarpXAlgorithmSelection.cpp5
-rw-r--r--Source/Utils/WarpXTagging.cpp6
-rw-r--r--Source/WarpX.H12
-rw-r--r--Source/WarpX.cpp79
-rw-r--r--Tools/batchScripts/batch_cori.sh (renamed from Examples/batchScripts/batch_cori.sh)0
-rw-r--r--Tools/batchScripts/batch_summit.sh (renamed from Examples/batchScripts/batch_summit.sh)0
-rwxr-xr-xTools/batchScripts/script_profiling_summit.sh (renamed from Examples/Tests/gpu_test/script_profiling.sh)0
-rw-r--r--Tools/performance_tests/automated_test_4_labdiags_2ppc2
-rw-r--r--Tools/performance_tests/automated_test_5_loadimbalance2
-rw-r--r--Tools/performance_tests/functions_perftest.py1
-rw-r--r--Tools/performance_tests/run_automated.py67
-rw-r--r--Tools/performance_tests/summit.py10
-rw-r--r--Tools/plot_particle_path.py (renamed from Examples/Tests/Larmor/plot_particle_path.py)0
-rwxr-xr-xTools/script_profiling_summit.sh48
-rwxr-xr-xrun_test.sh2
102 files changed, 1523 insertions, 1436 deletions
diff --git a/.github/workflows/source.yml b/.github/workflows/source.yml
index 8e1dbec05..040a0d449 100644
--- a/.github/workflows/source.yml
+++ b/.github/workflows/source.yml
@@ -13,3 +13,7 @@ jobs:
run: .github/workflows/source/hasTabs
- name: End-of-Line whitespaces
run: .github/workflows/source/hasEOLwhiteSpace
+ - name: Proper file names in Examples
+ run: .github/workflows/source/wrongFileNameInExamples
+ - name: Examples are tested
+ run: .github/workflows/source/inputsNotTested
diff --git a/.github/workflows/source/inputsNotTested b/.github/workflows/source/inputsNotTested
new file mode 100755
index 000000000..615db9367
--- /dev/null
+++ b/.github/workflows/source/inputsNotTested
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+
+# Search input files in Examples/ and verify if all input files are tested
+
+ok=0
+
+for file in $(find Examples -type f)
+do
+ # Name of file without path
+ filename=$(basename $file)
+ # If file is an input file
+ if [[ ${filename:0:6 } =~ inputs ]] ||
+ [[ ${filename:0:12} =~ PICMI_inputs ]]
+ then
+ # Search file name in test list
+ string_match=$(grep -m1 "$file" Regression/WarpX-tests.ini)
+ # If match is empty, inputs examples is not tested
+ if [[ -z $string_match ]]
+ then
+ echo "$file is not tested!"
+ ok=1
+ fi
+ fi
+done
+
+if [ $ok -ne 0 ]
+then
+ echo ""
+ echo "All files in Examples that start with one of"
+ echo " - inputs"
+ echo " - PICMI_inputs"
+ echo "must have an automated test."
+ echo "Please add a test in Regression/WarpX-tests.ini"
+ echo "for all files listed above."
+fi
+
+exit $ok \ No newline at end of file
diff --git a/.github/workflows/source/wrongFileNameInExamples b/.github/workflows/source/wrongFileNameInExamples
new file mode 100755
index 000000000..0a5c56aba
--- /dev/null
+++ b/.github/workflows/source/wrongFileNameInExamples
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# Search inside Examples/ and check that file names start with
+# inputs
+# PICMI_inputs
+# analysis
+# README
+
+ok=0
+files=()
+
+for pathtofile in $(find Examples -type f)
+do
+ file=$(basename $pathtofile)
+ if [[ ${file:0:6 } != inputs ]] &&
+ [[ ${file:0:12} != PICMI_inputs ]] &&
+ [[ ${file:0:8 } != analysis ]] &&
+ [[ ${file:0:6 } != README ]]
+ then
+ files+=($file)
+ echo "$pathtofile does not have a proper name!"
+ ok=1
+ fi
+done
+
+if [ $ok -ne 0 ]
+then
+ echo ""
+ echo "Files in Examples/ must start with one of:"
+ echo " - inputs : for WarpX input files"
+ echo " - PICMI_inputs : for PICMI-compliant input scripts"
+ echo " - analysis : for scripts testing the accuracy of a test"
+ echo " - README : for readme files"
+ echo ""
+ echo "Please rename the file(s) to comply, or move to another folder"
+fi
+
+exit $ok \ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c54f2968d..19a1727c4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -199,3 +199,4 @@ created it). Reviewers will interact with you if they have comments/questions.
- Some text editors automatically modify the files you open (e.g., to remove trailing spaces). Please turn this feature off as it causes many changes and makes pull requests harder to review.
- `#include` directives should be ordered from more specific to more general, i.e., `"module header"`, `"WarpX header"`, `<close library headers>` (AMReX, PICSAR), `<other third party headers>` (e.g., `omp`), `<stdlib headers>`. See [PR #331](https://github.com/ECP-WarpX/WarpX/pull/331), or [LLVM](https://llvm.org/docs/CodingStandards.html#include-style) or [include-what-you-use](https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md) pages.
- WarpX uses `CamelCase` convention for file names and class names, rather than `snake_case`.
+- The names of all member variables should be prefixed with `m_`. This is particularly useful to avoid capturing member variables by value in a lambda function, which causes the whole object to be copied to GPU when running on a GPU-accelerated architecture. This convention should be used for all new piece of code, and it should be applied progressively to old code.
diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst
index d2f0c8546..e5c99a3d9 100644
--- a/Docs/source/running_cpp/parameters.rst
+++ b/Docs/source/running_cpp/parameters.rst
@@ -349,8 +349,8 @@ Particle initialization
``<species>.plot_vars = none`` to plot no particle data, except
particle position.
-* ``<species>.do_boosted_frame_diags`` (`0` or `1` optional, default `1`)
- Only used when ``warpx.do_boosted_frame_diagnostic=1``. When running in a
+* ``<species>.do_back_transformed_diagnostics`` (`0` or `1` optional, default `1`)
+ Only used when ``warpx.do_back_transformed_diagnostics=1``. When running in a
boosted frame, whether or not to plot back-transformed diagnostics for
this species.
@@ -614,8 +614,6 @@ Numerics and algorithms
- ``direct``: simpler current deposition algorithm, described in
the section :doc:`../theory/picsar_theory`. Note that this algorithm is not strictly charge-conserving.
- If ``algo.current_deposition`` is not specified, the default is ``esirkepov``.
-
* ``algo.charge_deposition`` (`string`, optional)
The algorithm for the charge density deposition. Available options are:
@@ -625,8 +623,15 @@ Numerics and algorithms
* ``algo.field_gathering`` (`string`, optional)
The algorithm for field gathering. Available options are:
- - ``standard``: gathers directly from the grid points (either staggered
+ - ``energy-conserving``: gathers directly from the grid points (either staggered
or nodal gridpoints depending on ``warpx.do_nodal``).
+ - ``momentum-conserving``: first average the fields from the grid points to
+ the nodes, and then gather from the nodes.
+
+ If ``algo.field_gathering`` is not specified, the default is ``energy-conserving``.
+ If ``warpx.do_nodal`` is ``true``, then ``energy-conserving`` and ``momentum-conserving``
+ are equivalent.
+
* ``algo.particle_pusher`` (`string`, optional)
The algorithm for the particle pusher. Available options are:
@@ -766,7 +771,7 @@ Diagnostics and output
When WarpX is compiled with openPMD support, this is ``h5`` by default.
``json`` only works with serial/single-rank jobs.
-* ``warpx.do_boosted_frame_diagnostic`` (`0` or `1`)
+* ``warpx.do_back_transformed_diagnostics`` (`0` or `1`)
Whether to use the **back-transformed diagnostics** (i.e. diagnostics that
perform on-the-fly conversion to the laboratory frame, when running
boosted-frame simulations)
@@ -777,22 +782,22 @@ Diagnostics and output
is `lab_frame_data`.
* ``warpx.num_snapshots_lab`` (`integer`)
- Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``.
+ Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``.
The number of lab-frame snapshots that will be written.
* ``warpx.dt_snapshots_lab`` (`float`, in seconds)
- Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``.
+ Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``.
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``.
+ Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``.
Distance between the lab-frame snapshots (expressed in the laboratory
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`)
+* ``warpx.do_back_transformed_fields`` (`0 or 1`)
Whether to use the **back-transformed diagnostics** for the fields.
* ``warpx.boosted_frame_diag_fields`` (space-separated list of `string`)
@@ -851,7 +856,7 @@ Diagnostics and output
negative number to disable slice generation and slice data dumping.
* ``slice.num_slice_snapshots_lab`` (`integer`)
- Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``.
+ Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``.
The number of back-transformed field and particle data that
will be written for the reduced domain defined by ``slice.dom_lo``
and ``slice.dom_hi``. Note that the 'slice' is a reduced
@@ -861,7 +866,7 @@ Diagnostics and output
for further details.
* ``slice.dt_slice_snapshots_lab`` (`float`, in seconds)
- Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``.
+ Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``.
The time interval between the back-transformed reduced diagnostics (where this
time interval is expressed in the laboratory frame).
diff --git a/Docs/source/running_cpp/platforms.rst b/Docs/source/running_cpp/platforms.rst
index e74aa36db..9600c1c30 100644
--- a/Docs/source/running_cpp/platforms.rst
+++ b/Docs/source/running_cpp/platforms.rst
@@ -8,7 +8,7 @@ The batch script below can be used to run a WarpX simulation on 2 KNL nodes on
the supercomputer Cori at NERSC. Replace descriptions between chevrons ``<>``
by relevant values, for instance ``<job name>`` could be ``laserWakefield``.
-.. literalinclude:: ../../../Examples/batchScripts/batch_cori.sh
+.. literalinclude:: ../../../Tools/batchScripts/batch_cori.sh
:language: bash
To run a simulation, copy the lines above to a file ``batch_cori.sh`` and
@@ -42,7 +42,7 @@ by relevalt values, for instance ``<input file>`` could be
``plasma_mirror_inputs``. Note that the only option so far is to run with one
MPI rank per GPU.
-.. literalinclude:: ../../../Examples/batchScripts/batch_summit.sh
+.. literalinclude:: ../../../Tools/batchScripts/batch_summit.sh
:language: bash
To run a simulation, copy the lines above to a file ``batch_summit.sh`` and
diff --git a/Examples/Modules/RigidInjection/inputs.BoostedFrame b/Examples/Modules/RigidInjection/inputs.BoostedFrame
index c7a60f14f..456df363d 100644
--- a/Examples/Modules/RigidInjection/inputs.BoostedFrame
+++ b/Examples/Modules/RigidInjection/inputs.BoostedFrame
@@ -3,7 +3,7 @@
warpx.zmax_plasma_to_compute_max_step = 50.e-6
warpx.gamma_boost = 5.
warpx.boost_direction = z
-warpx.do_boosted_frame_diagnostic = 1
+warpx.do_back_transformed_diagnostics = 1
warpx.num_snapshots_lab = 2
warpx.dt_snapshots_lab = 1.8679589331096515e-13
diff --git a/Examples/Modules/boosted_diags/inputs.2d b/Examples/Modules/boosted_diags/inputs.2d
deleted file mode 100644
index 6afe6977d..000000000
--- a/Examples/Modules/boosted_diags/inputs.2d
+++ /dev/null
@@ -1,95 +0,0 @@
-# Maximum number of time steps
-max_step = 260
-
-# number of grid points
-amr.n_cell = 64 64 512
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-
-amr.max_grid_size = 32
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-amr.plot_int = 10 # How often to write plotfiles. "<= 0" means no plotfiles.
-amr.check_int = 10
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 0 # Is periodic?
-geometry.prob_lo = -150.e-6 -150.e-6 -0.6e-3 # physical domain
-geometry.prob_hi = 150.e-6 150.e-6 0.
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-algo.current_deposition = direct
-
-# Numerics
-interpolation.nox = 3
-interpolation.noy = 3
-interpolation.noz = 3
-warpx.use_filter = 1
-warpx.cfl = 1.0
-warpx.do_pml = 0
-
-# Moving window
-warpx.do_moving_window = 1
-warpx.moving_window_dir = z
-warpx.moving_window_v = 1.0 # in units of the speed of light
-
-# Boosted frame
-warpx.gamma_boost = 15.
-warpx.boost_direction = z
-
-# Diagnostics
-warpx.do_boosted_frame_diagnostic = 1
-warpx.num_snapshots_lab = 20
-warpx.dt_snapshots_lab = 7.0e-14
-
-# Species
-particles.nspecies = 2
-particles.species_names = electrons ions
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "NUniformPerCell"
-electrons.xmin = -150.e-6
-electrons.xmax = 150.e-6
-electrons.ymin = -150.e-6
-electrons.ymax = 150.e-6
-electrons.zmin = 0.e-6
-electrons.num_particles_per_cell_each_dim = 1 1 2
-electrons.profile = constant
-electrons.density = 1.
-electrons.momentum_distribution_type = "constant"
-electrons.do_continuous_injection = 1
-
-ions.charge = q_e
-ions.mass = m_p
-ions.injection_style = "NUniformPerCell"
-ions.xmin = -150.e-6
-ions.xmax = 150.e-6
-ions.ymin = -150.e-6
-ions.ymax = 150.e-6
-ions.zmin = 0.e-6
-ions.num_particles_per_cell_each_dim = 1 1 2
-ions.profile = constant
-ions.density = 1.
-ions.momentum_distribution_type = "constant"
-ions.do_continuous_injection = 1
-
-# Laser
-lasers.nlasers = 1
-lasers.names = laser1
-laser1.profile = Gaussian
-laser1.position = 0. 0. -1.e-6 # This point is on the laser plane
-laser1.direction = 0. 0. 1. # The plane normal direction
-laser1.polarization = 1. 0. 0. # The main polarization vector
-laser1.e_max = 8.e12 # Maximum amplitude of the laser field (in V/m)
-laser1.profile_waist = 5.e-5 # The waist of the laser (in meters)
-laser1.profile_duration = 16.7e-15 # The duration of the laser (in seconds)
-laser1.profile_t_peak = 33.4e-15 # The time at which the laser reaches its peak (in seconds)
-laser1.profile_focal_distance = 0.e-6 # Focal distance from the antenna (in meters)
-laser1.wavelength = 0.8e-6 # The wavelength of the laser (in meters)
diff --git a/Examples/Modules/boosted_diags/inputs.3d b/Examples/Modules/boosted_diags/inputs.3d
deleted file mode 100644
index 528eb6cd9..000000000
--- a/Examples/Modules/boosted_diags/inputs.3d
+++ /dev/null
@@ -1,95 +0,0 @@
-# Maximum number of time steps
-max_step = 260
-
-# number of grid points
-amr.n_cell = 64 64 512
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-
-amr.max_grid_size = 32
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-amr.plot_int = 10 # How often to write plotfiles. "<= 0" means no plotfiles.
-amr.check_int = 10
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 0 # Is periodic?
-geometry.prob_lo = -150.e-6 -150.e-6 -0.6e-3 # physical domain
-geometry.prob_hi = 150.e-6 150.e-6 0.
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-algo.current_deposition = direct
-
-# Numerics
-interpolation.nox = 3
-interpolation.noy = 3
-interpolation.noz = 3
-warpx.use_filter = 1
-warpx.cfl = 1.0
-warpx.do_pml = 0
-
-# Moving window
-warpx.do_moving_window = 1
-warpx.moving_window_dir = z
-warpx.moving_window_v = 1.0 # in units of the speed of light
-
-# Boosted frame
-warpx.gamma_boost = 15.
-warpx.boost_direction = z
-
-# Diagnostics
-warpx.do_boosted_frame_diagnostic = 1
-warpx.num_snapshots_lab = 20;
-warpx.dt_snapshots_lab = 7.0e-14;
-
-# Species
-particles.nspecies = 2
-particles.species_names = electrons ions
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "NUniformPerCell"
-electrons.xmin = -150.e-6
-electrons.xmax = 150.e-6
-electrons.ymin = -150.e-6
-electrons.ymax = 150.e-6
-electrons.zmin = 0.e-6
-electrons.num_particles_per_cell_each_dim = 1 1 2
-electrons.profile = constant
-electrons.density = 1.
-electrons.momentum_distribution_type = "constant"
-electrons.do_continuous_injection = 1
-
-ions.charge = q_e
-ions.mass = m_p
-ions.injection_style = "NUniformPerCell"
-ions.xmin = -150.e-6
-ions.xmax = 150.e-6
-ions.ymin = -150.e-6
-ions.ymax = 150.e-6
-ions.zmin = 0.e-6
-ions.num_particles_per_cell_each_dim = 1 1 2
-ions.profile = constant
-ions.density = 1.
-ions.momentum_distribution_type = "constant"
-ions.do_continuous_injection = 1
-
-# Laser
-lasers.nlasers = 1
-lasers.names = laser1
-laser1.profile = Gaussian
-laser1.position = 0. 0. -1.e-6 # This point is on the laser plane
-laser1.direction = 0. 0. 1. # The plane normal direction
-laser1.polarization = 1. 0. 0. # The main polarization vector
-laser1.e_max = 8.e12 # Maximum amplitude of the laser field (in V/m)
-laser1.profile_waist = 5.e-5 # The waist of the laser (in meters)
-laser1.profile_duration = 16.7e-15 # The duration of the laser (in seconds)
-laser1.profile_t_peak = 33.4e-15 # The time at which the laser reaches its peak (in seconds)
-laser1.profile_focal_distance = 0.e-6 # Focal distance from the antenna (in meters)
-laser1.wavelength = 0.8e-6 # The wavelength of the laser (in meters)
diff --git a/Examples/Modules/boosted_diags/inputs.3d.slice b/Examples/Modules/boosted_diags/inputs.3d.slice
index fdd150949..08f2310cd 100644
--- a/Examples/Modules/boosted_diags/inputs.3d.slice
+++ b/Examples/Modules/boosted_diags/inputs.3d.slice
@@ -13,7 +13,7 @@ geometry.prob_hi = 128.e-6 128.e-6 0.96e-6
algo.current_deposition = esirkepov
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.particle_pusher = vay
algo.maxwell_fdtd_solver = ckc
interpolation.nox = 3
@@ -30,7 +30,7 @@ warpx.serialize_ics = 1
warpx.gamma_boost = 10.
warpx.boost_direction = z
-warpx.do_boosted_frame_diagnostic = 1
+warpx.do_back_transformed_diagnostics = 1
warpx.num_snapshots_lab = 4
warpx.dz_snapshots_lab = 0.001
warpx.boosted_frame_diag_fields= Ex Ey Ez By rho
@@ -53,7 +53,7 @@ electrons.zmax = .003
electrons.profile = constant
electrons.density = 3.5e24
electrons.do_continuous_injection = 1
-electrons.do_boosted_frame_diags = 1
+electrons.do_back_transformed_diagnostics = 1
ions.charge = q_e
ions.mass = m_p
@@ -69,7 +69,7 @@ ions.zmax = .003
ions.profile = constant
ions.density = 3.5e24
ions.do_continuous_injection = 1
-ions.do_boosted_frame_diags = 1
+ions.do_back_transformed_diagnostics = 1
beam.charge = -q_e
beam.mass = m_e
diff --git a/Examples/Modules/charged_beam/inputs b/Examples/Modules/charged_beam/inputs
deleted file mode 100644
index 18b645281..000000000
--- a/Examples/Modules/charged_beam/inputs
+++ /dev/null
@@ -1,50 +0,0 @@
-# Maximum number of time steps
-max_step = 40
-
-# number of grid points
-amr.n_cell = 63 63 63
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 32
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-
-amr.plot_int = 1 # How often to write plotfiles. "<= 0" means no plotfiles.
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 1 # Is periodic?
-geometry.prob_lo = -20.e-6 -20.e-6 -20.e-6 # physical domain
-geometry.prob_hi = 20.e-6 20.e-6 20.e-6
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-algo.current_deposition = direct
-
-# CFL
-warpx.cfl = 1.0
-
-particles.nspecies = 1
-particles.species_names = electrons
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "NUniformPerCell"
-electrons.num_particles_per_cell_each_dim = 2 2 2
-
-electrons.xmin = -20.e-6
-electrons.xmax = 0.e-6
-electrons.ymin = -20.e-6
-electrons.ymax = 20.e-6
-electrons.zmin = -20.e-6
-electrons.zmax = 20.e-6
-
-electrons.profile = constant
-electrons.density = 1.e25 # number of electrons per m^3
-
-electrons.momentum_distribution_type = "constant"
-electrons.ux = 0.01 # ux = gamma*beta_x
diff --git a/Examples/Modules/gaussian_beam/gaussian_beam_PICMI.py b/Examples/Modules/gaussian_beam/PICMI_inputs_gaussian_beam.py
index a22e83794..ecc8f5a65 100644
--- a/Examples/Modules/gaussian_beam/gaussian_beam_PICMI.py
+++ b/Examples/Modules/gaussian_beam/PICMI_inputs_gaussian_beam.py
@@ -45,9 +45,9 @@ electrons = picmi.Species(particle_type='electron', name='electrons', initial_di
protons = picmi.Species(particle_type='proton', name='protons', initial_distribution=proton_beam)
sim = picmi.Simulation(solver = solver,
- max_steps = 1000,
+ max_steps = 10,
verbose = 1,
- warpx_plot_int = 8,
+ warpx_plot_int = 10,
warpx_current_deposition_algo = 'direct')
sim.add_species(electrons, layout=picmi.PseudoRandomLayout(n_macroparticles=number_sim_particles))
diff --git a/Examples/Modules/gaussian_beam/inputs b/Examples/Modules/gaussian_beam/inputs
deleted file mode 100644
index 46cd785f2..000000000
--- a/Examples/Modules/gaussian_beam/inputs
+++ /dev/null
@@ -1,100 +0,0 @@
-# Maximum number of time steps
-max_step = 1000
-
-# number of grid points
-amr.n_cell = 32 32 32
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 16
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-
-amr.plot_int = 8 # How often to write plotfiles. "<= 0" means no plotfiles.
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 0 # Is periodic?
-geometry.prob_lo = -2. -2. -2. # physical domain
-geometry.prob_hi = 2. 2. 2.
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-
-# interpolation
-interpolation.nox = 3
-interpolation.noy = 3
-interpolation.noz = 3
-
-# CFL
-warpx.cfl = 1.0
-
-# Information about the particle species
-particles.nspecies = 2
-particles.species_names = electrons protons
-
-#
-# The electron species information
-#
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "gaussian_beam"
-electrons.x_rms = 0.25
-electrons.y_rms = 0.25
-electrons.z_rms = 0.25
-electrons.x_m = 0.
-electrons.y_m = 0.
-electrons.z_m = 0.
-electrons.npart = 32768
-electrons.q_tot = -8.010883097437485e-07
-
-electrons.profile = "constant"
-electrons.density = 1
-electrons.momentum_distribution_type = "radial_expansion"
-electrons.u_over_r = -0.04
-
-electrons.xmin = -2
-electrons.xmax = 2
-electrons.ymin = -2
-electrons.ymax = 2
-electrons.zmin = -2
-electrons.zmax = 2
-
-#
-# The proton species information
-#
-
-protons.charge = q_e
-protons.mass = m_p
-protons.injection_style = "gaussian_beam"
-protons.x_rms = 0.25
-protons.y_rms = 0.25
-protons.z_rms = 0.25
-protons.x_m = 0.
-protons.y_m = 0.
-protons.z_m = 0.
-protons.npart = 32768
-protons.q_tot = 8.010883097437485e-07
-
-protons.profile = "constant"
-protons.density = 1
-protons.momentum_distribution_type = "radial_expansion"
-protons.u_over_r = 0.
-
-protons.xmin = -2
-protons.xmax = 2
-protons.ymin = -2
-protons.ymax = 2
-protons.zmin = -2
-protons.zmax = 2
-
-warpx.do_pml = 0
-
-# Moving window
-warpx.do_moving_window = 0
-warpx.moving_window_dir = z
-warpx.moving_window_v = 1.0 # in units of the speed of light
diff --git a/Examples/Modules/ionization/ionization_analysis.py b/Examples/Modules/ionization/analysis_ionization.py
index f512eac6e..f512eac6e 100755
--- a/Examples/Modules/ionization/ionization_analysis.py
+++ b/Examples/Modules/ionization/analysis_ionization.py
diff --git a/Examples/Modules/laser_injection/Visualization.ipynb b/Examples/Modules/laser_injection/Visualization.ipynb
deleted file mode 100644
index 68dd53ac7..000000000
--- a/Examples/Modules/laser_injection/Visualization.ipynb
+++ /dev/null
@@ -1,137 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Overview\n",
- "\n",
- "This a notebook that inspects the results of a WarpX simulation.\n",
- "\n",
- "# Instructions\n",
- "\n",
- "Execute the cells below one by one, by selecting them with your mouse and typing `Shift + Enter`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "# Import statements\n",
- "import sys\n",
- "from tqdm import tqdm\n",
- "import yt, glob\n",
- "yt.funcs.mylog.setLevel(50)\n",
- "from IPython.display import clear_output\n",
- "import numpy as np\n",
- "from ipywidgets import interact, RadioButtons, IntSlider\n",
- "import matplotlib.pyplot as plt\n",
- "%matplotlib\n",
- "\n",
- "# Find iterations\n",
- "file_list = glob.glob('plt?????')\n",
- "iterations = [ int(file_name[3:]) for file_name in file_list ]"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Functions to plot the fields"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "def plot_field( iteration, field, slicing_direction='y', plotter='matplotlib' ):\n",
- " ds = yt.load( './plt%05d/' %iteration )\n",
- " all_data_level_0 = ds.covering_grid(level=0, \n",
- " left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)\n",
- " \n",
- " if plotter == 'yt':\n",
- " sl = yt.SlicePlot(ds, slicing_direction, field)\n",
- " sl.set_log( field, False)\n",
- " sl.annotate_grids()\n",
- " # Show the new plot\n",
- " clear_output()\n",
- " sl.show()\n",
- "\n",
- " elif plotter == 'matplotlib':\n",
- "\n",
- " left_edge = ds.domain_left_edge.convert_to_mks()*1.e6\n",
- " right_edge = ds.domain_right_edge.convert_to_mks()*1.e6\n",
- " \n",
- " if slicing_direction == 'x':\n",
- " n = int( ds.domain_dimensions[0]//2 )\n",
- " data2d = all_data_level_0[field][n, :, :]\n",
- " extent = [ left_edge[2], right_edge[2], left_edge[1], right_edge[1] ]\n",
- " elif slicing_direction == 'y':\n",
- " n = int( ds.domain_dimensions[1]//2 )\n",
- " data2d = all_data_level_0[field][:, n, :]\n",
- " extent = [ left_edge[2], right_edge[2], left_edge[0], right_edge[0] ]\n",
- " elif slicing_direction == 'z':\n",
- " n = int( ds.domain_dimensions[2]//2 )\n",
- " data2d = all_data_level_0[field][:, :, n]\n",
- " extent = [ left_edge[1], right_edge[1], left_edge[0], right_edge[0] ]\n",
- " plt.clf()\n",
- " plt.title(\"%s at iteration %d\" %(field, iteration) )\n",
- " plt.imshow( data2d, interpolation='nearest', cmap='viridis',\n",
- " origin='lower', extent=extent, aspect='auto' )\n",
- " plt.colorbar()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Interactive viewer"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "interact(plot_field, \n",
- " iteration = IntSlider(min=min(iterations), max=max(iterations), step=iterations[1]-iterations[0]),\n",
- " field = RadioButtons( options=['jx', 'jy', 'jz', 'Ex', 'Ey', 'Ez'], value='jz'),\n",
- " slicing_direction = RadioButtons( options=[ 'x', 'y', 'z'], value='y'),\n",
- " plotter = RadioButtons( options=['matplotlib', 'yt'] ) )"
- ]
- }
- ],
- "metadata": {
- "anaconda-cloud": {},
- "kernelspec": {
- "display_name": "Python [default]",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.5.2"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 1
-}
diff --git a/Examples/Modules/laser_injection/laser_analysis.py b/Examples/Modules/laser_injection/analysis_laser.py
index 1951bb29a..1951bb29a 100755
--- a/Examples/Modules/laser_injection/laser_analysis.py
+++ b/Examples/Modules/laser_injection/analysis_laser.py
diff --git a/Examples/Modules/nci_corrector/ncicorr_analysis.py b/Examples/Modules/nci_corrector/analysis_ncicorr.py
index 94dd2f838..94dd2f838 100755
--- a/Examples/Modules/nci_corrector/ncicorr_analysis.py
+++ b/Examples/Modules/nci_corrector/analysis_ncicorr.py
diff --git a/Examples/Modules/nci_corrector/inputs2d b/Examples/Modules/nci_corrector/inputs.2d
index 0bcffbe85..61278a8e6 100644
--- a/Examples/Modules/nci_corrector/inputs2d
+++ b/Examples/Modules/nci_corrector/inputs.2d
@@ -14,8 +14,6 @@ amr.blocking_factor = 8
# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
amr.max_level = 0
-warpx.fine_tag_lo = -20.e-6 -20.e-6
-warpx.fine_tag_hi = 20.e-6 20.e-6
# Geometry
geometry.coord_sys = 0 # 0: Cartesian
diff --git a/Examples/Modules/qed/breit_wheeler/check_2d_tau_init.py b/Examples/Modules/qed/breit_wheeler/analysis_2d_tau_init.py
index 850ecc0fe..850ecc0fe 100755
--- a/Examples/Modules/qed/breit_wheeler/check_2d_tau_init.py
+++ b/Examples/Modules/qed/breit_wheeler/analysis_2d_tau_init.py
diff --git a/Examples/Modules/qed/breit_wheeler/inputs.2d_test_tau_init b/Examples/Modules/qed/breit_wheeler/inputs.2d_test_tau_init
index 06f87f92b..98bebc015 100644
--- a/Examples/Modules/qed/breit_wheeler/inputs.2d_test_tau_init
+++ b/Examples/Modules/qed/breit_wheeler/inputs.2d_test_tau_init
@@ -11,15 +11,13 @@ geometry.is_periodic = 0 0 # Is periodic?
geometry.prob_lo = -32.e-6 -32.e-6 # physical domain
geometry.prob_hi = 32.e-6 32.e-6
amr.max_level = 0 # Maximum level in hierarchy (1 might be unstable, >1 is not supported)
-warpx.fine_tag_lo = -5.e-6 -35.e-6
-warpx.fine_tag_hi = 5.e-6 -25.e-6
#################################
############ NUMERICS ###########
#################################
algo.current_deposition = esirkepov
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.particle_pusher = boris
interpolation.nox = 3 # Particle interpolation order. Must be the same in x, y, and z
interpolation.noy = 3
@@ -28,8 +26,6 @@ warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.plot_raw_fields = 0
warpx.plot_raw_fields_guards = 0
-warpx.plot_finepatch = 0
-warpx.plot_crsepatch = 0
warpx.use_filter = 1
warpx.cfl = 1. # if 1., the time step is set to its CFL limit
warpx.do_pml = 1 # use Perfectly Matched Layer as boundary condition
@@ -63,6 +59,7 @@ photons.uz_m = 0.0
photons.ux_th = 100.
photons.uy_th = 100.
photons.uz_th = 100.
+
##########QED####################
photons.do_qed = 1
photons.do_qed_breit_wheeler = 1
diff --git a/Examples/Modules/qed/quantum_synchrotron/check_2d_tau_init.py b/Examples/Modules/qed/quantum_synchrotron/analysis_2d_tau_init.py
index 05b313ee6..05b313ee6 100755
--- a/Examples/Modules/qed/quantum_synchrotron/check_2d_tau_init.py
+++ b/Examples/Modules/qed/quantum_synchrotron/analysis_2d_tau_init.py
diff --git a/Examples/Modules/qed/quantum_synchrotron/inputs.2d_test_tau_init b/Examples/Modules/qed/quantum_synchrotron/inputs.2d_test_tau_init
index cdc5be585..8baedbf52 100644
--- a/Examples/Modules/qed/quantum_synchrotron/inputs.2d_test_tau_init
+++ b/Examples/Modules/qed/quantum_synchrotron/inputs.2d_test_tau_init
@@ -11,15 +11,13 @@ geometry.is_periodic = 0 0 # Is periodic?
geometry.prob_lo = -32.e-6 -32.e-6 # physical domain
geometry.prob_hi = 32.e-6 32.e-6
amr.max_level = 0 # Maximum level in hierarchy (1 might be unstable, >1 is not supported)
-warpx.fine_tag_lo = -5.e-6 -35.e-6
-warpx.fine_tag_hi = 5.e-6 -25.e-6
#################################
############ NUMERICS ###########
#################################
algo.current_deposition = esirkepov
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.particle_pusher = boris
interpolation.nox = 3 # Particle interpolation order. Must be the same in x, y, and z
interpolation.noy = 3
@@ -28,8 +26,6 @@ warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.plot_raw_fields = 0
warpx.plot_raw_fields_guards = 0
-warpx.plot_finepatch = 0
-warpx.plot_crsepatch = 0
warpx.use_filter = 1
warpx.cfl = 1. # if 1., the time step is set to its CFL limit
warpx.do_pml = 1 # use Perfectly Matched Layer as boundary condition
diff --git a/Examples/Modules/restart/inputs b/Examples/Modules/restart/inputs
deleted file mode 100644
index 175c714b2..000000000
--- a/Examples/Modules/restart/inputs
+++ /dev/null
@@ -1,18 +0,0 @@
-# Basic simulation parameters
-max_step = 500
-amr.n_cell = 256 256
-amr.max_grid_size = 32
-amr.max_level = 0
-particles.nspecies = 0
-
-# Geometry parameters
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 0 0 0 # Is periodic?
-geometry.prob_lo = -50.e-6 0. # physical domain
-geometry.prob_hi = 50.e-6 30.e-6
-
-# Number of iterations between consecutive checkpoint dumps
-amr.check_int = 200
-
-# Checkpoint file from which to restart the simulation.
-# amr.restart = chk00400
diff --git a/Examples/Physics_applications/laser_acceleration/laser_acceleration_PICMI.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py
index 3c86d6348..7568ac3e8 100644
--- a/Examples/Physics_applications/laser_acceleration/laser_acceleration_PICMI.py
+++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py
@@ -32,7 +32,7 @@ plasma_max = [ 20.e-6, 20.e-6, 1.e-3]
# --- Nb time steps
-max_steps = 1000
+max_steps = 10
# --- grid
diff --git a/Examples/Physics_applications/laser_acceleration/inputs.2d b/Examples/Physics_applications/laser_acceleration/inputs.2d
index 1a76feacf..8b2913f8c 100644
--- a/Examples/Physics_applications/laser_acceleration/inputs.2d
+++ b/Examples/Physics_applications/laser_acceleration/inputs.2d
@@ -11,8 +11,8 @@ geometry.is_periodic = 0 0 # Is periodic?
geometry.prob_lo = -30.e-6 -56.e-6 # physical domain
geometry.prob_hi = 30.e-6 12.e-6
amr.max_level = 0 # Maximum level in hierarchy (1 might be unstable, >1 is not supported)
-warpx.fine_tag_lo = -5.e-6 -35.e-6
-warpx.fine_tag_hi = 5.e-6 -25.e-6
+# warpx.fine_tag_lo = -5.e-6 -35.e-6
+# warpx.fine_tag_hi = 5.e-6 -25.e-6
#################################
############ NUMERICS ###########
@@ -24,8 +24,8 @@ warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.plot_raw_fields = 1
warpx.plot_raw_fields_guards = 1
-warpx.plot_finepatch = 1
-warpx.plot_crsepatch = 1
+# warpx.plot_finepatch = 1
+# warpx.plot_crsepatch = 1
warpx.use_filter = 1
warpx.cfl = 1. # if 1., the time step is set to its CFL limit
warpx.do_pml = 1 # use Perfectly Matched Layer as boundary condition
@@ -62,8 +62,6 @@ beam.y_m = 0.
beam.z_m = -28.e-6
beam.npart = 100
beam.q_tot = -1.e-12
-beam.profile = "constant"
-beam.density = 8.e23 # not used in case of a gaussian beam
beam.momentum_distribution_type = "gaussian"
beam.ux_m = 0.0
beam.uy_m = 0.0
diff --git a/Examples/Physics_applications/laser_acceleration/inputs.2d.boost b/Examples/Physics_applications/laser_acceleration/inputs.2d.boost
index d90c75ada..8bf4b6076 100644
--- a/Examples/Physics_applications/laser_acceleration/inputs.2d.boost
+++ b/Examples/Physics_applications/laser_acceleration/inputs.2d.boost
@@ -1,8 +1,8 @@
#################################
######### BOX PARAMETERS ########
#################################
-# max_step = 2700
-stop_time = 1.9e-12
+max_step = 2700
+# stop_time = 1.9e-12
amr.n_cell = 128 1024
amr.max_grid_size = 64
amr.blocking_factor = 32
@@ -21,7 +21,7 @@ warpx.verbose = 1
amrex.v = 1
algo.current_deposition = esirkepov
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.particle_pusher = vay
algo.maxwell_fdtd_solver = ckc
interpolation.nox = 3
@@ -41,7 +41,7 @@ warpx.serialize_ics = 1
#################################
warpx.gamma_boost = 10.
warpx.boost_direction = z
-warpx.do_boosted_frame_diagnostic = 1
+warpx.do_back_transformed_diagnostics = 1
warpx.num_snapshots_lab = 7
warpx.dt_snapshots_lab = 1.6678204759907604e-12
@@ -94,8 +94,6 @@ beam.y_m = 0.
beam.z_m = -20.e-6
beam.npart = 1000
beam.q_tot = -1.e-14
-beam.profile = "constant"
-beam.density = 8.e23 # number of particles per m^3
beam.momentum_distribution_type = "gaussian"
beam.ux_m = 0.0
beam.uy_m = 0.0
diff --git a/Examples/Physics_applications/laser_acceleration/inputs.3d b/Examples/Physics_applications/laser_acceleration/inputs.3d
index f055708d1..017b82962 100644
--- a/Examples/Physics_applications/laser_acceleration/inputs.3d
+++ b/Examples/Physics_applications/laser_acceleration/inputs.3d
@@ -11,8 +11,8 @@ geometry.is_periodic = 1 1 0 # Is periodic?
geometry.prob_lo = -30.e-6 -30.e-6 -56.e-6 # physical domain
geometry.prob_hi = 30.e-6 30.e-6 12.e-6
amr.max_level = 0 # Maximum level in hierarchy (1 might be unstable, >1 is not supported)
-warpx.fine_tag_lo = -5.e-6 -5.e-6 -50.e-6
-warpx.fine_tag_hi = 5.e-6 5.e-6 -30.e-6
+# warpx.fine_tag_lo = -5.e-6 -5.e-6 -50.e-6
+# warpx.fine_tag_hi = 5.e-6 5.e-6 -30.e-6
#################################
############ NUMERICS ###########
@@ -24,8 +24,8 @@ warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.plot_raw_fields = 1
warpx.plot_raw_fields_guards = 1
-warpx.plot_finepatch = 1
-warpx.plot_crsepatch = 1
+# warpx.plot_finepatch = 1
+# warpx.plot_crsepatch = 1
warpx.use_filter = 1
warpx.cfl = 1. # if 1., the time step is set to its CFL limit
warpx.do_pml = 0 # use Perfectly Matched Layer as boundary condition
diff --git a/Examples/Physics_applications/laser_acceleration/inputs.rz b/Examples/Physics_applications/laser_acceleration/inputs.rz
index 83071834e..bdaa99319 100755
--- a/Examples/Physics_applications/laser_acceleration/inputs.rz
+++ b/Examples/Physics_applications/laser_acceleration/inputs.rz
@@ -60,8 +60,6 @@ beam.y_m = 0.
beam.z_m = -28.e-6
beam.npart = 100
beam.q_tot = -1.e-12
-beam.profile = "constant"
-beam.density = 8.e23 # not used in case of a gaussian beam
beam.momentum_distribution_type = "gaussian"
beam.ux_m = 0.0
beam.uy_m = 0.0
diff --git a/Examples/Physics_applications/plasma_acceleration/plasma_acceleration_PICMI.py b/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py
index 0cd713514..7b1f9ea5d 100644
--- a/Examples/Physics_applications/plasma_acceleration/plasma_acceleration_PICMI.py
+++ b/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py
@@ -43,7 +43,7 @@ beam = picmi.Species(particle_type='electron', name='beam', initial_distribution
plasma = picmi.Species(particle_type='electron', name='plasma', initial_distribution=plasma_distribution)
sim = picmi.Simulation(solver = solver,
- max_steps = 1000,
+ max_steps = 10,
verbose = 1,
warpx_plot_int = 2,
warpx_current_deposition_algo = 'esirkepov')
diff --git a/Examples/Physics_applications/plasma_acceleration/plasma_acceleration_PICMI.mr.py b/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py
index 24b48d575..44049e244 100644
--- a/Examples/Physics_applications/plasma_acceleration/plasma_acceleration_PICMI.mr.py
+++ b/Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py
@@ -52,7 +52,7 @@ beam = picmi.Species(particle_type='electron', name='beam', initial_distribution
plasma = picmi.Species(particle_type='electron', name='plasma', initial_distribution=plasma_distribution)
sim = picmi.Simulation(solver = solver,
- max_steps = 1000,
+ max_steps = 10,
verbose = 1,
warpx_plot_int = 2,
warpx_current_deposition_algo = 'esirkepov')
diff --git a/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost b/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost
index d711815eb..8010c98d6 100644
--- a/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost
+++ b/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost
@@ -1,8 +1,8 @@
#################################
####### GENERAL PARAMETERS ######
#################################
-stop_time = 4.03658656286e-11
-amr.n_cell = 64 1280
+max_step = 2500
+amr.n_cell = 64 640
amr.max_grid_size = 128
amr.blocking_factor = 32
amr.max_level = 0
@@ -39,7 +39,7 @@ interpolation.noz = 3
#################################
warpx.gamma_boost = 10.0
warpx.boost_direction = z
-warpx.do_boosted_frame_diagnostic = 1
+warpx.do_back_transformed_diagnostics = 1
warpx.num_snapshots_lab = 22
warpx.dt_snapshots_lab = 3.335640951981521e-11
diff --git a/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost b/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost
index 42446a9ac..f65c9aa0a 100644
--- a/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost
+++ b/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost
@@ -2,7 +2,7 @@
####### GENERAL PARAMETERS ######
#################################
stop_time = 3.93151387287e-11
-amr.n_cell = 32 32 320
+amr.n_cell = 32 32 256
amr.max_grid_size = 64
amr.blocking_factor = 32
amr.max_level = 0
@@ -38,7 +38,7 @@ interpolation.noz = 3
#################################
warpx.gamma_boost = 10.0
warpx.boost_direction = z
-warpx.do_boosted_frame_diagnostic = 1
+warpx.do_back_transformed_diagnostics = 1
warpx.num_snapshots_lab = 22
warpx.dt_snapshots_lab = 3.335640951981521e-11
diff --git a/Examples/Tests/Langmuir/langmuir2d_PICMI.py b/Examples/Tests/Langmuir/PICMI_inputs_langmuir2d.py
index 8cbc63e50..cd33d20f0 100644
--- a/Examples/Tests/Langmuir/langmuir2d_PICMI.py
+++ b/Examples/Tests/Langmuir/PICMI_inputs_langmuir2d.py
@@ -40,5 +40,5 @@ sim.add_species(electrons, layout=picmi.GriddedLayout(n_macroparticle_per_cell=[
sim.write_input_file(file_name='inputs2d_from_PICMI')
# Alternatively, sim.step will run WarpX, controlling it from Python
-#sim.step()
+sim.step()
diff --git a/Examples/Tests/Langmuir/langmuir_PICMI_rt.py b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rt.py
index ae6731c05..ae6731c05 100644
--- a/Examples/Tests/Langmuir/langmuir_PICMI_rt.py
+++ b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rt.py
diff --git a/Examples/Tests/Langmuir/langmuir_PICMI_rz.py b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz.py
index 699b7e3d9..699b7e3d9 100644
--- a/Examples/Tests/Langmuir/langmuir_PICMI_rz.py
+++ b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz.py
diff --git a/Examples/Tests/Langmuir/langmuir_PICMI_rz_multimode_analyze.py b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py
index 7f853a1f5..00e54be3e 100644
--- a/Examples/Tests/Langmuir/langmuir_PICMI_rz_multimode_analyze.py
+++ b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py
@@ -79,7 +79,7 @@ sim = picmi.Simulation(solver = solver,
verbose = 1,
warpx_plot_int = 40,
warpx_current_deposition_algo = 'esirkepov',
- warpx_field_gathering_algo = 'standard',
+ warpx_field_gathering_algo = 'energy-conserving',
warpx_particle_pusher_algo = 'boris')
sim.add_species(electrons, layout=picmi.GriddedLayout(n_macroparticle_per_cell=[2,16,2], grid=grid))
diff --git a/Examples/Tests/Langmuir/langmuir_analysis.py b/Examples/Tests/Langmuir/analysis_langmuir.py
index 2ffb7f56b..2ffb7f56b 100755
--- a/Examples/Tests/Langmuir/langmuir_analysis.py
+++ b/Examples/Tests/Langmuir/analysis_langmuir.py
diff --git a/Examples/Tests/Langmuir/langmuir2d_analysis.py b/Examples/Tests/Langmuir/analysis_langmuir2d.py
index d43134115..d43134115 100755
--- a/Examples/Tests/Langmuir/langmuir2d_analysis.py
+++ b/Examples/Tests/Langmuir/analysis_langmuir2d.py
diff --git a/Examples/Tests/Langmuir/langmuir_multi_analysis.py b/Examples/Tests/Langmuir/analysis_langmuir_multi.py
index 890320be8..890320be8 100755
--- a/Examples/Tests/Langmuir/langmuir_multi_analysis.py
+++ b/Examples/Tests/Langmuir/analysis_langmuir_multi.py
diff --git a/Examples/Tests/Langmuir/langmuir_multi_2d_analysis.py b/Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py
index 169c56e7b..169c56e7b 100755
--- a/Examples/Tests/Langmuir/langmuir_multi_2d_analysis.py
+++ b/Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py
diff --git a/Examples/Tests/Langmuir/langmuir_multi_rz_analysis.py b/Examples/Tests/Langmuir/analysis_langmuir_multi_rz.py
index 2ff30eb5e..2ff30eb5e 100755
--- a/Examples/Tests/Langmuir/langmuir_multi_rz_analysis.py
+++ b/Examples/Tests/Langmuir/analysis_langmuir_multi_rz.py
diff --git a/Examples/Tests/Langmuir/inputs.2d.rz b/Examples/Tests/Langmuir/inputs.2d.rz
deleted file mode 100644
index 70850eea6..000000000
--- a/Examples/Tests/Langmuir/inputs.2d.rz
+++ /dev/null
@@ -1,55 +0,0 @@
-# Maximum number of time steps
-max_step = 100
-
-# number of grid points
-amr.n_cell = 64 64
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 32
-amr.blocking_factor = 32 32
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-
-amr.plot_int = 1 # How often to write plotfiles. "<= 0" means no plotfiles.
-
-# Geometry
-geometry.coord_sys = 1 # 1: RZ
-geometry.is_periodic = 0 1
-geometry.prob_lo = 0.e0 -2e-05 # physical domain, rmin zmin
-geometry.prob_hi = 2e-05 2e-05 # rmax zmax
-
-# Verbosity
-warpx.verbose = 1
-warpx.do_moving_window = 0
-warpx.moving_window_dir = z
-warpx.moving_window_v = 0.0 # in units of the speed of light
-
-# Algorithms
-algo.current_deposition = direct
-interpolation.nox = 1
-interpolation.noy = 1
-interpolation.noz = 1
-
-# CFL
-warpx.cfl = 1.0
-
-particles.nspecies = 1
-particles.species_names = electrons
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "NUniformPerCell"
-electrons.num_particles_per_cell_each_dim = 2 1 2
-
-electrons.zmax = 0.0
-
-electrons.profile = constant
-electrons.density = 1.e25 # number of electrons per m^3
-
-electrons.momentum_distribution_type = "constant"
-electrons.ux = 0.0
-electrons.uy = 0.0
-electrons.uz = 0.1
-electrons.radially_weighted = true # Only true is supported
diff --git a/Examples/Tests/Langmuir/inputs.lb b/Examples/Tests/Langmuir/inputs.lb
deleted file mode 100644
index 73ededb23..000000000
--- a/Examples/Tests/Langmuir/inputs.lb
+++ /dev/null
@@ -1,59 +0,0 @@
-# Maximum number of time steps
-max_step = 400
-max_step = 10
-
-# number of grid points
-amr.n_cell = 16 16 8
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 8
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-
-amr.plot_int = 1 # How often to write plotfiles. "<= 0" means no plotfiles.
-amr.check_int = -1 # How often to write checkpoint files. "<= 0" means no plotfiles.
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 1 # Is periodic?
-geometry.prob_lo = -20.e-6 -20.e-6 -20.e-6 # physical domain
-geometry.prob_hi = 20.e-6 20.e-6 20.e-6
-
-# Verbosity
-warpx.verbose = 1
-
-warpx.do_moving_window = 0
-warpx.moving_window_dir = 0
-warpx.moving_window_v = 0.0 # in units of the speed of light
-
-# Dynamic Load Balancing
-warpx.regrid_int = 1
-
-# Algorithms
-algo.current_deposition = direct
-
-# CFL
-warpx.cfl = 1.0
-
-particles.nspecies = 1
-particles.species_names = electrons
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "NUniformPerCell"
-electrons.num_particles_per_cell_each_dim = 2 2 2
-
-electrons.xmin = -20.e-6
-electrons.xmax = 0.e-6
-electrons.ymin = -20.e-6
-electrons.ymax = 20.e-6
-electrons.zmin = -20.e-6
-electrons.zmax = 20.e-6
-
-electrons.profile = constant
-electrons.density = 1.e25 # number of electrons per m^3
-
-electrons.momentum_distribution_type = "constant"
-electrons.ux = 1.0 # ux = gamma*beta_x
diff --git a/Examples/Tests/Langmuir/inputs.multi.2d.rt b/Examples/Tests/Langmuir/inputs.multi.2d.rt
index 54d4e2c16..c0b0b1286 100644
--- a/Examples/Tests/Langmuir/inputs.multi.2d.rt
+++ b/Examples/Tests/Langmuir/inputs.multi.2d.rt
@@ -25,7 +25,7 @@ warpx.serialize_ics = 1
warpx.verbose = 1
# Algorithms
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
# Interpolation
interpolation.nox = 1
diff --git a/Examples/Tests/Langmuir/inputs.multi.rt b/Examples/Tests/Langmuir/inputs.multi.rt
index 0dd0da3b8..00d82cc3b 100644
--- a/Examples/Tests/Langmuir/inputs.multi.rt
+++ b/Examples/Tests/Langmuir/inputs.multi.rt
@@ -27,7 +27,7 @@ warpx.verbose = 1
# Algorithms
algo.current_deposition = direct
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
# Interpolation
interpolation.nox = 1
diff --git a/Examples/Tests/Langmuir/inputs.multi.rz.rt b/Examples/Tests/Langmuir/inputs.multi.rz.rt
index c2d5de756..9e76d4b26 100644
--- a/Examples/Tests/Langmuir/inputs.multi.rz.rt
+++ b/Examples/Tests/Langmuir/inputs.multi.rz.rt
@@ -26,7 +26,7 @@ warpx.serialize_ics = 1
warpx.verbose = 1
# Algorithms
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.current_deposition = esirkepov
# Interpolation
diff --git a/Examples/Tests/Langmuir/inputs.nolb b/Examples/Tests/Langmuir/inputs.nolb
deleted file mode 100644
index 6ac0629cb..000000000
--- a/Examples/Tests/Langmuir/inputs.nolb
+++ /dev/null
@@ -1,59 +0,0 @@
-# Maximum number of time steps
-max_step = 400
-max_step = 10
-
-# number of grid points
-amr.n_cell = 16 16 8
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 8
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-
-amr.plot_int = 1 # How often to write plotfiles. "<= 0" means no plotfiles.
-amr.check_int = -1 # How often to write checkpoint files. "<= 0" means no plotfiles.
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 1 # Is periodic?
-geometry.prob_lo = -20.e-6 -20.e-6 -20.e-6 # physical domain
-geometry.prob_hi = 20.e-6 20.e-6 20.e-6
-
-# Verbosity
-warpx.verbose = 1
-
-warpx.do_moving_window = 0
-warpx.moving_window_dir = 0
-warpx.moving_window_v = 0.0 # in units of the speed of light
-
-# Dynamic Load Balancing
-warpx.regrid_int = -1
-
-# Algorithms
-algo.current_deposition = direct
-
-# CFL
-warpx.cfl = 1.0
-
-particles.nspecies = 1
-particles.species_names = electrons
-
-electrons.charge = -q_e
-electrons.mass = m_e
-electrons.injection_style = "NUniformPerCell"
-electrons.num_particles_per_cell_each_dim = 2 2 2
-
-electrons.xmin = -20.e-6
-electrons.xmax = 0.e-6
-electrons.ymin = -20.e-6
-electrons.ymax = 20.e-6
-electrons.zmin = -20.e-6
-electrons.zmax = 20.e-6
-
-electrons.profile = constant
-electrons.density = 1.e25 # number of electrons per m^3
-
-electrons.momentum_distribution_type = "constant"
-electrons.ux = 1.0 # ux = gamma*beta_x
diff --git a/Examples/Tests/Langmuir/inputs.rt b/Examples/Tests/Langmuir/inputs.rt
index 28602f758..bd1162972 100644
--- a/Examples/Tests/Langmuir/inputs.rt
+++ b/Examples/Tests/Langmuir/inputs.rt
@@ -25,7 +25,7 @@ warpx.serialize_ics = 1
warpx.verbose = 1
# Algorithms
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.particle_pusher = "higuera"
# Interpolation
diff --git a/Examples/Tests/Langmuir/langmuir_PICMI.py b/Examples/Tests/Langmuir/langmuir_PICMI.py
deleted file mode 100644
index ea1c93ba3..000000000
--- a/Examples/Tests/Langmuir/langmuir_PICMI.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# --- Simple example of Langmuir oscillations in a uniform plasma
-
-import numpy as np
-from pywarpx import picmi
-
-constants = picmi.constants
-
-nx = 64
-ny = 64
-nz = 64
-
-xmin = -20.e-6
-ymin = -20.e-6
-zmin = -20.e-6
-xmax = +20.e-6
-ymax = +20.e-6
-zmax = +20.e-6
-
-uniform_plasma = picmi.UniformDistribution(density = 1.e25,
- upper_bound = [0., None, None],
- directed_velocity = [0.1*constants.c, 0., 0.])
-
-electrons = picmi.Species(particle_type='electron', name='electrons', initial_distribution=uniform_plasma)
-
-grid = picmi.Cartesian3DGrid(number_of_cells = [nx, ny, nz],
- lower_bound = [xmin, ymin, zmin],
- upper_bound = [xmax, ymax, zmax],
- lower_boundary_conditions = ['periodic', 'periodic', 'periodic'],
- upper_boundary_conditions = ['periodic', 'periodic', 'periodic'],
- moving_window_velocity = [0., 0., 0.],
- warpx_max_grid_size=32)
-
-solver = picmi.ElectromagneticSolver(grid=grid, cfl=1.)
-
-sim = picmi.Simulation(solver = solver,
- max_steps = 40,
- verbose = 1,
- warpx_plot_int = 1,
- warpx_current_deposition_algo = 'direct',
- warpx_charge_deposition_algo = 'standard',
- warpx_field_gathering_algo = 'standard',
- warpx_particle_pusher_algo = 'boris')
-
-sim.add_species(electrons, layout=picmi.GriddedLayout(n_macroparticle_per_cell=[2,2,2], grid=grid))
-
-# write_inputs will create an inputs file that can be used to run
-# with the compiled version.
-sim.write_input_file(file_name='inputs_from_PICMI')
-
-# Alternatively, sim.step will run WarpX, controlling it from Python
-sim.step()
-
diff --git a/Examples/Tests/Larmor/inputs b/Examples/Tests/Larmor/inputs
deleted file mode 100644
index d7c66477c..000000000
--- a/Examples/Tests/Larmor/inputs
+++ /dev/null
@@ -1,77 +0,0 @@
-# Maximum number of time steps
-max_step = 200
-
-# number of grid points
-amr.n_cell = 32 32
-
-# The lo and hi ends of grids are multipliers of blocking factor
-amr.blocking_factor = 16
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 64
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 0
-
-warpx.fine_tag_lo = -0.8 -0.8
-warpx.fine_tag_hi = 0.8 0.8
-
-amr.plot_int = 1 # How often to write plotfiles. "<= 0" means no plotfiles.
-
-warpx.plot_raw_fields = 1
-warpx.plot_finepatch = 1
-warpx.plot_crsepatch = 1
-warpx.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell divE divB
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 0 0 0 # Is periodic?
-geometry.prob_lo = -2.0 -2.0 # physical domain
-geometry.prob_hi = 2.0 2.0
-
-# PML
-warpx.do_pml = 1
-warpx.pml_ncell = 10
-
-warpx.B_external_particle = 0.0 0.00078110417851950768 0.0
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-
-# CFL
-warpx.cfl = 1.0
-
-# particles
-particles.nspecies = 2
-particles.species_names = electron positron
-
-particles.nspecies = 1
-particles.species_names = electron
-
-electron.charge = -q_e
-electron.mass = m_e
-electron.injection_style = "SingleParticle"
-electron.single_particle_pos = 0.0 0.0 -1.25
-electron.single_particle_vel = -0.45825756949558416 0.0 0.0 # gamma*beta
-
-positron.charge = q_e
-positron.mass = m_e
-positron.injection_style = "SingleParticle"
-positron.single_particle_pos = 0.0 0.0 -1.25
-positron.single_particle_vel = 0.45825756949558416 0.0 0.0 # gamma*beta
-
-electron.single_particle_weight = 1.0e12
-positron.single_particle_weight = 1.0e12
-
-# interpolation
-interpolation.nox = 3
-interpolation.noy = 3
-interpolation.noz = 3
-
-# Moving window
-warpx.do_moving_window = 0
-
-warpx.do_dive_cleaning = 1
diff --git a/Examples/Tests/Larmor/inputs.ml b/Examples/Tests/Larmor/inputs.mr
index c3ddf597d..30166a3d6 100644
--- a/Examples/Tests/Larmor/inputs.ml
+++ b/Examples/Tests/Larmor/inputs.mr
@@ -48,9 +48,6 @@ warpx.cfl = 1.0
particles.nspecies = 2
particles.species_names = electron positron
-particles.nspecies = 1
-particles.species_names = electron
-
electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "SingleParticle"
diff --git a/Examples/Tests/PML/inputs2d b/Examples/Tests/PML/inputs.2d
index c6abe2b88..c6abe2b88 100644
--- a/Examples/Tests/PML/inputs2d
+++ b/Examples/Tests/PML/inputs.2d
diff --git a/Examples/Tests/SingleParticle/bilinear_filter_analysis.py b/Examples/Tests/SingleParticle/analysis_bilinear_filter.py
index 494434279..494434279 100755
--- a/Examples/Tests/SingleParticle/bilinear_filter_analysis.py
+++ b/Examples/Tests/SingleParticle/analysis_bilinear_filter.py
diff --git a/Examples/Tests/SingleParticle/inputs b/Examples/Tests/SingleParticle/inputs
index 548848d79..4db020065 100644
--- a/Examples/Tests/SingleParticle/inputs
+++ b/Examples/Tests/SingleParticle/inputs
@@ -10,7 +10,7 @@ geometry.prob_lo = -8 -12
geometry.prob_hi = 8 12
warpx.do_pml = 0
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
warpx.cfl = 1.0
particles.nspecies = 1
diff --git a/Examples/Tests/gpu_test/inputs b/Examples/Tests/gpu_test/inputs
index e4ae27469..9cb6b819b 100644
--- a/Examples/Tests/gpu_test/inputs
+++ b/Examples/Tests/gpu_test/inputs
@@ -25,7 +25,7 @@ warpx.verbose = 1
# Algorithms
algo.current_deposition = direct
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
interpolation.nox = 1
interpolation.noy = 1
diff --git a/Examples/Tests/laser_on_fine/inputs b/Examples/Tests/laser_on_fine/inputs
deleted file mode 100644
index 83d70e6a1..000000000
--- a/Examples/Tests/laser_on_fine/inputs
+++ /dev/null
@@ -1,73 +0,0 @@
-# Maximum number of time steps
-max_step = 500
-
-# number of grid points
-amr.n_cell = 64 64 64
-
-# The lo and hi ends of grids are multipliers of blocking factor
-amr.blocking_factor = 32
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 64
-
-# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
-amr.max_level = 1
-
-warpx.fine_tag_lo = -10.e-6 -10.e-6 -0.4e-6
-warpx.fine_tag_hi = 10.e-6 10.e-6 0.4e-6
-
-amr.plot_int = 10 # How often to write plotfiles. "<= 0" means no plotfiles.
-
-warpx.plot_raw_fields = 1
-warpx.plot_finepatch = 1
-warpx.plot_crsepatch = 1
-warpx.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell divB
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 1 1 0 # Is periodic?
-geometry.prob_lo = -30.e-6 -30.e-6 -1.25e-6 # physical domain
-geometry.prob_hi = 30.e-6 30.e-6 1.25e-6
-
-# PML
-warpx.do_pml = 1
-warpx.pml_ncell = 10
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-algo.current_deposition = esirkepov
-algo.charge_deposition = standard
-algo.field_gathering = standard
-
-# CFL
-warpx.cfl = 1.0
-particles.nspecies = 0
-
-# interpolation
-interpolation.nox = 1
-interpolation.noy = 1
-interpolation.noz = 1
-
-# Moving window
-warpx.do_moving_window = 0
-warpx.moving_window_dir = z
-warpx.moving_window_v = 1.0 # in units of the speed of light
-
-# Laser
-lasers.nlasers = 1
-lasers.names = laser1
-laser1.prob_lo = -12.e-6 -12.e-6 -5.e-6
-laser1.prob_hi = 12.e-6 12.e-6 5.e-6
-laser1.profile = Gaussian
-laser1.position = 0. 0. 0.e-6 # This point is on the laser plane
-laser1.direction = 0. 0. 1. # The plane normal direction
-laser1.polarization = 1. 0. 0. # The main polarization vector
-laser1.e_max = 16.e12 # Maximum amplitude of the laser field (in V/m)
-laser1.profile_waist = 3.e-6 # The waist of the laser (in meters)
-laser1.profile_duration = 15.e-15 # The duration of the laser (in seconds)
-laser1.profile_t_peak = 30.e-15 # The time at which the laser reaches its peak (in seconds)
-laser1.profile_focal_distance = 100.e-6 # Focal distance from the antenna (in meters)
-laser1.wavelength = 0.8e-6 # The wavelength of the laser (in meters)
diff --git a/Examples/Tests/laser_on_fine/inputs.2d b/Examples/Tests/laser_on_fine/inputs.2d
index 6919bac64..5ae4237d6 100644
--- a/Examples/Tests/laser_on_fine/inputs.2d
+++ b/Examples/Tests/laser_on_fine/inputs.2d
@@ -2,7 +2,7 @@
max_step = 500
# number of grid points
-amr.n_cell = 64 64 64
+amr.n_cell = 64 64
# The lo and hi ends of grids are multipliers of blocking factor
amr.blocking_factor = 32
@@ -40,7 +40,7 @@ warpx.verbose = 1
# Algorithms
algo.current_deposition = esirkepov
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
# CFL
warpx.cfl = 1.0
@@ -53,8 +53,6 @@ interpolation.noz = 1
# Moving window
warpx.do_moving_window = 0
-warpx.moving_window_dir = z
-warpx.moving_window_v = 1.0 # in units of the speed of light
# Laser
lasers.nlasers = 1
diff --git a/Examples/Tests/particle_pusher/inputs b/Examples/Tests/particle_pusher/inputs
index 5bf0330f8..45ba7fa70 100755
--- a/Examples/Tests/particle_pusher/inputs
+++ b/Examples/Tests/particle_pusher/inputs
@@ -21,7 +21,7 @@ warpx.do_pml = 0
# Algorithms
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
algo.particle_pusher = "higuera"
# CFL
diff --git a/Examples/Tests/particles_in_PML/analysis.py b/Examples/Tests/particles_in_PML/analysis_particles_in_pml.py
index 96406d717..96406d717 100755
--- a/Examples/Tests/particles_in_PML/analysis.py
+++ b/Examples/Tests/particles_in_PML/analysis_particles_in_pml.py
diff --git a/Examples/Tests/particles_in_PML/inputs2d b/Examples/Tests/particles_in_PML/inputs.2d
index 9c5a64921..9c5a64921 100644
--- a/Examples/Tests/particles_in_PML/inputs2d
+++ b/Examples/Tests/particles_in_PML/inputs.2d
diff --git a/Examples/Tests/photon_pusher/check.py b/Examples/Tests/photon_pusher/analysis_photon_pusher.py
index 3e6873842..d0986de48 100755
--- a/Examples/Tests/photon_pusher/check.py
+++ b/Examples/Tests/photon_pusher/analysis_photon_pusher.py
@@ -112,7 +112,7 @@ def generate():
f.write("geometry.prob_hi = 0.5e-6 0.5e-6 0.5e-6\n")
f.write("warpx.do_pml = 0\n")
f.write("algo.charge_deposition = standard\n")
- f.write("algo.field_gathering = standard\n")
+ f.write("algo.field_gathering = energy-conserving\n")
f.write("warpx.cfl = 1.0\n")
f.write("\nparticles.nspecies = {}\n".format(len(spec_names)))
diff --git a/Examples/Tests/photon_pusher/inputs b/Examples/Tests/photon_pusher/inputs
index 751eb2a6e..1d61d76b4 100644
--- a/Examples/Tests/photon_pusher/inputs
+++ b/Examples/Tests/photon_pusher/inputs
@@ -14,7 +14,7 @@ geometry.prob_lo = -0.5e-6 -0.5e-6 -0.5e-6
geometry.prob_hi = 0.5e-6 0.5e-6 0.5e-6
warpx.do_pml = 0
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
warpx.cfl = 1.0
particles.nspecies = 16
diff --git a/Examples/Tests/radiation_reaction/test_const_B_analytical/check.py b/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py
index 616fa930a..b4f17cf7c 100755
--- a/Examples/Tests/radiation_reaction/test_const_B_analytical/check.py
+++ b/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py
@@ -149,7 +149,7 @@ def generate():
f.write("geometry.prob_hi = {} {} {}\n".format(sim_size, sim_size, sim_size))
f.write("warpx.do_pml = 0\n")
f.write("algo.charge_deposition = standard\n")
- f.write("algo.field_gathering = standard\n")
+ f.write("algo.field_gathering = energy-conserving\n")
f.write("warpx.cfl = 1.0\n")
f.write("warpx.serialize_ics = 1\n")
diff --git a/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs b/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs
index d57770812..e8fdbe984 100644
--- a/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs
+++ b/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs
@@ -13,7 +13,7 @@ geometry.prob_lo = -8e-07 -8e-07 -8e-07
geometry.prob_hi = 8e-07 8e-07 8e-07
warpx.do_pml = 0
algo.charge_deposition = standard
-algo.field_gathering = standard
+algo.field_gathering = energy-conserving
warpx.cfl = 1.0
warpx.serialize_ics = 1
diff --git a/Examples/Tests/self_force_test/inputs b/Examples/Tests/self_force_test/inputs
deleted file mode 100644
index 5e7bcc4f8..000000000
--- a/Examples/Tests/self_force_test/inputs
+++ /dev/null
@@ -1,70 +0,0 @@
-# Maximum number of time steps
-max_step = 50000
-
-# number of grid points
-amr.n_cell = 64 64 64
-
-# The lo and hi ends of grids are multipliers of blocking factor
-amr.blocking_factor = 16
-
-# Maximum allowable size of each subdomain in the problem domain;
-# this is used to decompose the domain for parallel calculations.
-amr.max_grid_size = 64
-
-# Maximum level in hierarchy
-amr.max_level = 1
-
-warpx.fine_tag_lo = -0.5e-5 -0.5e-5 -0.5e-5
-warpx.fine_tag_hi = 0.5e-5 0.5e-5 0.5e-5
-
-warpx.do_electrostatic = 1
-warpx.n_buffer = 4
-warpx.const_dt = 1.0e-10;
-
-amr.plot_int = -1 # How often to write plotfiles. "<= 0" means no plotfiles.
-
-warpx.plot_raw_fields = 0
-warpx.plot_divb = 0
-warpx.plot_finepatch = 0
-warpx.plot_crsepatch = 0
-
-# Geometry
-geometry.coord_sys = 0 # 0: Cartesian
-geometry.is_periodic = 0 0 0 # Is periodic?
-geometry.prob_lo = -2.0e-5 -2.0e-5 -2.0e-5 # physical domain
-geometry.prob_hi = 2.0e-5 2.0e-5 2.0e-5
-
-# PML
-warpx.do_pml = 0
-warpx.pml_ncell = 10
-
-# Verbosity
-warpx.verbose = 1
-
-# Algorithms
-algo.current_deposition = esirkepov
-algo.charge_deposition = standard
-algo.field_gathering = standard
-
-# CFL
-warpx.cfl = 1.0
-
-# particles
-particles.nspecies = 1
-particles.species_names = electron
-
-electron.charge = -q_e
-electron.mass = m_e
-electron.injection_style = "SingleParticle"
-electron.single_particle_pos = -2.5e-6 0.0 0.0
-electron.single_particle_vel = 0.0 0.0 0.0 # gamma*beta
-
-electron.single_particle_weight = 1.0
-
-# interpolation
-interpolation.nox = 1
-interpolation.noy = 1
-interpolation.noz = 1
-
-# Moving window
-warpx.do_moving_window = 0
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index c33700278..c4e6803d5 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -671,10 +671,10 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic):
pywarpx.warpx.check_consistency('dt_snapshots_lab', self.dt_snapshots, 'The time between snapshots must be the same in all lab frame diagnostics')
pywarpx.warpx.check_consistency('lab_data_directory', self.write_dir, 'The write directory must be the same in all lab frame diagnostics')
- pywarpx.warpx.do_boosted_frame_diagnostic = 1
+ pywarpx.warpx.do_back_transformed_diagnostics = 1
pywarpx.warpx.num_snapshots_lab = self.num_snapshots
pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots
- pywarpx.warpx.do_boosted_frame_fields = 1
+ pywarpx.warpx.do_back_transformed_fields = 1
pywarpx.warpx.lab_data_directory = self.write_dir
@@ -685,8 +685,8 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic)
pywarpx.warpx.check_consistency('dt_snapshots_lab', self.dt_snapshots, 'The time between snapshots must be the same in all lab frame diagnostics')
pywarpx.warpx.check_consistency('lab_data_directory', self.write_dir, 'The write directory must be the same in all lab frame diagnostics')
- pywarpx.warpx.do_boosted_frame_diagnostic = 1
+ pywarpx.warpx.do_back_transformed_diagnostics = 1
pywarpx.warpx.num_snapshots_lab = self.num_snapshots
pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots
- pywarpx.warpx.do_boosted_frame_particles = 1
+ pywarpx.warpx.do_back_transformed_particles = 1
pywarpx.warpx.lab_data_directory = self.write_dir
diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini
index a3521cf6a..19da4ba04 100644
--- a/Regression/WarpX-tests.ini
+++ b/Regression/WarpX-tests.ini
@@ -59,8 +59,8 @@ branch = master
[pml_x_yee]
buildDir = .
-inputFile = Examples/Tests/PML/inputs2d
-runtime_params = warpx.do_dynamic_scheduling=0 algo.maxwell_fdtd_solver=yee
+inputFile = Examples/Tests/PML/inputs.2d
+runtime_params = warpx.do_dynamic_scheduling=0 algo.maxwell_fdtd_solver=yee amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -74,8 +74,8 @@ analysisRoutine = Examples/Tests/PML/analysis_pml_yee.py
[pml_x_ckc]
buildDir = .
-inputFile = Examples/Tests/PML/inputs2d
-runtime_params = warpx.do_dynamic_scheduling=0 algo.maxwell_fdtd_solver=ckc
+inputFile = Examples/Tests/PML/inputs.2d
+runtime_params = warpx.do_dynamic_scheduling=0 algo.maxwell_fdtd_solver=ckc amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -89,8 +89,8 @@ analysisRoutine = Examples/Tests/PML/analysis_pml_ckc.py
[pml_x_psatd]
buildDir = .
-inputFile = Examples/Tests/PML/inputs2d
-runtime_params = warpx.do_dynamic_scheduling=0
+inputFile = Examples/Tests/PML/inputs.2d
+runtime_params = warpx.do_dynamic_scheduling=0 amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString = USE_PSATD=TRUE
restartTest = 0
@@ -105,6 +105,7 @@ analysisRoutine = Examples/Tests/PML/analysis_pml_psatd.py
[RigidInjection_lab]
buildDir = .
inputFile = Examples/Modules/RigidInjection/inputs.LabFrame
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -117,9 +118,10 @@ doVis = 0
compareParticles = 0
analysisRoutine = Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py
-[RigidInjection_boost_backtransformed]
+[RigidInjection_BTD]
buildDir = .
inputFile = Examples/Modules/RigidInjection/inputs.BoostedFrame
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -134,7 +136,7 @@ doComparison = 0
aux1File = Tools/read_raw_data.py
analysisRoutine = Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py
-[Boost_3Dbacktransformed_CheckReducedDiagnostics]
+[BTD_ReducedSliceDiag]
buildDir = .
inputFile = Examples/Modules/boosted_diags/inputs.3d.slice
dim = 3
@@ -153,8 +155,8 @@ analysisRoutine = Examples/Modules/boosted_diags/analysis_3Dbacktransformed_diag
[nci_corrector]
buildDir = .
-inputFile = Examples/Modules/nci_corrector/inputs2d
-runtime_params = amr.max_level=0 particles.use_fdtd_nci_corr=1
+inputFile = Examples/Modules/nci_corrector/inputs.2d
+runtime_params = amr.max_level=0 particles.use_fdtd_nci_corr=1 amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -165,12 +167,12 @@ numthreads = 2
compileTest = 0
doVis = 0
doComparison = 0
-analysisRoutine = Examples/Modules/nci_corrector/ncicorr_analysis.py
+analysisRoutine = Examples/Modules/nci_corrector/analysis_ncicorr.py
[nci_correctorMR]
buildDir = .
-inputFile = Examples/Modules/nci_corrector/inputs2d
-runtime_params = amr.max_level=1 particles.use_fdtd_nci_corr=1 amr.n_cell=64 64
+inputFile = Examples/Modules/nci_corrector/inputs.2d
+runtime_params = amr.max_level=1 particles.use_fdtd_nci_corr=1 amr.n_cell=64 64 amrex.abort_on_unused_inputs=1 warpx.fine_tag_lo=-20.e-6 -20.e-6 warpx.fine_tag_hi=20.e-6 20.e-6
dim = 2
addToCompileString =
restartTest = 0
@@ -181,11 +183,12 @@ numthreads = 2
compileTest = 0
doVis = 0
doComparison = 0
-analysisRoutine = Examples/Modules/nci_corrector/ncicorr_analysis.py
+analysisRoutine = Examples/Modules/nci_corrector/analysis_ncicorr.py
[ionization_lab]
buildDir = .
inputFile = Examples/Modules/ionization/inputs.rt
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -195,11 +198,12 @@ useOMP = 1
numthreads = 1
compileTest = 0
doVis = 0
-analysisRoutine = Examples/Modules/ionization/ionization_analysis.py
+analysisRoutine = Examples/Modules/ionization/analysis_ionization.py
[ionization_boost]
buildDir = .
inputFile = Examples/Modules/ionization/inputs.bf.rt
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -209,12 +213,12 @@ useOMP = 1
numthreads = 1
compileTest = 0
doVis = 0
-analysisRoutine = Examples/Modules/ionization/ionization_analysis.py
+analysisRoutine = Examples/Modules/ionization/analysis_ionization.py
[bilinear_filter]
buildDir = .
inputFile = Examples/Tests/SingleParticle/inputs
-runtime_params = warpx.use_filter=1 warpx.filter_npass_each_dir=1 5
+runtime_params = warpx.use_filter=1 warpx.filter_npass_each_dir=1 5 amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -224,11 +228,12 @@ useOMP = 1
numthreads = 2
compileTest = 0
doVis = 0
-analysisRoutine = Examples/Tests/SingleParticle/bilinear_filter_analysis.py
+analysisRoutine = Examples/Tests/SingleParticle/analysis_bilinear_filter.py
[Langmuir_2d]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.rt
+runtime_params = electrons.ux=0.01 electrons.xmax=0.e-6 warpx.fields_to_plot=Ex jx electrons.plot_vars=w ux Ex amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -240,13 +245,13 @@ compileTest = 0
doVis = 0
compareParticles = 1
particleTypes = electrons
-runtime_params = electrons.ux=0.01 electrons.xmax=0.e-6 warpx.fields_to_plot=Ex jx electrons.plot_vars=w ux Ex
-analysisRoutine = Examples/Tests/Langmuir/langmuir2d_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir2d.py
analysisOutputImage = langmuir2d_analysis.png
[Langmuir_2d_nompi]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.rt
+runtime_params = electrons.ux=0.01 electrons.xmax=0.e-6 warpx.fields_to_plot=Ex jx electrons.plot_vars=w ux Ex amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -258,13 +263,13 @@ compileTest = 0
doVis = 0
compareParticles = 1
particleTypes = electrons
-runtime_params = electrons.ux=0.01 electrons.xmax=0.e-6 warpx.fields_to_plot=Ex jx electrons.plot_vars=w ux Ex
-analysisRoutine = Examples/Tests/Langmuir/langmuir2d_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir2d.py
analysisOutputImage = langmuir2d_analysis.png
[Langmuir_x]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.rt
+runtime_params = electrons.ux=0.01 electrons.xmax=0.e-6 warpx.do_dynamic_scheduling=0 warpx.fields_to_plot = Ex jx electrons.plot_vars=w ux Ex amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -276,13 +281,13 @@ compileTest = 0
doVis = 0
compareParticles = 1
particleTypes = electrons
-runtime_params = electrons.ux=0.01 electrons.xmax=0.e-6 warpx.do_dynamic_scheduling=0 warpx.fields_to_plot = Ex jx electrons.plot_vars=w ux Ex
-analysisRoutine = Examples/Tests/Langmuir/langmuir_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir.py
analysisOutputImage = langmuir_x_analysis.png
[Langmuir_y]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.rt
+runtime_params = electrons.uy=0.01 electrons.ymax=0.e-6 warpx.do_dynamic_scheduling=0 warpx.fields_to_plot = Ey jy electrons.plot_vars=w uy Ey amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -294,13 +299,13 @@ compileTest = 0
doVis = 0
compareParticles = 1
particleTypes = electrons
-runtime_params = electrons.uy=0.01 electrons.ymax=0.e-6 warpx.do_dynamic_scheduling=0 warpx.fields_to_plot = Ey jy electrons.plot_vars=w uy Ey
-analysisRoutine = Examples/Tests/Langmuir/langmuir_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir.py
analysisOutputImage = langmuir_y_analysis.png
[Langmuir_z]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.rt
+runtime_params = electrons.uz=0.01 electrons.zmax=0.e-6 warpx.do_dynamic_scheduling=0 warpx.fields_to_plot = Ez jz electrons.plot_vars=w uz Ez amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -312,13 +317,13 @@ compileTest = 0
doVis = 0
compareParticles = 1
particleTypes = electrons
-runtime_params = electrons.uz=0.01 electrons.zmax=0.e-6 warpx.do_dynamic_scheduling=0 warpx.fields_to_plot = Ez jz electrons.plot_vars=w uz Ez
-analysisRoutine = Examples/Tests/Langmuir/langmuir_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir.py
analysisOutputImage = langmuir_z_analysis.png
[Langmuir_multi]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.rt
+runtime_params = warpx.do_dynamic_scheduling=0 amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -329,14 +334,14 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 1
-runtime_params = warpx.do_dynamic_scheduling=0
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi.py
analysisOutputImage = langmuir_multi_analysis.png
[Langmuir_multi_nodal]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.rt
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.do_nodal=1 amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -347,14 +352,14 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 1
-runtime_params = warpx.do_dynamic_scheduling=0 warpx.do_nodal=1
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi.py
analysisOutputImage = langmuir_multi_analysis.png
[Langmuir_multi_psatd]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.rt
+runtime_params = psatd.fftw_plan_measure=0 amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString = USE_PSATD=TRUE
restartTest = 0
@@ -366,14 +371,14 @@ compileTest = 0
doVis = 0
compareParticles = 1
tolerance = 5.e-11
-runtime_params = psatd.fftw_plan_measure=0
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi.py
analysisOutputImage = langmuir_multi_analysis.png
[Langmuir_multi_psatd_nodal]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.rt
+runtime_params = psatd.fftw_plan_measure=0 warpx.do_dynamic_scheduling=0 warpx.do_nodal=1 amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString = USE_PSATD=TRUE
restartTest = 0
@@ -385,14 +390,14 @@ compileTest = 0
doVis = 0
compareParticles = 1
tolerance = 5.e-11
-runtime_params = psatd.fftw_plan_measure=0 warpx.do_dynamic_scheduling=0 warpx.do_nodal=1
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi.py
analysisOutputImage = langmuir_multi_analysis.png
[Langmuir_multi_2d_nodal]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.2d.rt
+runtime_params = warpx.do_nodal=1 algo.current_deposition=direct electrons.plot_vars=w ux uy uz Ex Ey Ez positrons.plot_vars=w ux uy uz Ex Ey Ez amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -403,14 +408,14 @@ numthreads = 1
compileTest = 0
doVis = 0
compareParticles = 1
-runtime_params = warpx.do_nodal=1 algo.current_deposition=direct electrons.plot_vars=w ux uy uz Ex Ey Ez positrons.plot_vars=w ux uy uz Ex Ey Ez
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_2d_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py
analysisOutputImage = langmuir_multi_2d_analysis.png
[Langmuir_multi_2d_psatd]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.2d.rt
+runtime_params = psatd.fftw_plan_measure=0 electrons.plot_vars=w ux uy uz Ex Ey Ez positrons.plot_vars=w ux uy uz Ex Ey Ez warpx.fields_to_plot=Ex Ey Ez jx jy jz part_per_cell amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString = USE_PSATD=TRUE
restartTest = 0
@@ -421,14 +426,14 @@ numthreads = 1
compileTest = 0
doVis = 0
compareParticles = 1
-runtime_params = psatd.fftw_plan_measure=0 electrons.plot_vars=w ux uy uz Ex Ey Ez positrons.plot_vars=w ux uy uz Ex Ey Ez warpx.fields_to_plot=Ex Ey Ez jx jy jz part_per_cell
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_2d_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py
analysisOutputImage = langmuir_multi_2d_analysis.png
[Langmuir_multi_2d_psatd_nodal]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.2d.rt
+runtime_params = psatd.fftw_plan_measure=0 warpx.do_nodal=1 algo.current_deposition=direct electrons.plot_vars=w ux uy uz Ex Ey Ez positrons.plot_vars=w ux uy uz Ex Ey Ez warpx.fields_to_plot=Ex Ey Ez jx jy jz part_per_cell amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString = USE_PSATD=TRUE
restartTest = 0
@@ -439,14 +444,14 @@ numthreads = 1
compileTest = 0
doVis = 0
compareParticles = 1
-runtime_params = psatd.fftw_plan_measure=0 warpx.do_nodal=1 algo.current_deposition=direct electrons.plot_vars=w ux uy uz Ex Ey Ez positrons.plot_vars=w ux uy uz Ex Ey Ez warpx.fields_to_plot=Ex Ey Ez jx jy jz part_per_cell
particleTypes = electrons positrons
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_2d_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py
analysisOutputImage = langmuir_multi_2d_analysis.png
[Langmuir_multi_rz]
buildDir = .
inputFile = Examples/Tests/Langmuir/inputs.multi.rz.rt
+runtime_params = electrons.plot_vars=w ux uy uz Ex Ey Ez Bx By ions.plot_vars=w ux uy uz Ex Ey Ez Bx By amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString = USE_RZ=TRUE
restartTest = 0
@@ -456,16 +461,16 @@ useOMP = 1
numthreads = 1
compileTest = 0
doVis = 0
-runtime_params = electrons.plot_vars=w ux uy uz Ex Ey Ez Bx By ions.plot_vars=w ux uy uz Ex Ey Ez Bx By
compareParticles = 1
particleTypes = electrons ions
-analysisRoutine = Examples/Tests/Langmuir/langmuir_multi_rz_analysis.py
+analysisRoutine = Examples/Tests/Langmuir/analysis_langmuir_multi_rz.py
analysisOutputImage = langmuir_multi_rz_analysis.png
-[Langmuir_rz_multimode]
+[Python_Langmuir_rz_multimode]
buildDir = .
-inputFile = Examples/Tests/Langmuir/langmuir_PICMI_rz_multimode_analyze.py
-customRunCmd = python langmuir_PICMI_rz_multimode_analyze.py
+inputFile = Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py
+runtime_params = amrex.abort_on_unused_inputs=1
+customRunCmd = python PICMI_inputs_langmuir_rz_multimode_analyze.py
dim = 2
addToCompileString = USE_PYTHON_MAIN=TRUE USE_RZ=TRUE
restartTest = 0
@@ -482,6 +487,7 @@ outputFile = diags/plotfiles/plt00040
[LaserInjection]
buildDir = .
inputFile = Examples/Modules/laser_injection/inputs.rt
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -492,12 +498,13 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Modules/laser_injection/laser_analysis.py
+analysisRoutine = Examples/Modules/laser_injection/analysis_laser.py
analysisOutputImage = laser_analysis.png
[LaserInjection_2d]
buildDir = .
inputFile = Examples/Modules/laser_injection/inputs.2d.rt
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1 amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -507,13 +514,12 @@ useOMP = 1
numthreads = 2
compileTest = 0
doVis = 0
-runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1
compareParticles = 0
[LaserAcceleration]
buildDir = .
inputFile = Examples/Physics_applications/laser_acceleration/inputs.3d
-runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=32 32 256 max_step=100 electrons.zmin=0.e-6 warpx.serialize_ics=1
+runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=32 32 256 max_step=100 electrons.zmin=0.e-6 warpx.serialize_ics=1 amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 0
@@ -529,7 +535,7 @@ particleTypes = electrons
[subcyclingMR]
buildDir = .
inputFile = Examples/Tests/subcycling/inputs.2d
-runtime_params = warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0
+runtime_params = warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0 amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -545,7 +551,7 @@ compareParticles = 0
[LaserAccelerationMR]
buildDir = .
inputFile = Examples/Physics_applications/laser_acceleration/inputs.2d
-runtime_params = amr.max_level=1 max_step=200 warpx.serialize_ics=1
+runtime_params = amr.max_level=1 max_step=200 warpx.serialize_ics=1 amrex.abort_on_unused_inputs=1 warpx.fine_tag_lo=-5.e-6 -35.e-6 warpx.fine_tag_hi=5.e-6 -25.e-6
dim = 2
addToCompileString =
restartTest = 0
@@ -561,7 +567,7 @@ particleTypes = electrons beam
[PlasmaAccelerationMR]
buildDir = .
inputFile = Examples/Physics_applications/plasma_acceleration/inputs.2d
-runtime_params = amr.max_level=1 amr.n_cell=32 512 max_step=400 warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0
+runtime_params = amr.max_level=1 amr.n_cell=32 512 max_step=400 warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0 amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString =
restartTest = 0
@@ -576,8 +582,9 @@ particleTypes = beam driver plasma_e
[Python_Langmuir]
buildDir = .
-inputFile = Examples/Tests/Langmuir/langmuir_PICMI_rt.py
-customRunCmd = python langmuir_PICMI_rt.py
+inputFile = Examples/Tests/Langmuir/PICMI_inputs_langmuir_rt.py
+runtime_params = amrex.abort_on_unused_inputs=1
+customRunCmd = python PICMI_inputs_langmuir_rt.py
dim = 3
addToCompileString = USE_PYTHON_MAIN=TRUE
restartTest = 0
@@ -594,6 +601,7 @@ outputFile = diags/plotfiles/plt00040
[uniform_plasma_restart]
buildDir = .
inputFile = Examples/Physics_applications/uniform_plasma/inputs.3d
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 3
addToCompileString =
restartTest = 1
@@ -610,7 +618,8 @@ tolerance = 1.e-14
[particles_in_pml_2d]
buildDir = .
-inputFile = Examples/Tests/particles_in_PML/inputs2d
+inputFile = Examples/Tests/particles_in_PML/inputs.2d
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
restartTest = 0
useMPI = 1
@@ -620,11 +629,12 @@ numthreads = 1
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Tests/particles_in_PML/analysis.py
+analysisRoutine = Examples/Tests/particles_in_PML/analysis_particles_in_pml.py
[particles_in_pml]
buildDir = .
inputFile = Examples/Tests/particles_in_PML/inputs
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 3
restartTest = 0
useMPI = 1
@@ -634,11 +644,12 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Tests/particles_in_PML/analysis.py
+analysisRoutine = Examples/Tests/particles_in_PML/analysis_particles_in_pml.py
[photon_pusher]
buildDir = .
inputFile = Examples/Tests/photon_pusher/inputs
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 3
restartTest = 0
useMPI = 1
@@ -648,7 +659,7 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Tests/photon_pusher/check.py
+analysisRoutine = Examples/Tests/photon_pusher/analysis_photon_pusher.py
[radiation_reaction]
@@ -663,11 +674,12 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Tests/radiation_reaction/test_const_B_analytical/check.py
+analysisRoutine = Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py
[qed_breit_wheeler_tau_init]
buildDir = .
inputFile = Examples/Modules/qed/breit_wheeler/inputs.2d_test_tau_init
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString = QED=TRUE
restartTest = 0
@@ -678,11 +690,12 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Modules/qed/breit_wheeler/check_2d_tau_init.py
+analysisRoutine = Examples/Modules/qed/breit_wheeler/analysis_2d_tau_init.py
[qed_quantum_sync_tau_init]
buildDir = .
inputFile = Examples/Modules/qed/quantum_synchrotron/inputs.2d_test_tau_init
+runtime_params = amrex.abort_on_unused_inputs=1
dim = 2
addToCompileString = QED=TRUE
restartTest = 0
@@ -693,7 +706,7 @@ numthreads = 2
compileTest = 0
doVis = 0
compareParticles = 0
-analysisRoutine = Examples/Modules/qed/quantum_synchrotron/check_2d_tau_init.py
+analysisRoutine = Examples/Modules/qed/quantum_synchrotron/analysis_2d_tau_init.py
[particle_pusher]
buildDir = .
@@ -708,3 +721,242 @@ compileTest = 0
doVis = 0
compareParticles = 0
analysisRoutine = Examples/Tests/particle_pusher/analysis_pusher.py
+
+[Python_gaussian_beam]
+buildDir = .
+inputFile = Examples/Modules/gaussian_beam/PICMI_inputs_gaussian_beam.py
+customRunCmd = python PICMI_inputs_gaussian_beam.py
+dim = 3
+addToCompileString = USE_PYTHON_MAIN=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+compareParticles = 1
+particleTypes = electrons
+
+[PlasmaAccelerationBoost2d]
+buildDir = .
+inputFile = Examples/Physics_applications/plasma_acceleration/inputs.2d.boost
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1 amr.n_cell=64 256 max_step=20
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[Python_PlasmaAcceleration]
+buildDir = .
+inputFile = Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration.py
+customRunCmd = python PICMI_inputs_plasma_acceleration.py
+dim = 3
+addToCompileString = USE_PYTHON_MAIN=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+compareParticles = 1
+particleTypes = beam
+
+[Python_PlasmaAccelerationMR]
+buildDir = .
+inputFile = Examples/Physics_applications/plasma_acceleration/PICMI_inputs_plasma_acceleration_mr.py
+customRunCmd = python PICMI_inputs_plasma_acceleration_mr.py
+dim = 3
+addToCompileString = USE_PYTHON_MAIN=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+compareParticles = 1
+particleTypes = beam
+
+[PlasmaAccelerationBoost3d]
+buildDir = .
+inputFile = Examples/Physics_applications/plasma_acceleration/inputs.3d.boost
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1 amr.n_cell=64 64 128 max_step=5
+dim = 3
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[PlasmaMirror]
+buildDir = .
+inputFile = Examples/Physics_applications/plasma_mirror/inputs.2d
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1 amr.n_cell=256 128 max_step=20
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[momentum-conserving-gather]
+buildDir = .
+inputFile = Examples/Physics_applications/plasma_acceleration/inputs.2d
+runtime_params = amr.max_level=1 amr.n_cell=32 512 max_step=400 warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0 algo.field_gathering=momentum-conserving
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+compareParticles = 1
+particleTypes = beam driver plasma_e
+
+[LaserAccelerationRZ]
+buildDir = .
+inputFile = Examples/Physics_applications/laser_acceleration/inputs.rz
+runtime_params = max_step=10
+dim = 2
+addToCompileString = USE_RZ=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 4
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+runtime_params = electrons.plot_vars=w ux uy uz Ex Ey Ez Bx By beam.plot_vars=w ux uy uz Ex Ey Ez Bx By
+compareParticles = 1
+particleTypes = electrons beam
+
+[Python_LaserAccelerationMR]
+buildDir = .
+inputFile = Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py
+customRunCmd = python PICMI_inputs_laser_acceleration.py
+dim = 3
+addToCompileString = USE_PYTHON_MAIN=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+compareParticles = 1
+particleTypes = electrons
+
+[Python_Langmuir_2d]
+buildDir = .
+inputFile = Examples/Tests/Langmuir/PICMI_inputs_langmuir2d.py
+customRunCmd = python PICMI_inputs_langmuir2d.py
+dim = 2
+addToCompileString = USE_PYTHON_MAIN=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+compareParticles = 1
+particleTypes = electrons
+
+[Python_Langmuir_rz_multimode]
+buildDir = .
+inputFile = Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz.py
+customRunCmd = python PICMI_inputs_langmuir_rz.py
+dim = 2
+addToCompileString = USE_PYTHON_MAIN=TRUE USE_RZ=TRUE
+restartTest = 0
+useMPI = 1
+numprocs = 4
+useOMP = 1
+numthreads = 1
+compileTest = 0
+doVis = 0
+
+[GPU_inputs]
+buildDir = .
+inputFile = Examples/Tests/gpu_test/inputs
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1
+dim = 3
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[LaserOnFine]
+buildDir = .
+inputFile = Examples/Tests/laser_on_fine/inputs.2d
+runtime_params = max_step=50
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[Larmor]
+buildDir = .
+inputFile = Examples/Tests/Larmor/inputs.mr
+runtime_params = max_step=10
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[Uniform_2d]
+buildDir = .
+inputFile = Examples/Physics_applications/uniform_plasma/inputs.2d
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
+[LaserAccelerationBoost]
+buildDir = .
+inputFile = Examples/Physics_applications/laser_acceleration/inputs.2d.boost
+runtime_params = warpx.do_dynamic_scheduling=0 warpx.serialize_ics=1 amr.n_cell=64 512 max_step=20
+dim = 2
+addToCompileString =
+restartTest = 0
+useMPI = 1
+numprocs = 2
+useOMP = 1
+numthreads = 2
+compileTest = 0
+doVis = 0
+
diff --git a/Source/Diagnostics/BoostedFrameDiagnostic.H b/Source/Diagnostics/BackTransformedDiagnostic.H
index 5d95aaf7d..9e24caa1b 100644
--- a/Source/Diagnostics/BoostedFrameDiagnostic.H
+++ b/Source/Diagnostics/BackTransformedDiagnostic.H
@@ -1,5 +1,5 @@
-#ifndef WARPX_BoostedFrameDiagnostic_H_
-#define WARPX_BoostedFrameDiagnostic_H_
+#ifndef WARPX_BackTransformedDiagnostic_H_
+#define WARPX_BackTransformedDiagnostic_H_
#include <vector>
#include <map>
@@ -150,7 +150,7 @@ class LabFrameSlice : public LabFrameDiag {
};
/** \brief
- * BoostedFrameDiagnostic class handles the back-transformation of data when
+ * BackTransformedDiagnostic class handles the back-transformation of data when
* running simulations in a boosted frame of reference to the lab-frame.
* Because of the relativity of simultaneity, events that are synchronized
* in the simulation boosted frame are not
@@ -163,13 +163,13 @@ class LabFrameSlice : public LabFrameDiag {
* to the output directory. The functions Flush() and writeLabFrameData()
* are called at the end of the simulation and when the
* the buffer for data storage is full, respectively. The particle data
- * is collected and written only if particle.do_boosted_frame_diagnostic = 1.
+ * is collected and written only if particle.do_back_transformed_diagnostics = 1.
*/
-class BoostedFrameDiagnostic {
+class BackTransformedDiagnostic {
public:
- BoostedFrameDiagnostic(amrex::Real zmin_lab, amrex::Real zmax_lab,
+ BackTransformedDiagnostic(amrex::Real zmin_lab, amrex::Real zmax_lab,
amrex::Real v_window_lab, amrex::Real dt_snapshots_lab,
int N_snapshots, amrex::Real dt_slice_snapshots_lab,
int N_slice_snapshots, amrex::Real gamma_boost,
diff --git a/Source/Diagnostics/BoostedFrameDiagnostic.cpp b/Source/Diagnostics/BackTransformedDiagnostic.cpp
index 297b4f5be..2880b37b1 100644
--- a/Source/Diagnostics/BoostedFrameDiagnostic.cpp
+++ b/Source/Diagnostics/BackTransformedDiagnostic.cpp
@@ -1,7 +1,7 @@
#include <AMReX_MultiFabUtil.H>
#include <AMReX_MultiFabUtil_C.H>
-#include "BoostedFrameDiagnostic.H"
+#include "BackTransformedDiagnostic.H"
#include "SliceDiagnostic.H"
#include "WarpX_f.H"
#include "WarpX.H"
@@ -514,8 +514,8 @@ LorentzTransformZ(MultiFab& data, Real gamma_boost, Real beta_boost, int ncomp)
}
}
-BoostedFrameDiagnostic::
-BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab,
+BackTransformedDiagnostic::
+BackTransformedDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab,
Real dt_snapshots_lab, int N_snapshots,
Real dt_slice_snapshots_lab, int N_slice_snapshots,
Real gamma_boost, Real t_boost, Real dt_boost,
@@ -531,10 +531,10 @@ BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab,
{
- BL_PROFILE("BoostedFrameDiagnostic::BoostedFrameDiagnostic");
+ BL_PROFILE("BackTransformedDiagnostic::BackTransformedDiagnostic");
- AMREX_ALWAYS_ASSERT(WarpX::do_boosted_frame_fields or
- WarpX::do_boosted_frame_particles);
+ AMREX_ALWAYS_ASSERT(WarpX::do_back_transformed_fields or
+ WarpX::do_back_transformed_particles);
inv_gamma_boost_ = 1.0 / gamma_boost_;
beta_boost_ = std::sqrt(1.0 - inv_gamma_boost_*inv_gamma_boost_);
@@ -679,9 +679,9 @@ BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab,
AMREX_ALWAYS_ASSERT(max_box_size_ >= num_buffer_);
}
-void BoostedFrameDiagnostic::Flush(const Geometry& geom)
+void BackTransformedDiagnostic::Flush(const Geometry& geom)
{
- BL_PROFILE("BoostedFrameDiagnostic::Flush");
+ BL_PROFILE("BackTransformedDiagnostic::Flush");
VisMF::Header::Version current_version = VisMF::GetHeaderVersion();
VisMF::SetHeaderVersion(amrex::VisMF::Header::NoFabHeader_v1);
@@ -696,7 +696,7 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom)
int i_lab = (LabFrameDiags_[i]->current_z_lab - zmin_lab) / dz_lab_;
if (LabFrameDiags_[i]->buff_counter_ != 0) {
- if (WarpX::do_boosted_frame_fields) {
+ if (WarpX::do_back_transformed_fields) {
const BoxArray& ba = LabFrameDiags_[i]->data_buffer_->boxArray();
const int hi = ba[0].bigEnd(boost_direction_);
const int lo = hi - LabFrameDiags_[i]->buff_counter_ + 1;
@@ -731,12 +731,12 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom)
#endif
}
- if (WarpX::do_boosted_frame_particles) {
+ if (WarpX::do_back_transformed_particles) {
// Loop over species to be dumped to BFD
- for (int j = 0; j < mypc.nSpeciesBoostedFrameDiags(); ++j) {
+ for (int j = 0; j < mypc.nSpeciesBackTransformedDiagnostics(); ++j) {
// Get species name
std::string species_name =
- species_names[mypc.mapSpeciesBoostedFrameDiags(j)];
+ species_names[mypc.mapSpeciesBackTransformedDiagnostics(j)];
#ifdef WARPX_USE_HDF5
// Dump species data
writeParticleDataHDF5(LabFrameDiags_[i]->particles_buffer_[j],
@@ -765,12 +765,12 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom)
void
-BoostedFrameDiagnostic::
+BackTransformedDiagnostic::
writeLabFrameData(const MultiFab* cell_centered_data,
const MultiParticleContainer& mypc,
const Geometry& geom, const Real t_boost, const Real dt) {
- BL_PROFILE("BoostedFrameDiagnostic::writeLabFrameData");
+ BL_PROFILE("BackTransformedDiagnostic::writeLabFrameData");
VisMF::Header::Version current_version = VisMF::GetHeaderVersion();
VisMF::SetHeaderVersion(amrex::VisMF::Header::NoFabHeader_v1);
@@ -808,7 +808,7 @@ writeLabFrameData(const MultiFab* cell_centered_data,
// If buffer of snapshot i is empty...
if ( LabFrameDiags_[i]->buff_counter_ == 0) {
// ... reset fields buffer data_buffer_
- if (WarpX::do_boosted_frame_fields) {
+ if (WarpX::do_back_transformed_fields) {
LabFrameDiags_[i]->buff_box_.setSmall(boost_direction_,
i_lab - num_buffer_ + 1);
LabFrameDiags_[i]->buff_box_.setBig(boost_direction_, i_lab);
@@ -820,12 +820,12 @@ writeLabFrameData(const MultiFab* cell_centered_data,
buff_dm, ncomp_to_dump, 0) );
}
// ... reset particle buffer particles_buffer_[i]
- if (WarpX::do_boosted_frame_particles)
+ if (WarpX::do_back_transformed_particles)
LabFrameDiags_[i]->particles_buffer_.resize(
- mypc.nSpeciesBoostedFrameDiags());
+ mypc.nSpeciesBackTransformedDiagnostics());
}
- if (WarpX::do_boosted_frame_fields) {
+ if (WarpX::do_back_transformed_fields) {
const int ncomp = cell_centered_data->nComp();
const int start_comp = 0;
const bool interpolate = true;
@@ -873,7 +873,7 @@ writeLabFrameData(const MultiFab* cell_centered_data,
tmp_slice_ptr.reset(nullptr);
}
- if (WarpX::do_boosted_frame_particles) {
+ if (WarpX::do_back_transformed_particles) {
if (LabFrameDiags_[i]->t_lab != prev_t_lab ) {
if (tmp_particle_buffer.size()>0)
@@ -881,7 +881,7 @@ writeLabFrameData(const MultiFab* cell_centered_data,
tmp_particle_buffer.clear();
tmp_particle_buffer.shrink_to_fit();
}
- tmp_particle_buffer.resize(mypc.nSpeciesBoostedFrameDiags());
+ tmp_particle_buffer.resize(mypc.nSpeciesBackTransformedDiagnostics());
mypc.GetLabFrameData( LabFrameDiags_[i]->file_name, i_lab,
boost_direction_, old_z_boost,
LabFrameDiags_[i]->current_z_boost,
@@ -889,7 +889,7 @@ writeLabFrameData(const MultiFab* cell_centered_data,
tmp_particle_buffer);
}
LabFrameDiags_[i]->AddPartDataToParticleBuffer(tmp_particle_buffer,
- mypc.nSpeciesBoostedFrameDiags());
+ mypc.nSpeciesBackTransformedDiagnostics());
}
++LabFrameDiags_[i]->buff_counter_;
@@ -898,7 +898,7 @@ writeLabFrameData(const MultiFab* cell_centered_data,
// If buffer full, write to disk.
if ( LabFrameDiags_[i]->buff_counter_ == num_buffer_) {
- if (WarpX::do_boosted_frame_fields) {
+ if (WarpX::do_back_transformed_fields) {
#ifdef WARPX_USE_HDF5
Box buff_box = LabFrameDiags_[i]->buff_box_;
@@ -916,12 +916,12 @@ writeLabFrameData(const MultiFab* cell_centered_data,
#endif
}
- if (WarpX::do_boosted_frame_particles) {
+ if (WarpX::do_back_transformed_particles) {
// Loop over species to be dumped to BFD
- for (int j = 0; j < mypc.nSpeciesBoostedFrameDiags(); ++j) {
+ for (int j = 0; j < mypc.nSpeciesBackTransformedDiagnostics(); ++j) {
// Get species name
const std::string species_name = species_names[
- mypc.mapSpeciesBoostedFrameDiags(j)];
+ mypc.mapSpeciesBackTransformedDiagnostics(j)];
#ifdef WARPX_USE_HDF5
// Write data to disk (HDF5)
writeParticleDataHDF5(LabFrameDiags_[i]->particles_buffer_[j],
@@ -949,7 +949,7 @@ writeLabFrameData(const MultiFab* cell_centered_data,
#ifdef WARPX_USE_HDF5
void
-BoostedFrameDiagnostic::
+BackTransformedDiagnostic::
writeParticleDataHDF5(const WarpXParticleContainer::DiagnosticParticleData& pdata,
const std::string& name, const std::string& species_name)
{
@@ -997,11 +997,11 @@ writeParticleDataHDF5(const WarpXParticleContainer::DiagnosticParticleData& pdat
#endif
void
-BoostedFrameDiagnostic::
+BackTransformedDiagnostic::
writeParticleData(const WarpXParticleContainer::DiagnosticParticleData& pdata,
const std::string& name, const int i_lab)
{
- BL_PROFILE("BoostedFrameDiagnostic::writeParticleData");
+ BL_PROFILE("BackTransformedDiagnostic::writeParticleData");
std::string field_name;
std::ofstream ofs;
@@ -1047,10 +1047,10 @@ writeParticleData(const WarpXParticleContainer::DiagnosticParticleData& pdata,
}
void
-BoostedFrameDiagnostic::
+BackTransformedDiagnostic::
writeMetaData ()
{
- BL_PROFILE("BoostedFrameDiagnostic::writeMetaData");
+ BL_PROFILE("BackTransformedDiagnostic::writeMetaData");
if (ParallelDescriptor::IOProcessor()) {
const std::string fullpath = WarpX::lab_data_directory + "/snapshots";
@@ -1134,7 +1134,7 @@ LabFrameSnapShot(Real t_lab_in, Real t_boost, Real inv_gamma_boost_in,
file_num, 5);
createLabFrameDirectories();
buff_counter_ = 0;
- if (WarpX::do_boosted_frame_fields) data_buffer_.reset(nullptr);
+ if (WarpX::do_back_transformed_fields) data_buffer_.reset(nullptr);
}
void
@@ -1158,7 +1158,7 @@ createLabFrameDirectories() {
if (ParallelDescriptor::IOProcessor())
{
- if (WarpX::do_boosted_frame_fields)
+ if (WarpX::do_back_transformed_fields)
{
const auto lo = lbound(buff_box_);
for (int comp = 0; comp < ncomp_to_dump_; ++comp) {
@@ -1176,15 +1176,15 @@ createLabFrameDirectories() {
ParallelDescriptor::Barrier();
- if (WarpX::do_boosted_frame_particles){
+ if (WarpX::do_back_transformed_particles){
auto & mypc = WarpX::GetInstance().GetPartContainer();
const std::vector<std::string> species_names = mypc.GetSpeciesNames();
// Loop over species to be dumped to BFD
- for (int j = 0; j < mypc.nSpeciesBoostedFrameDiags(); ++j)
+ for (int j = 0; j < mypc.nSpeciesBackTransformedDiagnostics(); ++j)
{
// Loop over species to be dumped to BFD
std::string species_name =
- species_names[mypc.mapSpeciesBoostedFrameDiags(j)];
+ species_names[mypc.mapSpeciesBackTransformedDiagnostics(j)];
output_create_species_group(file_name, species_name);
for (int k = 0; k < static_cast<int>(particle_field_names.size()); ++k)
{
@@ -1211,10 +1211,10 @@ createLabFrameDirectories() {
const std::string particles_prefix = "particle";
// Loop over species to be dumped to BFD
- for(int i = 0; i < mypc.nSpeciesBoostedFrameDiags(); ++i) {
+ for(int i = 0; i < mypc.nSpeciesBackTransformedDiagnostics(); ++i) {
// Get species name
std::string species_name =
- species_names[mypc.mapSpeciesBoostedFrameDiags(i)];
+ species_names[mypc.mapSpeciesBackTransformedDiagnostics(i)];
const std::string fullpath = file_name + "/" + species_name;
if (!UtilCreateDirectory(fullpath, 0755))
CreateDirectoryFailed(fullpath);
@@ -1302,7 +1302,7 @@ LabFrameSlice(Real t_lab_in, Real t_boost, Real inv_gamma_boost_in,
dx_ = cell_dx;
dy_ = cell_dy;
- if (WarpX::do_boosted_frame_fields) data_buffer_.reset(nullptr);
+ if (WarpX::do_back_transformed_fields) data_buffer_.reset(nullptr);
}
void
diff --git a/Source/Diagnostics/Make.package b/Source/Diagnostics/Make.package
index dfd947d53..b624d6ebe 100644
--- a/Source/Diagnostics/Make.package
+++ b/Source/Diagnostics/Make.package
@@ -1,9 +1,9 @@
CEXE_sources += WarpXIO.cpp
-CEXE_sources += BoostedFrameDiagnostic.cpp
+CEXE_sources += BackTransformedDiagnostic.cpp
CEXE_sources += ParticleIO.cpp
CEXE_sources += FieldIO.cpp
CEXE_headers += FieldIO.H
-CEXE_headers += BoostedFrameDiagnostic.H
+CEXE_headers += BackTransformedDiagnostic.H
CEXE_headers += ElectrostaticIO.cpp
CEXE_headers += SliceDiagnostic.H
CEXE_sources += SliceDiagnostic.cpp
diff --git a/Source/Evolve/WarpXEvolveEM.cpp b/Source/Evolve/WarpXEvolveEM.cpp
index 7a3262703..b5fd52bdc 100644
--- a/Source/Evolve/WarpXEvolveEM.cpp
+++ b/Source/Evolve/WarpXEvolveEM.cpp
@@ -141,9 +141,9 @@ WarpX::EvolveEM (int numsteps)
bool do_insitu = ((step+1) >= insitu_start) &&
(insitu_int > 0) && ((step+1) % insitu_int == 0);
- if (do_boosted_frame_diagnostic) {
+ if (do_back_transformed_diagnostics) {
std::unique_ptr<MultiFab> cell_centered_data = nullptr;
- if (WarpX::do_boosted_frame_fields) {
+ if (WarpX::do_back_transformed_fields) {
cell_centered_data = GetCellCenteredData();
}
myBFD->writeLabFrameData(cell_centered_data.get(), *mypc, geom[0], cur_time, dt[0]);
@@ -261,7 +261,7 @@ WarpX::EvolveEM (int numsteps)
WriteCheckPointFile();
}
- if (do_boosted_frame_diagnostic) {
+ if (do_back_transformed_diagnostics) {
myBFD->Flush(geom[0]);
}
diff --git a/Source/Initialization/InjectorPosition.H b/Source/Initialization/InjectorPosition.H
index 6ecae93e0..4ab2fa022 100644
--- a/Source/Initialization/InjectorPosition.H
+++ b/Source/Initialization/InjectorPosition.H
@@ -29,21 +29,25 @@ struct InjectorPositionRegular
// is a_ppc*(ref_fac**AMREX_SPACEDIM).
AMREX_GPU_HOST_DEVICE
amrex::XDim3
- getPositionUnitBox (int i_part, int ref_fac=1) const noexcept
+ getPositionUnitBox (int const i_part, int const ref_fac=1) const noexcept
{
- int nx = ref_fac*ppc.x;
- int ny = ref_fac*ppc.y;
+ using namespace amrex;
+
+ int const nx = ref_fac*ppc.x;
+ int const ny = ref_fac*ppc.y;
#if (defined WARPX_DIM_3D) || (defined WARPX_DIM_RZ)
- int nz = ref_fac*ppc.z;
+ int const nz = ref_fac*ppc.z;
#else
- int nz = 1;
+ int const nz = 1;
#endif
- int ix_part = i_part/(ny*nz); // written this way backward compatibility
- int iz_part = (i_part-ix_part*(ny*nz)) / ny;
- int iy_part = (i_part-ix_part*(ny*nz)) - ny*iz_part;
- return amrex::XDim3{(amrex::Real(0.5)+ix_part)/nx,
- (amrex::Real(0.5)+iy_part)/ny,
- (amrex::Real(0.5)+iz_part) / nz};
+ int const ix_part = i_part / (ny*nz); // written this way backward compatibility
+ int const iz_part = (i_part-ix_part*(ny*nz)) / ny;
+ int const iy_part = (i_part-ix_part*(ny*nz)) - ny*iz_part;
+ return XDim3{
+ (0.5_rt + ix_part) / nx,
+ (0.5_rt + iy_part) / ny,
+ (0.5_rt + iz_part) / nz
+ };
}
private:
amrex::Dim3 ppc;
@@ -100,7 +104,7 @@ struct InjectorPosition
// (the union is called Object, and the instance is called object).
AMREX_GPU_HOST_DEVICE
amrex::XDim3
- getPositionUnitBox (int i_part, int ref_fac=1) const noexcept
+ getPositionUnitBox (int const i_part, int const ref_fac=1) const noexcept
{
switch (type)
{
diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp
index a2e59c177..0814f369b 100644
--- a/Source/Initialization/WarpXInitData.cpp
+++ b/Source/Initialization/WarpXInitData.cpp
@@ -82,14 +82,14 @@ WarpX::InitData ()
void
WarpX::InitDiagnostics () {
- if (do_boosted_frame_diagnostic) {
+ if (do_back_transformed_diagnostics) {
const Real* current_lo = geom[0].ProbLo();
const Real* current_hi = geom[0].ProbHi();
Real dt_boost = dt[0];
// Find the positions of the lab-frame box that corresponds to the boosted-frame box at t=0
Real zmin_lab = current_lo[moving_window_dir]/( (1.+beta_boost)*gamma_boost );
Real zmax_lab = current_hi[moving_window_dir]/( (1.+beta_boost)*gamma_boost );
- myBFD.reset(new BoostedFrameDiagnostic(zmin_lab,
+ myBFD.reset(new BackTransformedDiagnostic(zmin_lab,
zmax_lab,
moving_window_v, dt_snapshots_lab,
num_snapshots_lab,
diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp
index 8571c74ad..9493672e0 100644
--- a/Source/Laser/LaserParticleContainer.cpp
+++ b/Source/Laser/LaserParticleContainer.cpp
@@ -26,7 +26,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
{
charge = 1.0;
mass = std::numeric_limits<Real>::max();
- do_boosted_frame_diags = 0;
+ do_back_transformed_diagnostics = 0;
ParmParse pp(laser_name);
@@ -100,7 +100,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
}
// Plane normal
- Real s = 1.0/std::sqrt(nvec[0]*nvec[0] + nvec[1]*nvec[1] + nvec[2]*nvec[2]);
+ Real s = 1.0_rt / std::sqrt(nvec[0]*nvec[0] + nvec[1]*nvec[1] + nvec[2]*nvec[2]);
nvec = { nvec[0]*s, nvec[1]*s, nvec[2]*s };
if (WarpX::gamma_boost > 1.) {
@@ -119,19 +119,19 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
}
// The first polarization vector
- s = 1.0/std::sqrt(p_X[0]*p_X[0] + p_X[1]*p_X[1] + p_X[2]*p_X[2]);
+ s = 1.0_rt / std::sqrt(p_X[0]*p_X[0] + p_X[1]*p_X[1] + p_X[2]*p_X[2]);
p_X = { p_X[0]*s, p_X[1]*s, p_X[2]*s };
- Real dp = std::inner_product(nvec.begin(), nvec.end(), p_X.begin(), 0.0);
+ Real const dp = std::inner_product(nvec.begin(), nvec.end(), p_X.begin(), 0.0);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(std::abs(dp) < 1.0e-14,
"Laser plane vector is not perpendicular to the main polarization vector");
p_Y = CrossProduct(nvec, p_X); // The second polarization vector
- s = 1.0/std::sqrt(stc_direction[0]*stc_direction[0] + stc_direction[1]*stc_direction[1] + stc_direction[2]*stc_direction[2]);
+ s = 1.0_rt / std::sqrt(stc_direction[0]*stc_direction[0] + stc_direction[1]*stc_direction[1] + stc_direction[2]*stc_direction[2]);
stc_direction = { stc_direction[0]*s, stc_direction[1]*s, stc_direction[2]*s };
- dp = std::inner_product(nvec.begin(), nvec.end(), stc_direction.begin(), 0.0);
- AMREX_ALWAYS_ASSERT_WITH_MESSAGE(std::abs(dp) < 1.0e-14,
+ Real const dp2 = std::inner_product(nvec.begin(), nvec.end(), stc_direction.begin(), 0.0);
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(std::abs(dp2) < 1.0e-14,
"stc_direction is not perpendicular to the laser plane vector");
// Get angle between p_X and stc_direction
@@ -266,20 +266,20 @@ LaserParticleContainer::InitData (int lev)
position = updated_position;
}
- auto Transform = [&](int i, int j) -> Vector<Real>{
+ auto Transform = [&](int const i, int const j) -> Vector<Real>{
#if (AMREX_SPACEDIM == 3)
- return { position[0] + (S_X*(i+0.5))*u_X[0] + (S_Y*(j+0.5))*u_Y[0],
- position[1] + (S_X*(i+0.5))*u_X[1] + (S_Y*(j+0.5))*u_Y[1],
- position[2] + (S_X*(i+0.5))*u_X[2] + (S_Y*(j+0.5))*u_Y[2] };
+ return { position[0] + (S_X*(Real(i)+0.5_rt))*u_X[0] + (S_Y*(Real(j)+0.5_rt))*u_Y[0],
+ position[1] + (S_X*(Real(i)+0.5_rt))*u_X[1] + (S_Y*(Real(j)+0.5_rt))*u_Y[1],
+ position[2] + (S_X*(Real(i)+0.5_rt))*u_X[2] + (S_Y*(Real(j)+0.5_rt))*u_Y[2] };
#else
# if (defined WARPX_DIM_RZ)
- return { position[0] + (S_X*(i+0.5)),
+ return { position[0] + (S_X*(Real(i)+0.5)),
0.0,
position[2]};
# else
- return { position[0] + (S_X*(i+0.5))*u_X[0],
+ return { position[0] + (S_X*(Real(i)+0.5))*u_X[0],
0.0,
- position[2] + (S_X*(i+0.5))*u_X[2] };
+ position[2] + (S_X*(Real(i)+0.5))*u_X[2] };
# endif
#endif
};
@@ -449,9 +449,9 @@ LaserParticleContainer::Evolve (int lev,
#endif
{
#ifdef _OPENMP
- int thread_num = omp_get_thread_num();
+ int const thread_num = omp_get_thread_num();
#else
- int thread_num = 0;
+ int const thread_num = 0;
#endif
Cuda::ManagedDeviceVector<Real> plane_Xp, plane_Yp, amplitude_E;
@@ -610,7 +610,7 @@ void
LaserParticleContainer::ComputeWeightMobility (Real Sx, Real Sy)
{
constexpr Real eps = 0.01;
- constexpr Real fac = 1.0/(2.0*MathConst::pi*PhysConst::mu0*PhysConst::c*PhysConst::c*eps);
+ constexpr Real fac = 1.0_rt / (2.0_rt * MathConst::pi * PhysConst::mu0 * PhysConst::c * PhysConst::c * eps);
weight = fac * wavelength * Sx * Sy / std::min(Sx,Sy) * e_max;
// The mobility is the constant of proportionality between the field to
diff --git a/Source/Laser/LaserProfiles.cpp b/Source/Laser/LaserProfiles.cpp
index 281ab2101..44411cedf 100644
--- a/Source/Laser/LaserProfiles.cpp
+++ b/Source/Laser/LaserProfiles.cpp
@@ -28,16 +28,16 @@ LaserParticleContainer::gaussian_laser_profile (
const Real oscillation_phase = k0 * PhysConst::c * ( t - profile_t_peak );
// The coefficients below contain info about Gouy phase,
// laser diffraction, and phase front curvature
- const Complex diffract_factor = Real(1.) + I * profile_focal_distance
- * Real(2.)/( k0 * profile_waist * profile_waist );
- const Complex inv_complex_waist_2 = Real(1.)/( profile_waist*profile_waist * diffract_factor );
+ const Complex diffract_factor = 1._rt + I * profile_focal_distance
+ * 2._rt/( k0 * profile_waist * profile_waist );
+ const Complex inv_complex_waist_2 = 1._rt / ( profile_waist*profile_waist * diffract_factor );
// Time stretching due to STCs and phi2 complex envelope
// (1 if zeta=0, beta=0, phi2=0)
- const Complex stretch_factor = Real(1.) + Real(4.) *
+ const Complex stretch_factor = 1._rt + 4._rt *
(zeta+beta*profile_focal_distance) * (zeta+beta*profile_focal_distance)
* (inv_tau2*inv_complex_waist_2) +
- Real(2.)*I*(phi2 - beta*beta*k0*profile_focal_distance) * inv_tau2;
+ 2._rt *I*(phi2 - beta*beta*k0*profile_focal_distance) * inv_tau2;
// Amplitude and monochromatic oscillations
Complex prefactor = e_max * MathFunc::exp( I * oscillation_phase );
@@ -61,10 +61,10 @@ LaserParticleContainer::gaussian_laser_profile (
amrex::ParallelFor(
np,
[=] AMREX_GPU_DEVICE (int i) {
- const Complex stc_exponent = Real(1.)/stretch_factor * inv_tau2 *
+ const Complex stc_exponent = 1._rt / stretch_factor * inv_tau2 *
MathFunc::pow((t - tmp_profile_t_peak -
tmp_beta*k0*(Xp[i]*std::cos(tmp_theta_stc) + Yp[i]*std::sin(tmp_theta_stc)) -
- Real(2.)*I*(Xp[i]*std::cos(tmp_theta_stc) + Yp[i]*std::sin(tmp_theta_stc))
+ 2._rt *I*(Xp[i]*std::cos(tmp_theta_stc) + Yp[i]*std::sin(tmp_theta_stc))
*( tmp_zeta - tmp_beta*tmp_profile_focal_distance ) * inv_complex_waist_2),2);
// stcfactor = everything but complex transverse envelope
const Complex stcfactor = prefactor * MathFunc::exp( - stc_exponent );
diff --git a/Source/Parallelization/InterpolateCurrentFineToCoarse.H b/Source/Parallelization/InterpolateCurrentFineToCoarse.H
index 148b725d0..cbbcdfab5 100644
--- a/Source/Parallelization/InterpolateCurrentFineToCoarse.H
+++ b/Source/Parallelization/InterpolateCurrentFineToCoarse.H
@@ -56,6 +56,8 @@ public:
int const k
) const noexcept
{
+ using namespace amrex;
+
auto const & fine_unsafe = m_fine; // out-of-bounds access not secured with zero-values yet
auto const & coarse = m_coarse; // out-of-bounds access not secured but will also not occur
@@ -71,29 +73,29 @@ public:
int const kk = k * m_refinement_ratio;
#if AMREX_SPACEDIM == 2
if (IDim == 0) {
- coarse(i, j, k) = 0.25 * (
+ coarse(i, j, k) = 0.25_rt * (
fine(ii, jj, kk) + fine(ii + 1, jj, kk) +
- 0.5 * (
+ 0.5_rt * (
fine(ii, jj - 1, kk) + fine(ii + 1, jj - 1, kk) +
fine(ii, jj + 1, kk) + fine(ii + 1, jj + 1, kk)
)
);
} else if (IDim == 2) {
- coarse(i, j, k) = 0.25 * (
+ coarse(i, j, k) = 0.25_rt * (
fine(ii, jj, kk) + fine(ii, jj + 1, kk) +
- 0.5 * (
+ 0.5_rt * (
fine(ii - 1, jj, kk) + fine(ii - 1, jj + 1, kk) +
fine(ii + 1, jj, kk) + fine(ii + 1, jj + 1, kk)
)
);
} else {
- coarse(i, j, k) = 0.25 * (
+ coarse(i, j, k) = 0.25_rt * (
fine(ii, jj, kk) +
- 0.5 * (
+ 0.5_rt * (
fine(ii - 1, jj , kk) + fine(ii + 1, jj , kk) +
fine(ii , jj - 1, kk) + fine(ii , jj + 1, kk)
) +
- 0.25 * (
+ 0.25_rt * (
fine(ii - 1, jj - 1, kk) + fine(ii + 1, jj - 1, kk) +
fine(ii - 1, jj + 1, kk) + fine(ii + 1, jj + 1, kk)
)
@@ -101,64 +103,64 @@ public:
}
#elif AMREX_SPACEDIM == 3
if (IDim == 0) {
- coarse(i,j,k) = 0.125 * (
+ coarse(i,j,k) = 0.125_rt * (
fine(ii , jj, kk) +
- 0.5 * (
+ 0.5_rt * (
fine(ii , jj-1, kk ) + fine(ii , jj+1, kk ) +
fine(ii , jj , kk-1) + fine(ii , jj , kk+1)
) +
- 0.25 * (
+ 0.25_rt * (
fine(ii , jj-1, kk-1) + fine(ii , jj+1, kk-1) +
fine(ii , jj-1, kk+1) + fine(ii , jj+1, kk+1)
) +
fine(ii+1, jj, kk) +
- 0.5 * (
+ 0.5_rt * (
fine(ii+1, jj-1, kk ) + fine(ii+1, jj+1, kk ) +
fine(ii+1, jj , kk-1) + fine(ii+1, jj , kk+1)
) +
- 0.25 * (
+ 0.25_rt * (
fine(ii+1, jj-1, kk-1) + fine(ii+1, jj+1, kk-1) +
fine(ii+1, jj-1, kk+1) + fine(ii+1, jj+1, kk+1)
)
);
} else if (IDim == 1) {
- coarse(i, j, k) = 0.125 * (
+ coarse(i, j, k) = 0.125_rt * (
fine(ii, jj , kk) +
- 0.5 * (
+ 0.5_rt * (
fine(ii-1, jj , kk ) + fine(ii+1, jj , kk ) +
fine(ii , jj , kk-1) + fine(ii , jj , kk+1)
- ) +
- 0.25 * (
+ ) +
+ 0.25_rt * (
fine(ii-1, jj , kk-1) + fine(ii+1, jj , kk-1) +
fine(ii-1, jj , kk+1) + fine(ii+1, jj , kk+1)
- ) +
- fine(ii, jj+1, kk) +
- 0.5 * (
+ ) +
+ fine(ii, jj+1, kk) +
+ 0.5_rt * (
fine(ii-1, jj+1, kk ) + fine(ii+1, jj+1, kk ) +
fine(ii , jj+1, kk-1) + fine(ii , jj+1, kk+1)
- ) +
- 0.25 * (
+ ) +
+ 0.25_rt * (
fine(ii-1, jj+1, kk-1) + fine(ii+1, jj+1, kk-1) +
fine(ii-1, jj+1, kk+1) + fine(ii+1, jj+1, kk+1)
- )
+ )
);
} else {
- coarse(i, j, k) = 0.125 * (
+ coarse(i, j, k) = 0.125_rt * (
fine(ii, jj, kk ) +
- 0.5 * (
+ 0.5_rt * (
fine(ii-1, jj , kk ) + fine(ii+1, jj , kk ) +
fine(ii , jj-1, kk ) + fine(ii , jj+1, kk )
) +
- 0.25 * (
+ 0.25_rt * (
fine(ii-1, jj-1, kk ) + fine(ii+1, jj-1, kk ) +
fine(ii-1, jj+1, kk ) + fine(ii+1, jj+1, kk )
) +
fine(ii, jj, kk+1) +
- 0.5 * (
+ 0.5_rt * (
fine(ii-1, jj , kk+1) + fine(ii+1, jj , kk+1) +
fine(ii , jj-1, kk+1) + fine(ii , jj+1, kk+1)
) +
- 0.25 * (
+ 0.25_rt * (
fine(ii-1, jj-1, kk+1) + fine(ii+1, jj-1, kk+1) +
fine(ii-1, jj+1, kk+1) + fine(ii+1, jj+1, kk+1)
)
diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp
index 92f0b4f09..52df3dc25 100644
--- a/Source/Parallelization/WarpXComm.cpp
+++ b/Source/Parallelization/WarpXComm.cpp
@@ -54,6 +54,157 @@ WarpX::UpdateAuxilaryData ()
{
BL_PROFILE("UpdateAuxilaryData()");
+ if (Bfield_aux[0][0]->ixType() == Bfield_fp[0][0]->ixType()) {
+ UpdateAuxilaryDataSameType();
+ } else {
+ UpdateAuxilaryDataStagToNodal();
+ }
+}
+
+void
+WarpX::UpdateAuxilaryDataStagToNodal ()
+{
+ // For level 0, we only need to do the average.
+#ifdef _OPENMP
+#pragma omp parallel if (Gpu::notInLaunchRegion())
+#endif
+ for (MFIter mfi(*Bfield_aux[0][0]); mfi.isValid(); ++mfi)
+ {
+ Array4<Real> const& bx_aux = Bfield_aux[0][0]->array(mfi);
+ Array4<Real> const& by_aux = Bfield_aux[0][1]->array(mfi);
+ Array4<Real> const& bz_aux = Bfield_aux[0][2]->array(mfi);
+ Array4<Real const> const& bx_fp = Bfield_fp[0][0]->const_array(mfi);
+ Array4<Real const> const& by_fp = Bfield_fp[0][1]->const_array(mfi);
+ Array4<Real const> const& bz_fp = Bfield_fp[0][2]->const_array(mfi);
+
+ Array4<Real> const& ex_aux = Efield_aux[0][0]->array(mfi);
+ Array4<Real> const& ey_aux = Efield_aux[0][1]->array(mfi);
+ Array4<Real> const& ez_aux = Efield_aux[0][2]->array(mfi);
+ Array4<Real const> const& ex_fp = Efield_fp[0][0]->const_array(mfi);
+ Array4<Real const> const& ey_fp = Efield_fp[0][1]->const_array(mfi);
+ Array4<Real const> const& ez_fp = Efield_fp[0][2]->const_array(mfi);
+
+ const Box& bx = mfi.fabbox();
+ amrex::ParallelFor(bx,
+ [=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept
+ {
+ warpx_interp_nd_bfield_x(j,k,l, bx_aux, bx_fp);
+ warpx_interp_nd_bfield_y(j,k,l, by_aux, by_fp);
+ warpx_interp_nd_bfield_z(j,k,l, bz_aux, bz_fp);
+ warpx_interp_nd_efield_x(j,k,l, ex_aux, ex_fp);
+ warpx_interp_nd_efield_y(j,k,l, ey_aux, ey_fp);
+ warpx_interp_nd_efield_z(j,k,l, ez_aux, ez_fp);
+ });
+ }
+
+ for (int lev = 1; lev <= finest_level; ++lev)
+ {
+ BoxArray const& nba = Bfield_aux[lev][0]->boxArray();
+ BoxArray const& cnba = amrex::coarsen(nba,2);
+ DistributionMapping const& dm = Bfield_aux[lev][0]->DistributionMap();
+ auto const& cperiod = Geom(lev-1).periodicity();
+
+ // Bfield
+ {
+ Array<std::unique_ptr<MultiFab>,3> Btmp;
+ if (Bfield_cax[lev][0]) {
+ for (int i = 0; i < 3; ++i) {
+ Btmp[i].reset(new MultiFab(*Bfield_cax[lev][i], amrex::make_alias, 0, 1));
+ }
+ } else {
+ IntVect ngtmp = Bfield_aux[lev-1][0]->nGrowVect();
+ for (int i = 0; i < 3; ++i) {
+ Btmp[i].reset(new MultiFab(cnba, dm, 1, ngtmp));
+ }
+ }
+ // ParallelCopy from coarse level
+ for (int i = 0; i < 3; ++i) {
+ IntVect ng = Btmp[i]->nGrowVect();
+ Btmp[i]->ParallelCopy(*Bfield_aux[lev-1][i], 0, 0, 1, ng, ng, cperiod);
+ }
+
+#ifdef _OPENMP
+#pragma omp parallel if (Gpu::notInLaunchRegion())
+#endif
+ for (MFIter mfi(*Bfield_aux[lev][0]); mfi.isValid(); ++mfi)
+ {
+ Array4<Real> const& bx_aux = Bfield_aux[lev][0]->array(mfi);
+ Array4<Real> const& by_aux = Bfield_aux[lev][1]->array(mfi);
+ Array4<Real> const& bz_aux = Bfield_aux[lev][2]->array(mfi);
+ Array4<Real const> const& bx_fp = Bfield_fp[lev][0]->const_array(mfi);
+ Array4<Real const> const& by_fp = Bfield_fp[lev][1]->const_array(mfi);
+ Array4<Real const> const& bz_fp = Bfield_fp[lev][2]->const_array(mfi);
+ Array4<Real const> const& bx_cp = Bfield_cp[lev][0]->const_array(mfi);
+ Array4<Real const> const& by_cp = Bfield_cp[lev][1]->const_array(mfi);
+ Array4<Real const> const& bz_cp = Bfield_cp[lev][2]->const_array(mfi);
+ Array4<Real const> const& bx_c = Btmp[0]->const_array(mfi);
+ Array4<Real const> const& by_c = Btmp[1]->const_array(mfi);
+ Array4<Real const> const& bz_c = Btmp[2]->const_array(mfi);
+
+ const Box& bx = mfi.fabbox();
+ amrex::ParallelFor(bx,
+ [=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept
+ {
+ warpx_interp_nd_bfield_x(j,k,l, bx_aux, bx_fp, bx_cp, bx_c);
+ warpx_interp_nd_bfield_y(j,k,l, by_aux, by_fp, by_cp, by_c);
+ warpx_interp_nd_bfield_z(j,k,l, bz_aux, bz_fp, bz_cp, bz_c);
+ });
+ }
+ }
+
+ // Efield
+ {
+ Array<std::unique_ptr<MultiFab>,3> Etmp;
+ if (Efield_cax[lev][0]) {
+ for (int i = 0; i < 3; ++i) {
+ Etmp[i].reset(new MultiFab(*Efield_cax[lev][i], amrex::make_alias, 0, 1));
+ }
+ } else {
+ IntVect ngtmp = Efield_aux[lev-1][0]->nGrowVect();
+ for (int i = 0; i < 3; ++i) {
+ Etmp[i].reset(new MultiFab(cnba, dm, 1, ngtmp));
+ }
+ }
+ // ParallelCopy from coarse level
+ for (int i = 0; i < 3; ++i) {
+ IntVect ng = Etmp[i]->nGrowVect();
+ Etmp[i]->ParallelCopy(*Efield_aux[lev-1][i], 0, 0, 1, ng, ng, cperiod);
+ }
+
+#ifdef _OPENMP
+#pragma omp parallel if (Gpu::notInLaunchRegion())
+#endif
+ for (MFIter mfi(*Efield_aux[lev][0]); mfi.isValid(); ++mfi)
+ {
+ Array4<Real> const& ex_aux = Efield_aux[lev][0]->array(mfi);
+ Array4<Real> const& ey_aux = Efield_aux[lev][1]->array(mfi);
+ Array4<Real> const& ez_aux = Efield_aux[lev][2]->array(mfi);
+ Array4<Real const> const& ex_fp = Efield_fp[lev][0]->const_array(mfi);
+ Array4<Real const> const& ey_fp = Efield_fp[lev][1]->const_array(mfi);
+ Array4<Real const> const& ez_fp = Efield_fp[lev][2]->const_array(mfi);
+ Array4<Real const> const& ex_cp = Efield_cp[lev][0]->const_array(mfi);
+ Array4<Real const> const& ey_cp = Efield_cp[lev][1]->const_array(mfi);
+ Array4<Real const> const& ez_cp = Efield_cp[lev][2]->const_array(mfi);
+ Array4<Real const> const& ex_c = Etmp[0]->const_array(mfi);
+ Array4<Real const> const& ey_c = Etmp[1]->const_array(mfi);
+ Array4<Real const> const& ez_c = Etmp[2]->const_array(mfi);
+
+ const Box& bx = mfi.fabbox();
+ amrex::ParallelFor(bx,
+ [=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept
+ {
+ warpx_interp_nd_efield_x(j,k,l, ex_aux, ex_fp, ex_cp, ex_c);
+ warpx_interp_nd_efield_y(j,k,l, ey_aux, ey_fp, ey_cp, ey_c);
+ warpx_interp_nd_efield_z(j,k,l, ez_aux, ez_fp, ez_cp, ez_c);
+ });
+ }
+ }
+ }
+}
+
+void
+WarpX::UpdateAuxilaryDataSameType ()
+{
for (int lev = 1; lev <= finest_level; ++lev)
{
const auto& crse_period = Geom(lev-1).periodicity();
diff --git a/Source/Parallelization/WarpXComm_K.H b/Source/Parallelization/WarpXComm_K.H
index 093323ec3..169cd0ee1 100644
--- a/Source/Parallelization/WarpXComm_K.H
+++ b/Source/Parallelization/WarpXComm_K.H
@@ -5,38 +5,38 @@
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void warpx_interp_bfield_x (int j, int k, int l,
- amrex::Array4<amrex::Real> const& Bxa,
+ amrex::Array4<amrex::Real > const& Bxa,
amrex::Array4<amrex::Real const> const& Bxf,
amrex::Array4<amrex::Real const> const& Bxc)
{
using namespace amrex;
- int lg = amrex::coarsen(l,2);
- int kg = amrex::coarsen(k,2);
- int jg = amrex::coarsen(j,2);
+ int const lg = amrex::coarsen(l,2);
+ int const kg = amrex::coarsen(k,2);
+ int const jg = amrex::coarsen(j,2);
- Real wx = (j == jg*2) ? 0.0 : 0.5;
- Real owx = 1.0-wx;
+ Real const wx = (j == jg*2) ? 0.0_rt : 0.5_rt;
+ Real const owx = 1.0_rt - wx;
Bxa(j,k,l) = owx * Bxc(jg,kg,lg) + wx * Bxc(jg+1,kg,lg) + Bxf(j,k,l);
}
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void warpx_interp_bfield_y (int j, int k, int l,
- amrex::Array4<amrex::Real> const& Bya,
+ amrex::Array4<amrex::Real > const& Bya,
amrex::Array4<amrex::Real const> const& Byf,
amrex::Array4<amrex::Real const> const& Byc)
{
using namespace amrex;
- int lg = amrex::coarsen(l,2);
- int kg = amrex::coarsen(k,2);
- int jg = amrex::coarsen(j,2);
+ int const lg = amrex::coarsen(l,2);
+ int const kg = amrex::coarsen(k,2);
+ int const jg = amrex::coarsen(j,2);
// Note that for 2d, l=0, because the amrex convention is used here.
#if (AMREX_SPACEDIM == 3)
- Real wy = (k == kg*2) ? 0.0 : 0.5;
- Real owy = 1.0-wy;
+ Real const wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
+ Real const owy = 1.0_rt - wy;
Bya(j,k,l) = owy * Byc(jg,kg,lg) + wy * Byc(jg,kg+1,lg) + Byf(j,k,l);
#else
Bya(j,k,l) = Byc(jg,kg,lg) + Byf(j,k,l);
@@ -45,47 +45,47 @@ void warpx_interp_bfield_y (int j, int k, int l,
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void warpx_interp_bfield_z (int j, int k, int l,
- amrex::Array4<amrex::Real> const& Bza,
+ amrex::Array4<amrex::Real > const& Bza,
amrex::Array4<amrex::Real const> const& Bzf,
amrex::Array4<amrex::Real const> const& Bzc)
{
using namespace amrex;
- int lg = amrex::coarsen(l,2);
- int kg = amrex::coarsen(k,2);
- int jg = amrex::coarsen(j,2);
+ int const lg = amrex::coarsen(l,2);
+ int const kg = amrex::coarsen(k,2);
+ int const jg = amrex::coarsen(j,2);
// Note that for 2d, l=0, because the amrex convention is used here.
#if (AMREX_SPACEDIM == 3)
- Real wz = (l == lg*2) ? 0.0 : 0.5;
- Real owz = 1.0-wz;
+ Real const wz = (l == lg*2) ? 0.0_rt : 0.5_rt;
+ Real const owz = 1.0_rt - wz;
Bza(j,k,l) = owz * Bzc(jg,kg,lg) + owz * Bzc(jg,kg,lg+1) + Bzf(j,k,l);
#else
- Real wy = (k == kg*2) ? 0.0 : 0.5;
- Real owy = 1.0-wy;
+ Real const wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
+ Real const owy = 1.0_rt - wy;
Bza(j,k,l) = owy * Bzc(jg,kg,lg) + owy * Bzc(jg,kg+1,lg) + Bzf(j,k,l);
#endif
}
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void warpx_interp_efield_x (int j, int k, int l,
- amrex::Array4<amrex::Real> const& Exa,
+ amrex::Array4<amrex::Real > const& Exa,
amrex::Array4<amrex::Real const> const& Exf,
amrex::Array4<amrex::Real const> const& Exc)
{
using namespace amrex;
- int lg = amrex::coarsen(l,2);
- int kg = amrex::coarsen(k,2);
- int jg = amrex::coarsen(j,2);
+ int const lg = amrex::coarsen(l,2);
+ int const kg = amrex::coarsen(k,2);
+ int const jg = amrex::coarsen(j,2);
- Real wy = (k == kg*2) ? 0.0 : 0.5;
- Real owy = 1.0-wy;
+ Real const wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
+ Real const owy = 1.0_rt - wy;
#if (AMREX_SPACEDIM == 3)
- Real wz = (l == lg*2) ? 0.0 : 0.5;
- Real owz = 1.0-wz;
+ Real const wz = (l == lg*2) ? 0.0_rt : 0.5_rt;
+ Real const owz = 1.0_rt - wz;
Exa(j,k,l) = owy * owz * Exc(jg ,kg ,lg )
+ wy * owz * Exc(jg ,kg+1,lg )
+ owy * wz * Exc(jg ,kg ,lg+1)
@@ -98,30 +98,30 @@ void warpx_interp_efield_x (int j, int k, int l,
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void warpx_interp_efield_y (int j, int k, int l,
- amrex::Array4<amrex::Real> const& Eya,
+ amrex::Array4<amrex::Real > const& Eya,
amrex::Array4<amrex::Real const> const& Eyf,
amrex::Array4<amrex::Real const> const& Eyc)
{
using namespace amrex;
- int lg = amrex::coarsen(l,2);
- int kg = amrex::coarsen(k,2);
- int jg = amrex::coarsen(j,2);
+ int const lg = amrex::coarsen(l,2);
+ int const kg = amrex::coarsen(k,2);
+ int const jg = amrex::coarsen(j,2);
- Real wx = (j == jg*2) ? 0.0 : 0.5;
- Real owx = 1.0-wx;
+ Real const wx = (j == jg*2) ? 0.0_rt : 0.5_rt;
+ Real const owx = 1.0_rt - wx;
#if (AMREX_SPACEDIM == 3)
- Real wz = (l == lg*2) ? 0.0 : 0.5;
- Real owz = 1.0-wz;
+ Real const wz = (l == lg*2) ? 0.0_rt : 0.5_rt;
+ Real const owz = 1.0_rt - wz;
Eya(j,k,l) = owx * owz * Eyc(jg ,kg ,lg )
+ wx * owz * Eyc(jg+1,kg ,lg )
+ owx * wz * Eyc(jg ,kg ,lg+1)
+ wx * wz * Eyc(jg+1,kg ,lg+1)
+ Eyf(j,k,l);
#else
- Real wy = (k == kg*2) ? 0.0 : 0.5;
- Real owy = 1.0-wy;
+ Real const wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
+ Real const owy = 1.0_rt - wy;
Eya(j,k,l) = owx * owy * Eyc(jg ,kg ,lg)
+ wx * owy * Eyc(jg+1,kg ,lg)
+ owx * wy * Eyc(jg ,kg+1,lg)
@@ -132,22 +132,22 @@ void warpx_interp_efield_y (int j, int k, int l,
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void warpx_interp_efield_z (int j, int k, int l,
- amrex::Array4<amrex::Real> const& Eza,
+ amrex::Array4<amrex::Real > const& Eza,
amrex::Array4<amrex::Real const> const& Ezf,
amrex::Array4<amrex::Real const> const& Ezc)
{
using namespace amrex;
- int lg = amrex::coarsen(l,2);
- int kg = amrex::coarsen(k,2);
- int jg = amrex::coarsen(j,2);
+ int const lg = amrex::coarsen(l,2);
+ int const kg = amrex::coarsen(k,2);
+ int const jg = amrex::coarsen(j,2);
- Real wx = (j == jg*2) ? 0.0 : 0.5;
- Real owx = 1.0-wx;
+ Real const wx = (j == jg*2) ? 0.0_rt : 0.5_rt;
+ Real const owx = 1.0_rt - wx;
#if (AMREX_SPACEDIM == 3)
- Real wy = (k == kg*2) ? 0.0 : 0.5;
- Real owy = 1.0-wy;
+ Real wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
+ Real owy = 1.0_rt - wy;
Eza(j,k,l) = owx * owy * Ezc(jg ,kg ,lg )
+ wx * owy * Ezc(jg+1,kg ,lg )
+ owx * wy * Ezc(jg ,kg+1,lg )
@@ -158,4 +158,489 @@ void warpx_interp_efield_z (int j, int k, int l,
#endif
}
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_bfield_x (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Bxa,
+ amrex::Array4<amrex::Real const> const& Bxf,
+ amrex::Array4<amrex::Real const> const& Bxc,
+ amrex::Array4<amrex::Real const> const& Bxg)
+{
+ using namespace amrex;
+
+ int jg = amrex::coarsen(j,2);
+ Real wx = (j == jg*2) ? 0.0 : 0.5;
+ Real owx = 1.0-wx;
+
+ int kg = amrex::coarsen(k,2);
+ Real wy = (k == kg*2) ? 0.0 : 0.5;
+ Real owy = 1.0-wy;
+
+#if (AMREX_SPACEDIM == 2)
+
+ // interp from coarse nodal to fine nodal
+ Real bg = owx * owy * Bxg(jg ,kg ,0)
+ + owx * wy * Bxg(jg ,kg+1,0)
+ + wx * owy * Bxg(jg+1,kg ,0)
+ + wx * wy * Bxg(jg+1,kg+1,0);
+
+ // interp from coarse staggered to fine nodal
+ wy = 0.5-wy; owy = 1.0-wy;
+ Real bc = owx * owy * Bxc(jg ,kg ,0)
+ + owx * wy * Bxc(jg ,kg-1,0)
+ + wx * owy * Bxc(jg+1,kg ,0)
+ + wx * wy * Bxc(jg+1,kg-1,0);
+
+ // interp from fine staggered to fine nodal
+ Real bf = 0.5*(Bxf(j,k-1,0) + Bxf(j,k,0));
+
+#else
+
+ int lg = amrex::coarsen(l,2);
+ Real wz = (l == lg*2) ? 0.0 : 0.5;
+ Real owz = 1.0-wz;
+
+ // interp from coarse nodal to fine nodal
+ Real bg = owx * owy * owz * Bxg(jg ,kg ,lg )
+ + wx * owy * owz * Bxg(jg+1,kg ,lg )
+ + owx * wy * owz * Bxg(jg ,kg+1,lg )
+ + wx * wy * owz * Bxg(jg+1,kg+1,lg )
+ + owx * owy * wz * Bxg(jg ,kg ,lg+1)
+ + wx * owy * wz * Bxg(jg+1,kg ,lg+1)
+ + owx * wy * wz * Bxg(jg ,kg+1,lg+1)
+ + wx * wy * wz * Bxg(jg+1,kg+1,lg+1);
+
+ // interp from coarse staggered to fine nodal
+ wy = 0.5-wy; owy = 1.0-wy;
+ wz = 0.5-wz; owz = 1.0-wz;
+ Real bc = owx * owy * owz * Bxc(jg ,kg ,lg )
+ + wx * owy * owz * Bxc(jg+1,kg ,lg )
+ + owx * wy * owz * Bxc(jg ,kg-1,lg )
+ + wx * wy * owz * Bxc(jg+1,kg-1,lg )
+ + owx * owy * wz * Bxc(jg ,kg ,lg-1)
+ + wx * owy * wz * Bxc(jg+1,kg ,lg-1)
+ + owx * wy * wz * Bxc(jg ,kg-1,lg-1)
+ + wx * wy * wz * Bxc(jg+1,kg-1,lg-1);
+
+ // interp from fine stagged to fine nodal
+ Real bf = 0.25*(Bxf(j,k-1,l-1) + Bxf(j,k,l-1) + Bxf(j,k-1,l) + Bxf(j,k,l));
+#endif
+
+ Bxa(j,k,l) = bg + (bf-bc);
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_bfield_y (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Bya,
+ amrex::Array4<amrex::Real const> const& Byf,
+ amrex::Array4<amrex::Real const> const& Byc,
+ amrex::Array4<amrex::Real const> const& Byg)
+{
+ using namespace amrex;
+
+ int jg = amrex::coarsen(j,2);
+ Real wx = (j == jg*2) ? 0.0 : 0.5;
+ Real owx = 1.0-wx;
+
+ int kg = amrex::coarsen(k,2);
+ Real wy = (k == kg*2) ? 0.0 : 0.5;
+ Real owy = 1.0-wy;
+
+#if (AMREX_SPACEDIM == 2)
+
+ // interp from coarse nodal to fine nodal
+ Real bg = owx * owy * Byg(jg ,kg ,0)
+ + owx * wy * Byg(jg ,kg+1,0)
+ + wx * owy * Byg(jg+1,kg ,0)
+ + wx * wy * Byg(jg+1,kg+1,0);
+
+ // interp from coarse stagged (cell-centered for By) to fine nodal
+ wx = 0.5-wx; owx = 1.0-wx;
+ wy = 0.5-wy; owy = 1.0-wy;
+ Real bc = owx * owy * Byc(jg ,kg ,0)
+ + owx * wy * Byc(jg ,kg-1,0)
+ + wx * owy * Byc(jg-1,kg ,0)
+ + wx * wy * Byc(jg-1,kg-1,0);
+
+ // interp form fine stagger (cell-centered for By) to fine nodal
+ Real bf = 0.25*(Byf(j,k,0) + Byf(j-1,k,0) + Byf(j,k-1,0) + Byf(j-1,k-1,0));
+
+#else
+
+ int lg = amrex::coarsen(l,2);
+ Real wz = (l == lg*2) ? 0.0 : 0.5;
+ Real owz = 1.0-wz;
+
+ // interp from coarse nodal to fine nodal
+ Real bg = owx * owy * owz * Byg(jg ,kg ,lg )
+ + wx * owy * owz * Byg(jg+1,kg ,lg )
+ + owx * wy * owz * Byg(jg ,kg+1,lg )
+ + wx * wy * owz * Byg(jg+1,kg+1,lg )
+ + owx * owy * wz * Byg(jg ,kg ,lg+1)
+ + wx * owy * wz * Byg(jg+1,kg ,lg+1)
+ + owx * wy * wz * Byg(jg ,kg+1,lg+1)
+ + wx * wy * wz * Byg(jg+1,kg+1,lg+1);
+
+ // interp from coarse staggered to fine nodal
+ wx = 0.5-wx; owx = 1.0-wx;
+ wz = 0.5-wz; owz = 1.0-wz;
+ Real bc = owx * owy * owz * Byc(jg ,kg ,lg )
+ + wx * owy * owz * Byc(jg-1,kg ,lg )
+ + owx * wy * owz * Byc(jg ,kg+1,lg )
+ + wx * wy * owz * Byc(jg-1,kg+1,lg )
+ + owx * owy * wz * Byc(jg ,kg ,lg-1)
+ + wx * owy * wz * Byc(jg-1,kg ,lg-1)
+ + owx * wy * wz * Byc(jg ,kg+1,lg-1)
+ + wx * wy * wz * Byc(jg-1,kg+1,lg-1);
+
+ // interp from fine stagged to fine nodal
+ Real bf = 0.25*(Byf(j-1,k,l-1) + Byf(j,k,l-1) + Byf(j-1,k,l) + Byf(j,k,l));
+
+#endif
+
+ Bya(j,k,l) = bg + (bf-bc);
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_bfield_z (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Bza,
+ amrex::Array4<amrex::Real const> const& Bzf,
+ amrex::Array4<amrex::Real const> const& Bzc,
+ amrex::Array4<amrex::Real const> const& Bzg)
+{
+ using namespace amrex;
+
+ int jg = amrex::coarsen(j,2);
+ Real wx = (j == jg*2) ? 0.0 : 0.5;
+ Real owx = 1.0-wx;
+
+ int kg = amrex::coarsen(k,2);
+ Real wy = (k == kg*2) ? 0.0 : 0.5;
+ Real owy = 1.0-wy;
+
+#if (AMREX_SPACEDIM == 2)
+
+ // interp from coarse nodal to fine nodal
+ Real bg = owx * owy * Bzg(jg ,kg ,0)
+ + owx * wy * Bzg(jg ,kg+1,0)
+ + wx * owy * Bzg(jg+1,kg ,0)
+ + wx * wy * Bzg(jg+1,kg+1,0);
+
+ // interp from coarse staggered to fine nodal
+ wx = 0.5-wx; owx = 1.0-wx;
+ Real bc = owx * owy * Bzc(jg ,kg ,0)
+ + owx * wy * Bzc(jg ,kg+1,0)
+ + wx * owy * Bzc(jg-1,kg ,0)
+ + wx * wy * Bzc(jg-1,kg+1,0);
+
+ // interp from fine staggered to fine nodal
+ Real bf = 0.5*(Bzf(j-1,k,0) + Bzf(j,k,0));
+
+#else
+
+ int lg = amrex::coarsen(l,2);
+ Real wz = (l == lg*2) ? 0.0 : 0.5;
+ Real owz = 1.0-wz;
+
+ // interp from coarse nodal to fine nodal
+ Real bg = owx * owy * owz * Bzg(jg ,kg ,lg )
+ + wx * owy * owz * Bzg(jg+1,kg ,lg )
+ + owx * wy * owz * Bzg(jg ,kg+1,lg )
+ + wx * wy * owz * Bzg(jg+1,kg+1,lg )
+ + owx * owy * wz * Bzg(jg ,kg ,lg+1)
+ + wx * owy * wz * Bzg(jg+1,kg ,lg+1)
+ + owx * wy * wz * Bzg(jg ,kg+1,lg+1)
+ + wx * wy * wz * Bzg(jg+1,kg+1,lg+1);
+
+ // interp from coarse staggered to fine nodal
+ wx = 0.5-wx; owx = 1.0-wx;
+ wy = 0.5-wy; owy = 1.0-wy;
+ Real bc = owx * owy * owz * Bzc(jg ,kg ,lg )
+ + wx * owy * owz * Bzc(jg-1,kg ,lg )
+ + owx * wy * owz * Bzc(jg ,kg-1,lg )
+ + wx * wy * owz * Bzc(jg-1,kg-1,lg )
+ + owx * owy * wz * Bzc(jg ,kg ,lg+1)
+ + wx * owy * wz * Bzc(jg-1,kg ,lg+1)
+ + owx * wy * wz * Bzc(jg ,kg-1,lg+1)
+ + wx * wy * wz * Bzc(jg-1,kg-1,lg+1);
+
+ // interp from fine stagged to fine nodal
+ Real bf = 0.25*(Bzf(j-1,k-1,l) + Bzf(j,k-1,l) + Bzf(j-1,k,l) + Bzf(j,k,l));
+
+#endif
+
+ Bza(j,k,l) = bg + (bf-bc);
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_bfield_x (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Bxa,
+ amrex::Array4<amrex::Real const> const& Bxf)
+{
+#if (AMREX_SPACEDIM == 2)
+ Bxa(j,k,0) = 0.5*(Bxf(j,k-1,0) + Bxf(j,k,0));
+#else
+ Bxa(j,k,l) = 0.25*(Bxf(j,k-1,l-1) + Bxf(j,k,l-1) + Bxf(j,k-1,l) + Bxf(j,k,l));
+#endif
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_bfield_y (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Bya,
+ amrex::Array4<amrex::Real const> const& Byf)
+{
+#if (AMREX_SPACEDIM == 2)
+ Bya(j,k,0) = 0.25*(Byf(j,k,0) + Byf(j-1,k,0) + Byf(j,k-1,0) + Byf(j-1,k-1,0));
+#else
+ Bya(j,k,l) = 0.25*(Byf(j-1,k,l-1) + Byf(j,k,l-1) + Byf(j-1,k,l) + Byf(j,k,l));
+#endif
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_bfield_z (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Bza,
+ amrex::Array4<amrex::Real const> const& Bzf)
+{
+#if (AMREX_SPACEDIM == 2)
+ Bza(j,k,0) = 0.5*(Bzf(j-1,k,0) + Bzf(j,k,0));
+#else
+ Bza(j,k,l) = 0.25*(Bzf(j-1,k-1,l) + Bzf(j,k-1,l) + Bzf(j-1,k,l) + Bzf(j,k,l));
+#endif
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_efield_x (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Exa,
+ amrex::Array4<amrex::Real const> const& Exf,
+ amrex::Array4<amrex::Real const> const& Exc,
+ amrex::Array4<amrex::Real const> const& Exg)
+{
+ using namespace amrex;
+
+ int jg = amrex::coarsen(j,2);
+ Real wx = (j == jg*2) ? 0.0 : 0.5;
+ Real owx = 1.0-wx;
+
+ int kg = amrex::coarsen(k,2);
+ Real wy = (k == kg*2) ? 0.0 : 0.5;
+ Real owy = 1.0-wy;
+
+#if (AMREX_SPACEDIM == 2)
+
+ // interp from coarse nodal to fine nodal
+ Real eg = owx * owy * Exg(jg ,kg ,0)
+ + owx * wy * Exg(jg ,kg+1,0)
+ + wx * owy * Exg(jg+1,kg ,0)
+ + wx * wy * Exg(jg+1,kg+1,0);
+
+ // interp from coarse staggered to fine nodal
+ wx = 0.5-wx; owx = 1.0-wx;
+ Real ec = owx * owy * Exc(jg ,kg ,0)
+ + owx * wy * Exc(jg ,kg+1,0)
+ + wx * owy * Exc(jg-1,kg ,0)
+ + wx * wy * Exc(jg-1,kg+1,0);
+
+ // interp from fine staggered to fine nodal
+ Real ef = 0.5*(Exf(j-1,k,0) + Exf(j,k,0));
+
+#else
+
+ int lg = amrex::coarsen(l,2);
+ Real wz = (l == lg*2) ? 0.0 : 0.5;
+ Real owz = 1.0-wz;
+
+ // interp from coarse nodal to fine nodal
+ Real eg = owx * owy * owz * Exg(jg ,kg ,lg )
+ + wx * owy * owz * Exg(jg+1,kg ,lg )
+ + owx * wy * owz * Exg(jg ,kg+1,lg )
+ + wx * wy * owz * Exg(jg+1,kg+1,lg )
+ + owx * owy * wz * Exg(jg ,kg ,lg+1)
+ + wx * owy * wz * Exg(jg+1,kg ,lg+1)
+ + owx * wy * wz * Exg(jg ,kg+1,lg+1)
+ + wx * wy * wz * Exg(jg+1,kg+1,lg+1);
+
+ // interp from coarse staggered to fine nodal
+ wx = 0.5-wx; owx = 1.0-wx;
+ Real ec = owx * owy * owz * Exc(jg ,kg ,lg )
+ + wx * owy * owz * Exc(jg-1,kg ,lg )
+ + owx * wy * owz * Exc(jg ,kg+1,lg )
+ + wx * wy * owz * Exc(jg-1,kg+1,lg )
+ + owx * owy * wz * Exc(jg ,kg ,lg+1)
+ + wx * owy * wz * Exc(jg-1,kg ,lg+1)
+ + owx * wy * wz * Exc(jg ,kg+1,lg+1)
+ + wx * wy * wz * Exc(jg-1,kg+1,lg+1);
+
+ // interp from fine staggered to fine nodal
+ Real ef = 0.5*(Exf(j-1,k,l) + Exf(j,k,l));
+
+#endif
+
+ Exa(j,k,l) = eg + (ef-ec);
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_efield_y (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Eya,
+ amrex::Array4<amrex::Real const> const& Eyf,
+ amrex::Array4<amrex::Real const> const& Eyc,
+ amrex::Array4<amrex::Real const> const& Eyg)
+{
+ using namespace amrex;
+
+ int jg = amrex::coarsen(j,2);
+ Real wx = (j == jg*2) ? 0.0 : 0.5;
+ Real owx = 1.0-wx;
+
+ int kg = amrex::coarsen(k,2);
+ Real wy = (k == kg*2) ? 0.0 : 0.5;
+ Real owy = 1.0-wy;
+
+#if (AMREX_SPACEDIM == 2)
+
+ // interp from coarse nodal and coarse staggered to fine nodal
+ Real eg = owx * owy * (Eyg(jg ,kg ,0) + Eyc(jg ,kg ,0))
+ + owx * wy * (Eyg(jg ,kg+1,0) + Eyc(jg ,kg+1,0))
+ + wx * owy * (Eyg(jg+1,kg ,0) + Eyc(jg+1,kg ,0))
+ + wx * wy * (Eyg(jg+1,kg+1,0) + Eyc(jg+1,kg+1,0));
+ Real ec = 0.0;
+
+ // interp from fine staggered to fine nodal
+ Real ef = Eyf(j,k,0);
+
+#else
+
+ int lg = amrex::coarsen(l,2);
+ Real wz = (l == lg*2) ? 0.0 : 0.5;
+ Real owz = 1.0-wz;
+
+ // interp from coarse nodal to fine nodal
+ Real eg = owx * owy * owz * Eyg(jg ,kg ,lg )
+ + wx * owy * owz * Eyg(jg+1,kg ,lg )
+ + owx * wy * owz * Eyg(jg ,kg+1,lg )
+ + wx * wy * owz * Eyg(jg+1,kg+1,lg )
+ + owx * owy * wz * Eyg(jg ,kg ,lg+1)
+ + wx * owy * wz * Eyg(jg+1,kg ,lg+1)
+ + owx * wy * wz * Eyg(jg ,kg+1,lg+1)
+ + wx * wy * wz * Eyg(jg+1,kg+1,lg+1);
+
+ // interp from coarse staggered to fine nodal
+ wy = 0.5-wy; owy = 1.0-wy;
+ Real ec = owx * owy * owz * Eyc(jg ,kg ,lg )
+ + wx * owy * owz * Eyc(jg+1,kg ,lg )
+ + owx * wy * owz * Eyc(jg ,kg-1,lg )
+ + wx * wy * owz * Eyc(jg+1,kg-1,lg )
+ + owx * owy * wz * Eyc(jg ,kg ,lg+1)
+ + wx * owy * wz * Eyc(jg+1,kg ,lg+1)
+ + owx * wy * wz * Eyc(jg ,kg-1,lg+1)
+ + wx * wy * wz * Eyc(jg+1,kg-1,lg+1);
+
+ // interp from fine staggered to fine nodal
+ Real ef = 0.5*(Eyf(j,k-1,l) + Eyf(j,k,l));
+
+#endif
+
+ Eya(j,k,l) = eg + (ef-ec);
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_efield_z (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Eza,
+ amrex::Array4<amrex::Real const> const& Ezf,
+ amrex::Array4<amrex::Real const> const& Ezc,
+ amrex::Array4<amrex::Real const> const& Ezg)
+{
+ using namespace amrex;
+
+ int jg = amrex::coarsen(j,2);
+ Real wx = (j == jg*2) ? 0.0 : 0.5;
+ Real owx = 1.0-wx;
+
+ int kg = amrex::coarsen(k,2);
+ Real wy = (k == kg*2) ? 0.0 : 0.5;
+ Real owy = 1.0-wy;
+
+#if (AMREX_SPACEDIM == 2)
+
+ // interp from coarse nodal to fine nodal
+ Real eg = owx * owy * Ezg(jg ,kg ,0)
+ + owx * wy * Ezg(jg ,kg+1,0)
+ + wx * owy * Ezg(jg+1,kg ,0)
+ + wx * wy * Ezg(jg+1,kg+1,0);
+
+ // interp from coarse stagged to fine nodal
+ wy = 0.5-wy; owy = 1.0-wy;
+ Real ec = owx * owy * Ezc(jg ,kg ,0)
+ + owx * wy * Ezc(jg ,kg-1,0)
+ + wx * owy * Ezc(jg+1,kg ,0)
+ + wx * wy * Ezc(jg+1,kg-1,0);
+
+ // interp from fine staggered to fine nodal
+ Real ef = 0.5*(Ezf(j,k-1,0) + Ezf(j,k,0));
+
+#else
+
+ int lg = amrex::coarsen(l,2);
+ Real wz = (l == lg*2) ? 0.0 : 0.5;
+ Real owz = 1.0-wz;
+
+ // interp from coarse nodal to fine nodal
+ Real eg = owx * owy * owz * Ezg(jg ,kg ,lg )
+ + wx * owy * owz * Ezg(jg+1,kg ,lg )
+ + owx * wy * owz * Ezg(jg ,kg+1,lg )
+ + wx * wy * owz * Ezg(jg+1,kg+1,lg )
+ + owx * owy * wz * Ezg(jg ,kg ,lg+1)
+ + wx * owy * wz * Ezg(jg+1,kg ,lg+1)
+ + owx * wy * wz * Ezg(jg ,kg+1,lg+1)
+ + wx * wy * wz * Ezg(jg+1,kg+1,lg+1);
+
+ // interp from coarse staggered to fine nodal
+ wz = 0.5-wz; owz = 1.0-wz;
+ Real ec = owx * owy * owz * Ezc(jg ,kg ,lg )
+ + wx * owy * owz * Ezc(jg+1,kg ,lg )
+ + owx * wy * owz * Ezc(jg ,kg+1,lg )
+ + wx * wy * owz * Ezc(jg+1,kg+1,lg )
+ + owx * owy * wz * Ezc(jg ,kg ,lg-1)
+ + wx * owy * wz * Ezc(jg+1,kg ,lg-1)
+ + owx * wy * wz * Ezc(jg ,kg+1,lg-1)
+ + wx * wy * wz * Ezc(jg+1,kg+1,lg-1);
+
+ // interp from fine staggered to fine nodal
+ Real ef = 0.5*(Ezf(j,k,l-1) + Ezf(j,k,l));
+
+#endif
+
+ Eza(j,k,l) = eg + (ef-ec);
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_efield_x (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Exa,
+ amrex::Array4<amrex::Real const> const& Exf)
+{
+ Exa(j,k,l) = 0.5*(Exf(j-1,k,l) + Exf(j,k,l));
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_efield_y (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Eya,
+ amrex::Array4<amrex::Real const> const& Eyf)
+{
+#if (AMREX_SPACEDIM == 2)
+ Eya(j,k,0) = Eyf(j,k,0);
+#else
+ Eya(j,k,l) = 0.5*(Eyf(j,k-1,l) + Eyf(j,k,l));
+#endif
+}
+
+AMREX_GPU_DEVICE AMREX_FORCE_INLINE
+void warpx_interp_nd_efield_z (int j, int k, int l,
+ amrex::Array4<amrex::Real> const& Eza,
+ amrex::Array4<amrex::Real const> const& Ezf)
+{
+#if (AMREX_SPACEDIM == 2)
+ Eza(j,k,0) = 0.5*(Ezf(j,k-1,0) + Ezf(j,k,0));
+#else
+ Eza(j,k,l) = 0.5*(Ezf(j,k,l-1) + Ezf(j,k,l));
+#endif
+}
+
#endif
diff --git a/Source/Parallelization/WarpXRegrid.cpp b/Source/Parallelization/WarpXRegrid.cpp
index 5441755f5..2ae167283 100644
--- a/Source/Parallelization/WarpXRegrid.cpp
+++ b/Source/Parallelization/WarpXRegrid.cpp
@@ -91,7 +91,7 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa
// Aux patch
- if (lev == 0)
+ if (lev == 0 && Bfield_aux[0][0]->ixType() == Bfield_fp[0][0]->ixType())
{
for (int idim = 0; idim < 3; ++idim) {
Bfield_aux[lev][idim].reset(new MultiFab(*Bfield_fp[lev][idim], amrex::make_alias, 0, Bfield_aux[lev][idim]->nComp()));
diff --git a/Source/Particles/Deposition/CurrentDeposition.H b/Source/Particles/Deposition/CurrentDeposition.H
index 6da0f1155..2737eb008 100644
--- a/Source/Particles/Deposition/CurrentDeposition.H
+++ b/Source/Particles/Deposition/CurrentDeposition.H
@@ -4,6 +4,9 @@
#include "ShapeFactors.H"
#include <WarpX_Complex.H>
+#include <AMReX_Array4.H>
+#include <AMReX_REAL.H>
+
/* \brief Current Deposition for thread thread_num
* /param xp, yp, zp : Pointer to arrays of particle positions.
* \param wp : Pointer to array of particle weights.
@@ -208,69 +211,71 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
const amrex::Real q,
const long n_rz_azimuthal_modes)
{
+ using namespace amrex;
+
// Whether ion_lev is a null pointer (do_ionization=0) or a real pointer
// (do_ionization=1)
- const bool do_ionization = ion_lev;
- const amrex::Real dxi = 1.0/dx[0];
- const amrex::Real dtsdx0 = dt*dxi;
- const amrex::Real xmin = xyzmin[0];
+ bool const do_ionization = ion_lev;
+ Real const dxi = 1.0_rt / dx[0];
+ Real const dtsdx0 = dt*dxi;
+ Real const xmin = xyzmin[0];
#if (defined WARPX_DIM_3D)
- const amrex::Real dyi = 1.0/dx[1];
- const amrex::Real dtsdy0 = dt*dyi;
- const amrex::Real ymin = xyzmin[1];
+ Real const dyi = 1.0_rt / dx[1];
+ Real const dtsdy0 = dt*dyi;
+ Real const ymin = xyzmin[1];
#endif
- const amrex::Real dzi = 1.0/dx[2];
- const amrex::Real dtsdz0 = dt*dzi;
- const amrex::Real zmin = xyzmin[2];
+ Real const dzi = 1.0_rt / dx[2];
+ Real const dtsdz0 = dt*dzi;
+ Real const zmin = xyzmin[2];
#if (defined WARPX_DIM_3D)
- const amrex::Real invdtdx = 1.0/(dt*dx[1]*dx[2]);
- const amrex::Real invdtdy = 1.0/(dt*dx[0]*dx[2]);
- const amrex::Real invdtdz = 1.0/(dt*dx[0]*dx[1]);
+ Real const invdtdx = 1.0_rt / (dt*dx[1]*dx[2]);
+ Real const invdtdy = 1.0_rt / (dt*dx[0]*dx[2]);
+ Real const invdtdz = 1.0_rt / (dt*dx[0]*dx[1]);
#elif (defined WARPX_DIM_XZ) || (defined WARPX_DIM_RZ)
- const amrex::Real invdtdx = 1.0/(dt*dx[2]);
- const amrex::Real invdtdz = 1.0/(dt*dx[0]);
- const amrex::Real invvol = 1.0/(dx[0]*dx[2]);
+ Real const invdtdx = 1.0_rt / (dt*dx[2]);
+ Real const invdtdz = 1.0_rt / (dt*dx[0]);
+ Real const invvol = 1.0_rt / (dx[0]*dx[2]);
#endif
#if (defined WARPX_DIM_RZ)
- const Complex I = Complex{0., 1.};
+ Complex const I = Complex{0., 1.};
#endif
- const amrex::Real clightsq = 1.0/PhysConst::c/PhysConst::c;
+ Real const clightsq = 1.0_rt / ( PhysConst::c * PhysConst::c );
// Loop over particles and deposit into Jx_arr, Jy_arr and Jz_arr
amrex::ParallelFor(
np_to_depose,
- [=] AMREX_GPU_DEVICE (long ip) {
+ [=] AMREX_GPU_DEVICE (long const ip) {
// --- Get particle quantities
- const amrex::Real gaminv = 1.0/std::sqrt(1.0 + uxp[ip]*uxp[ip]*clightsq
+ Real const gaminv = 1.0/std::sqrt(1.0 + uxp[ip]*uxp[ip]*clightsq
+ uyp[ip]*uyp[ip]*clightsq
+ uzp[ip]*uzp[ip]*clightsq);
// wqx, wqy wqz are particle current in each direction
- amrex::Real wq = q*wp[ip];
+ Real wq = q*wp[ip];
if (do_ionization){
wq *= ion_lev[ip];
}
- const amrex::Real wqx = wq*invdtdx;
+ Real const wqx = wq*invdtdx;
#if (defined WARPX_DIM_3D)
- const amrex::Real wqy = wq*invdtdy;
+ Real const wqy = wq*invdtdy;
#endif
- const amrex::Real wqz = wq*invdtdz;
+ Real const wqz = wq*invdtdz;
// computes current and old position in grid units
#if (defined WARPX_DIM_RZ)
- const amrex::Real xp_mid = xp[ip] - 0.5*dt*uxp[ip]*gaminv;
- const amrex::Real yp_mid = yp[ip] - 0.5*dt*uyp[ip]*gaminv;
- const amrex::Real xp_old = xp[ip] - dt*uxp[ip]*gaminv;
- const amrex::Real yp_old = yp[ip] - dt*uyp[ip]*gaminv;
- const amrex::Real rp_new = std::sqrt(xp[ip]*xp[ip] + yp[ip]*yp[ip]);
- const amrex::Real rp_mid = std::sqrt(xp_mid*xp_mid + yp_mid*yp_mid);
- const amrex::Real rp_old = std::sqrt(xp_old*xp_old + yp_old*yp_old);
- amrex::Real costheta_new, sintheta_new;
- if (rp_new > 0.) {
+ Real const xp_mid = xp[ip] - 0.5_rt * dt*uxp[ip]*gaminv;
+ Real const yp_mid = yp[ip] - 0.5_rt * dt*uyp[ip]*gaminv;
+ Real const xp_old = xp[ip] - dt*uxp[ip]*gaminv;
+ Real const yp_old = yp[ip] - dt*uyp[ip]*gaminv;
+ Real const rp_new = std::sqrt(xp[ip]*xp[ip] + yp[ip]*yp[ip]);
+ Real const rp_mid = std::sqrt(xp_mid*xp_mid + yp_mid*yp_mid);
+ Real const rp_old = std::sqrt(xp_old*xp_old + yp_old*yp_old);
+ Real costheta_new, sintheta_new;
+ if (rp_new > 0._rt) {
costheta_new = xp[ip]/rp_new;
sintheta_new = yp[ip]/rp_new;
} else {
@@ -278,7 +283,7 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
sintheta_new = 0.;
}
amrex::Real costheta_mid, sintheta_mid;
- if (rp_mid > 0.) {
+ if (rp_mid > 0._rt) {
costheta_mid = xp_mid/rp_mid;
sintheta_mid = yp_mid/rp_mid;
} else {
@@ -286,7 +291,7 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
sintheta_mid = 0.;
}
amrex::Real costheta_old, sintheta_old;
- if (rp_old > 0.) {
+ if (rp_old > 0._rt) {
costheta_old = xp_old/rp_old;
sintheta_old = yp_old/rp_old;
} else {
@@ -296,37 +301,37 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
const Complex xy_new0 = Complex{costheta_new, sintheta_new};
const Complex xy_mid0 = Complex{costheta_mid, sintheta_mid};
const Complex xy_old0 = Complex{costheta_old, sintheta_old};
- const amrex::Real x_new = (rp_new - xmin)*dxi;
- const amrex::Real x_old = (rp_old - xmin)*dxi;
+ Real const x_new = (rp_new - xmin)*dxi;
+ Real const x_old = (rp_old - xmin)*dxi;
#else
- const amrex::Real x_new = (xp[ip] - xmin)*dxi;
- const amrex::Real x_old = x_new - dtsdx0*uxp[ip]*gaminv;
+ Real const x_new = (xp[ip] - xmin)*dxi;
+ Real const x_old = x_new - dtsdx0*uxp[ip]*gaminv;
#endif
#if (defined WARPX_DIM_3D)
- const amrex::Real y_new = (yp[ip] - ymin)*dyi;
- const amrex::Real y_old = y_new - dtsdy0*uyp[ip]*gaminv;
+ Real const y_new = (yp[ip] - ymin)*dyi;
+ Real const y_old = y_new - dtsdy0*uyp[ip]*gaminv;
#endif
- const amrex::Real z_new = (zp[ip] - zmin)*dzi;
- const amrex::Real z_old = z_new - dtsdz0*uzp[ip]*gaminv;
+ Real const z_new = (zp[ip] - zmin)*dzi;
+ Real const z_old = z_new - dtsdz0*uzp[ip]*gaminv;
#if (defined WARPX_DIM_RZ)
- const amrex::Real vy = (-uxp[ip]*sintheta_mid + uyp[ip]*costheta_mid)*gaminv;
+ Real const vy = (-uxp[ip]*sintheta_mid + uyp[ip]*costheta_mid)*gaminv;
#elif (defined WARPX_DIM_XZ)
- const amrex::Real vy = uyp[ip]*gaminv;
+ Real const vy = uyp[ip]*gaminv;
#endif
// Shape factor arrays
// Note that there are extra values above and below
// to possibly hold the factor for the old particle
// which can be at a different grid location.
- amrex::Real sx_new[depos_order + 3] = {0.};
- amrex::Real sx_old[depos_order + 3] = {0.};
+ Real sx_new[depos_order + 3] = {0.};
+ Real sx_old[depos_order + 3] = {0.};
#if (defined WARPX_DIM_3D)
- amrex::Real sy_new[depos_order + 3] = {0.};
- amrex::Real sy_old[depos_order + 3] = {0.};
+ Real sy_new[depos_order + 3] = {0.};
+ Real sy_old[depos_order + 3] = {0.};
#endif
- amrex::Real sz_new[depos_order + 3] = {0.};
- amrex::Real sz_old[depos_order + 3] = {0.};
+ Real sz_new[depos_order + 3] = {0.};
+ Real sz_old[depos_order + 3] = {0.};
// --- Compute shape factors
// Compute shape factors for position as they are now and at old positions
@@ -397,7 +402,7 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
Complex xy_mid = xy_mid0; // Throughout the following loop, xy_mid takes the value e^{i m theta}
for (int imode=1 ; imode < n_rz_azimuthal_modes ; imode++) {
// The factor 2 comes from the normalization of the modes
- const Complex djr_cmplx = amrex::Real(2.)*sdxi*xy_mid;
+ const Complex djr_cmplx = 2._rt *sdxi*xy_mid;
amrex::Gpu::Atomic::Add( &Jx_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 2*imode-1), djr_cmplx.real());
amrex::Gpu::Atomic::Add( &Jx_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 2*imode), djr_cmplx.imag());
xy_mid = xy_mid*xy_mid0;
@@ -407,8 +412,8 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
}
for (int k=dkl; k<=depos_order+2-dku; k++) {
for (int i=dil; i<=depos_order+2-diu; i++) {
- const amrex::Real sdyj = wq*vy*invvol*((sz_new[k] + 0.5*(sz_old[k] - sz_new[k]))*sx_new[i] +
- (0.5*sz_new[k] + 1./3.*(sz_old[k] - sz_new[k]))*(sx_old[i] - sx_new[i]));
+ Real const sdyj = wq*vy*invvol*((sz_new[k] + 0.5_rt * (sz_old[k] - sz_new[k]))*sx_new[i] +
+ (0.5_rt * sz_new[k] + 1._rt / 3._rt *(sz_old[k] - sz_new[k]))*(sx_old[i] - sx_new[i]));
amrex::Gpu::Atomic::Add( &Jy_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 0), sdyj);
#if (defined WARPX_DIM_RZ)
Complex xy_new = xy_new0;
@@ -418,7 +423,7 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
for (int imode=1 ; imode < n_rz_azimuthal_modes ; imode++) {
// The factor 2 comes from the normalization of the modes
// The minus sign comes from the different convention with respect to Davidson et al.
- const Complex djt_cmplx = -amrex::Real(2.)*I*(i_new-1 + i + xmin*dxi)*wq*invdtdx/(amrex::Real)imode*
+ const Complex djt_cmplx = -2._rt * I*(i_new-1 + i + xmin*dxi)*wq*invdtdx/(amrex::Real)imode*
(sx_new[i]*sz_new[k]*(xy_new - xy_mid) + sx_old[i]*sz_old[k]*(xy_mid - xy_old));
amrex::Gpu::Atomic::Add( &Jy_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 2*imode-1), djt_cmplx.real());
amrex::Gpu::Atomic::Add( &Jy_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 2*imode), djt_cmplx.imag());
@@ -430,15 +435,15 @@ void doEsirkepovDepositionShapeN (const amrex::ParticleReal * const xp,
}
}
for (int i=dil; i<=depos_order+2-diu; i++) {
- amrex::Real sdzk = 0.;
+ Real sdzk = 0.;
for (int k=dkl; k<=depos_order+1-dku; k++) {
- sdzk += wqz*(sz_old[k] - sz_new[k])*(sx_new[i] + 0.5*(sx_old[i] - sx_new[i]));
+ sdzk += wqz*(sz_old[k] - sz_new[k])*(sx_new[i] + 0.5_rt * (sx_old[i] - sx_new[i]));
amrex::Gpu::Atomic::Add( &Jz_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 0), sdzk);
#if (defined WARPX_DIM_RZ)
Complex xy_mid = xy_mid0; // Throughout the following loop, xy_mid takes the value e^{i m theta}
for (int imode=1 ; imode < n_rz_azimuthal_modes ; imode++) {
// The factor 2 comes from the normalization of the modes
- const Complex djz_cmplx = amrex::Real(2.)*sdzk*xy_mid;
+ const Complex djz_cmplx = 2._rt * sdzk * xy_mid;
amrex::Gpu::Atomic::Add( &Jz_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 2*imode-1), djz_cmplx.real());
amrex::Gpu::Atomic::Add( &Jz_arr(lo.x+i_new-1+i, lo.y+k_new-1+k, 0, 2*imode), djz_cmplx.imag());
xy_mid = xy_mid*xy_mid0;
diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H
index 58546a106..30f7354d0 100644
--- a/Source/Particles/MultiParticleContainer.H
+++ b/Source/Particles/MultiParticleContainer.H
@@ -162,9 +162,9 @@ public:
int nSpecies() const {return nspecies;}
- int nSpeciesBoostedFrameDiags() const {return nspecies_boosted_frame_diags;}
- int mapSpeciesBoostedFrameDiags(int i) const {return map_species_boosted_frame_diags[i];}
- int doBoostedFrameDiags() const {return do_boosted_frame_diags;}
+ int nSpeciesBackTransformedDiagnostics() const {return nspecies_back_transformed_diagnostics;}
+ int mapSpeciesBackTransformedDiagnostics(int i) const {return map_species_back_transformed_diagnostics[i];}
+ int doBackTransformedDiagnostics() const {return do_back_transformed_diagnostics;}
int nSpeciesDepositOnMainGrid () const {
bool const onMainGrid = true;
@@ -215,8 +215,8 @@ protected:
#ifdef WARPX_QED
// The QED engines
- BreitWheelerEngine bw_engine;
- QuantumSynchrotronEngine qs_engine;
+ std::shared_ptr<BreitWheelerEngine> shr_p_bw_engine;
+ std::shared_ptr<QuantumSynchrotronEngine> shr_p_qs_engine;
//_______________________________
//Initialize QED engines and provides smart pointers
@@ -236,12 +236,12 @@ private:
void mapSpeciesProduct ();
int getSpeciesID (std::string product_str);
- // Number of species dumped in BoostedFrameDiagnostics
- int nspecies_boosted_frame_diags = 0;
- // map_species_boosted_frame_diags[i] is the species ID in
- // MultiParticleContainer for 0<i<nspecies_boosted_frame_diags
- std::vector<int> map_species_boosted_frame_diags;
- int do_boosted_frame_diags = 0;
+ // Number of species dumped in BackTransformedDiagnostics
+ int nspecies_back_transformed_diagnostics = 0;
+ // map_species_back_transformed_diagnostics[i] is the species ID in
+ // MultiParticleContainer for 0<i<nspecies_back_transformed_diagnostics
+ std::vector<int> map_species_back_transformed_diagnostics;
+ int do_back_transformed_diagnostics = 0;
// runtime parameters
int nlasers = 0;
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index c860d21f5..63aa500e9 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -38,14 +38,14 @@ MultiParticleContainer::MultiParticleContainer (AmrCore* amr_core)
// Compute the number of species for which lab-frame data is dumped
// nspecies_lab_frame_diags, and map their ID to MultiParticleContainer
// particle IDs in map_species_lab_diags.
- map_species_boosted_frame_diags.resize(nspecies);
- nspecies_boosted_frame_diags = 0;
+ map_species_back_transformed_diagnostics.resize(nspecies);
+ nspecies_back_transformed_diagnostics = 0;
for (int i=0; i<nspecies; i++){
auto& pc = allcontainers[i];
- if (pc->do_boosted_frame_diags){
- map_species_boosted_frame_diags[nspecies_boosted_frame_diags] = i;
- do_boosted_frame_diags = 1;
- nspecies_boosted_frame_diags += 1;
+ if (pc->do_back_transformed_diagnostics){
+ map_species_back_transformed_diagnostics[nspecies_back_transformed_diagnostics] = i;
+ do_back_transformed_diagnostics = 1;
+ nspecies_back_transformed_diagnostics += 1;
}
}
}
@@ -387,8 +387,8 @@ MultiParticleContainer
BL_PROFILE("MultiParticleContainer::GetLabFrameData");
// Loop over particle species
- for (int i = 0; i < nspecies_boosted_frame_diags; ++i){
- int isp = map_species_boosted_frame_diags[i];
+ for (int i = 0; i < nspecies_back_transformed_diagnostics; ++i){
+ int isp = map_species_back_transformed_diagnostics[i];
WarpXParticleContainer* pc = allcontainers[isp].get();
WarpXParticleContainer::DiagnosticParticles diagnostic_particles;
pc->GetParticleSlice(direction, z_old, z_new, t_boost, t_lab, dt, diagnostic_particles);
@@ -603,9 +603,9 @@ namespace
}
// --- product runtime attribs
GpuArray<ParticleReal*,6> runtime_attribs_product;
- bool do_boosted_product = WarpX::do_boosted_frame_diagnostic
- && pc_product->DoBoostedFrameDiags();
- if (do_boosted_product) {
+ bool do_back_transformed_product = WarpX::do_back_transformed_diagnostics
+ && pc_product->doBackTransformedDiagnostics();
+ if (do_back_transformed_product) {
std::map<std::string, int> comps_product = pc_product->getParticleComps();
runtime_attribs_product[0] = soa_product.GetRealData(comps_product[ "xold"]).data() + np_product_old;
runtime_attribs_product[1] = soa_product.GetRealData(comps_product[ "yold"]).data() + np_product_old;
@@ -652,7 +652,7 @@ namespace
// Update xold etc. if boosted frame diagnostics required
// for product species. Fill runtime attribs with a copy of
// current properties (xold = x etc.).
- if (do_boosted_product) {
+ if (do_back_transformed_product) {
runtime_attribs_product[0][ip] = p_source.pos(0);
runtime_attribs_product[1][ip] = p_source.pos(1);
runtime_attribs_product[2][ip] = p_source.pos(2);
@@ -736,14 +736,17 @@ MultiParticleContainer::doFieldIonization ()
#ifdef WARPX_QED
void MultiParticleContainer::InitQED ()
{
+ shr_p_qs_engine = std::make_shared<QuantumSynchrotronEngine>();
+ shr_p_bw_engine = std::make_shared<BreitWheelerEngine>();
+
for (auto& pc : allcontainers) {
if(pc->has_quantum_sync()){
pc->set_quantum_sync_engine_ptr
- (std::make_shared<QuantumSynchrotronEngine>(qs_engine));
+ (shr_p_qs_engine);
}
if(pc->has_breit_wheeler()){
pc->set_breit_wheeler_engine_ptr
- (std::make_shared<BreitWheelerEngine>(bw_engine));
+ (shr_p_bw_engine);
}
}
}
diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp
index 3c70a957f..612da01ca 100644
--- a/Source/Particles/PhotonParticleContainer.cpp
+++ b/Source/Particles/PhotonParticleContainer.cpp
@@ -31,7 +31,7 @@ PhotonParticleContainer::PhotonParticleContainer (AmrCore* amr_core, int ispecie
pp.query("do_qed_breit_wheeler", do_qed_breit_wheeler);
//Check for processes which do not make sense for photons
- bool test_quantum_sync;
+ bool test_quantum_sync = false;
pp.query("do_qed_quantum_sync", test_quantum_sync);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
test_quantum_sync == 0,
@@ -45,9 +45,8 @@ void PhotonParticleContainer::InitData()
{
AddParticles(0); // Note - add on level 0
- if (maxLevel() > 0) {
- Redistribute(); // We then redistribute
- }
+ Redistribute(); // We then redistribute
+
}
void
@@ -74,7 +73,7 @@ PhotonParticleContainer::PushPX(WarpXParIter& pti,
const ParticleReal* const AMREX_RESTRICT By = attribs[PIdx::By].dataPtr();
const ParticleReal* const AMREX_RESTRICT Bz = attribs[PIdx::Bz].dataPtr();
- if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags)
+ if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics)
{
copy_attribs(pti, x, y, z);
}
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 15394fcff..6cfe20dd9 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -43,7 +43,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp
pp.query("do_continuous_injection", do_continuous_injection);
// Whether to plot back-transformed (lab-frame) diagnostics
// for this species.
- pp.query("do_boosted_frame_diags", do_boosted_frame_diags);
+ pp.query("do_back_transformed_diagnostics", do_back_transformed_diagnostics);
pp.query("do_field_ionization", do_field_ionization);
@@ -86,7 +86,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp
//variable to set plot_flags size
int plot_flag_size = PIdx::nattribs;
- if(WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags)
+ if(WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics)
plot_flag_size += 6;
#ifdef WARPX_QED
@@ -441,13 +441,13 @@ PhysicalParticleContainer::AddPlasma (int lev, RealBox part_realbox)
for (int dir=0; dir<AMREX_SPACEDIM; dir++) {
if ( tile_realbox.lo(dir) <= part_realbox.hi(dir) ) {
Real ncells_adjust = std::floor( (tile_realbox.lo(dir) - part_realbox.lo(dir))/dx[dir] );
- overlap_realbox.setLo( dir, part_realbox.lo(dir) + std::max(ncells_adjust, Real(0.)) * dx[dir]);
+ overlap_realbox.setLo( dir, part_realbox.lo(dir) + std::max(ncells_adjust, 0._rt) * dx[dir]);
} else {
no_overlap = true; break;
}
if ( tile_realbox.hi(dir) >= part_realbox.lo(dir) ) {
Real ncells_adjust = std::floor( (part_realbox.hi(dir) - tile_realbox.hi(dir))/dx[dir] );
- overlap_realbox.setHi( dir, part_realbox.hi(dir) - std::max(ncells_adjust, Real(0.)) * dx[dir]);
+ overlap_realbox.setHi( dir, part_realbox.hi(dir) - std::max(ncells_adjust, 0._rt) * dx[dir]);
} else {
no_overlap = true; break;
}
@@ -1078,7 +1078,7 @@ PhysicalParticleContainer::Evolve (int lev,
bool has_buffer = cEx || cjx;
- if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags)
+ if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics)
{
for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti)
{
@@ -1427,9 +1427,9 @@ PhysicalParticleContainer::SplitParticles(int lev)
// before splitting results in a uniform distribution after splitting
const amrex::Vector<int> ppc_nd = plasma_injector->num_particles_per_cell_each_dim;
const std::array<Real,3>& dx = WarpX::CellSize(lev);
- amrex::Vector<amrex::Real> split_offset = {dx[0]/2./ppc_nd[0],
- dx[1]/2./ppc_nd[1],
- dx[2]/2./ppc_nd[2]};
+ amrex::Vector<Real> split_offset = {dx[0]/2._rt/ppc_nd[0],
+ dx[1]/2._rt/ppc_nd[1],
+ dx[2]/2._rt/ppc_nd[2]};
// particle Array Of Structs data
auto& particles = pti.GetArrayOfStructs();
@@ -1585,7 +1585,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti,
const ParticleReal* const AMREX_RESTRICT By = attribs[PIdx::By].dataPtr();
const ParticleReal* const AMREX_RESTRICT Bz = attribs[PIdx::Bz].dataPtr();
- if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags && (a_dt_type!=DtType::SecondHalf))
+ if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics && (a_dt_type!=DtType::SecondHalf))
{
copy_attribs(pti, x, y, z);
}
@@ -1842,7 +1842,7 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real
// Note the the slice should always move in the negative boost direction.
AMREX_ALWAYS_ASSERT(z_new < z_old);
- AMREX_ALWAYS_ASSERT(do_boosted_frame_diags == 1);
+ AMREX_ALWAYS_ASSERT(do_back_transformed_diagnostics == 1);
const int nlevs = std::max(0, finestLevel()+1);
diff --git a/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H b/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H
index 0abedd258..0bc0f5d01 100644
--- a/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H
+++ b/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H
@@ -23,8 +23,7 @@ void UpdateMomentumBorisWithRadiationReaction(
const amrex::Real uy_old = uy;
const amrex::Real uz_old = uz;
- //Useful constants
- const amrex::Real inv_dt = 1.0/dt;
+ //Useful constant
constexpr amrex::Real inv_c2 = 1./(PhysConst::c*PhysConst::c);
//Call to regular Boris pusher
diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H
index 879f4782e..8930cb176 100644
--- a/Source/Particles/WarpXParticleContainer.H
+++ b/Source/Particles/WarpXParticleContainer.H
@@ -273,7 +273,7 @@ public:
AddIntComp(comm);
}
- int DoBoostedFrameDiags () const { return do_boosted_frame_diags; }
+ int doBackTransformedDiagnostics () const { return do_back_transformed_diagnostics; }
virtual void buildIonizationMask (const amrex::MFIter& mfi, const int lev,
amrex::Gpu::ManagedDeviceVector<int>& ionization_mask)
@@ -316,7 +316,7 @@ protected:
amrex::Gpu::ManagedVector<amrex::Real> adk_exp_prefactor;
std::string physical_element;
- int do_boosted_frame_diags = 1;
+ int do_back_transformed_diagnostics = 1;
#ifdef WARPX_QED
bool do_qed = false;
diff --git a/Source/Utils/WarpXAlgorithmSelection.H b/Source/Utils/WarpXAlgorithmSelection.H
index 269171a5f..7d26e7af5 100644
--- a/Source/Utils/WarpXAlgorithmSelection.H
+++ b/Source/Utils/WarpXAlgorithmSelection.H
@@ -34,9 +34,9 @@ struct ChargeDepositionAlgo {
};
struct GatheringAlgo {
- // Only the Standard algorithm is implemented
enum {
- Standard = 0
+ EnergyConserving = 0,
+ MomentumConserving
};
};
diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp
index be9cdd118..4b66a0809 100644
--- a/Source/Utils/WarpXAlgorithmSelection.cpp
+++ b/Source/Utils/WarpXAlgorithmSelection.cpp
@@ -34,8 +34,9 @@ const std::map<std::string, int> charge_deposition_algo_to_int = {
};
const std::map<std::string, int> gathering_algo_to_int = {
- {"standard", GatheringAlgo::Standard },
- {"default", GatheringAlgo::Standard }
+ {"energy-conserving", GatheringAlgo::EnergyConserving },
+ {"momentum-conserving", GatheringAlgo::MomentumConserving },
+ {"default", GatheringAlgo::EnergyConserving }
};
diff --git a/Source/Utils/WarpXTagging.cpp b/Source/Utils/WarpXTagging.cpp
index 8ea3211a3..91bb802e8 100644
--- a/Source/Utils/WarpXTagging.cpp
+++ b/Source/Utils/WarpXTagging.cpp
@@ -22,9 +22,9 @@ WarpX::ErrorEst (int lev, TagBoxArray& tags, Real time, int /*ngrow*/)
for (BoxIterator bi(bx); bi.ok(); ++bi)
{
const IntVect& cell = bi();
- RealVect pos {AMREX_D_DECL((cell[0]+0.5)*dx[0]+problo[0],
- (cell[1]+0.5)*dx[1]+problo[1],
- (cell[2]+0.5)*dx[2]+problo[2])};
+ RealVect pos {AMREX_D_DECL((cell[0]+0.5_rt)*dx[0]+problo[0],
+ (cell[1]+0.5_rt)*dx[1]+problo[1],
+ (cell[2]+0.5_rt)*dx[2]+problo[2])};
if (pos > fine_tag_lo && pos < fine_tag_hi) {
fab(cell) = TagBox::SET;
}
diff --git a/Source/WarpX.H b/Source/WarpX.H
index 867a33bc3..f55670cfb 100644
--- a/Source/WarpX.H
+++ b/Source/WarpX.H
@@ -4,7 +4,7 @@
#include "WarpXDtType.H"
#include <MultiParticleContainer.H>
#include <PML.H>
-#include <BoostedFrameDiagnostic.H>
+#include <BackTransformedDiagnostic.H>
#include <BilinearFilter.H>
#include <NCIGodfreyFilter.H>
@@ -105,12 +105,12 @@ public:
static bool serialize_ics;
// Back transformation diagnostic
- static bool do_boosted_frame_diagnostic;
+ static bool do_back_transformed_diagnostics;
static std::string lab_data_directory;
static int num_snapshots_lab;
static amrex::Real dt_snapshots_lab;
- static bool do_boosted_frame_fields;
- static bool do_boosted_frame_particles;
+ static bool do_back_transformed_fields;
+ static bool do_back_transformed_particles;
// Boosted frame parameters
static amrex::Real gamma_boost;
@@ -209,6 +209,8 @@ public:
// This function does aux(lev) = fp(lev) + I(aux(lev-1)-cp(lev)).
// Caller must make sure fp and cp have ghost cells filled.
void UpdateAuxilaryData ();
+ void UpdateAuxilaryDataStagToNodal ();
+ void UpdateAuxilaryDataSameType ();
// Fill boundary cells including coarse/fine boundaries
void FillBoundaryB ();
@@ -481,7 +483,7 @@ private:
std::unique_ptr<MultiParticleContainer> mypc;
// Boosted Frame Diagnostics
- std::unique_ptr<BoostedFrameDiagnostic> myBFD;
+ std::unique_ptr<BackTransformedDiagnostic> myBFD;
//
// Fields: First array for level, second for direction
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 53c3254f6..eef033236 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -64,12 +64,12 @@ int WarpX::num_mirrors = 0;
int WarpX::sort_int = -1;
-bool WarpX::do_boosted_frame_diagnostic = false;
+bool WarpX::do_back_transformed_diagnostics = false;
std::string WarpX::lab_data_directory = "lab_frame_data";
int WarpX::num_snapshots_lab = std::numeric_limits<int>::lowest();
Real WarpX::dt_snapshots_lab = std::numeric_limits<Real>::lowest();
-bool WarpX::do_boosted_frame_fields = true;
-bool WarpX::do_boosted_frame_particles = true;
+bool WarpX::do_back_transformed_fields = true;
+bool WarpX::do_back_transformed_particles = true;
int WarpX::num_slice_snapshots_lab = 0;
Real WarpX::dt_slice_snapshots_lab;
@@ -171,7 +171,7 @@ WarpX::WarpX ()
current_injection_position = geom[0].ProbLo(moving_window_dir);
}
}
- do_boosted_frame_particles = mypc->doBoostedFrameDiags();
+ do_back_transformed_particles = mypc->doBackTransformedDiagnostics();
Efield_aux.resize(nlevs_max);
Bfield_aux.resize(nlevs_max);
@@ -330,8 +330,8 @@ WarpX::ReadParameters ()
moving_window_v *= PhysConst::c;
}
- pp.query("do_boosted_frame_diagnostic", do_boosted_frame_diagnostic);
- if (do_boosted_frame_diagnostic) {
+ pp.query("do_back_transformed_diagnostics", do_back_transformed_diagnostics);
+ if (do_back_transformed_diagnostics) {
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(gamma_boost > 1.0,
"gamma_boost must be > 1 to use the boosted frame diagnostic.");
@@ -359,7 +359,7 @@ WarpX::ReadParameters ()
pp.get("gamma_boost", gamma_boost);
- pp.query("do_boosted_frame_fields", do_boosted_frame_fields);
+ pp.query("do_back_transformed_fields", do_back_transformed_fields);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(do_moving_window,
"The moving window should be on if using the boosted frame diagnostic.");
@@ -547,9 +547,13 @@ WarpX::ReadParameters ()
ParmParse pp("algo");
current_deposition_algo = GetAlgorithmInteger(pp, "current_deposition");
charge_deposition_algo = GetAlgorithmInteger(pp, "charge_deposition");
- field_gathering_algo = GetAlgorithmInteger(pp, "field_gathering");
particle_pusher_algo = GetAlgorithmInteger(pp, "particle_pusher");
maxwell_fdtd_solver_id = GetAlgorithmInteger(pp, "maxwell_fdtd_solver");
+ field_gathering_algo = GetAlgorithmInteger(pp, "field_gathering");
+ if (field_gathering_algo == GatheringAlgo::MomentumConserving) {
+ // Use same shape factors in all directions, for gathering
+ l_lower_order_in_v = false;
+ }
}
#ifdef WARPX_USE_PSATD
@@ -602,7 +606,7 @@ WarpX::ReadParameters ()
}
}
- if (do_boosted_frame_diagnostic) {
+ if (do_back_transformed_diagnostics) {
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(gamma_boost > 1.0,
"gamma_boost must be > 1 to use the boost frame diagnostic");
pp.query("num_slice_snapshots_lab", num_slice_snapshots_lab);
@@ -817,16 +821,19 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
ncomps = n_rz_azimuthal_modes*2 - 1;
#endif
+ bool aux_is_nodal = (field_gathering_algo == GatheringAlgo::MomentumConserving);
+ IntVect ngextra(static_cast<int>(aux_is_nodal and !do_nodal));
+
//
// The fine patch
//
- Bfield_fp[lev][0].reset( new MultiFab(amrex::convert(ba,Bx_nodal_flag),dm,ncomps,ngE));
- Bfield_fp[lev][1].reset( new MultiFab(amrex::convert(ba,By_nodal_flag),dm,ncomps,ngE));
- Bfield_fp[lev][2].reset( new MultiFab(amrex::convert(ba,Bz_nodal_flag),dm,ncomps,ngE));
+ Bfield_fp[lev][0].reset( new MultiFab(amrex::convert(ba,Bx_nodal_flag),dm,ncomps,ngE+ngextra));
+ Bfield_fp[lev][1].reset( new MultiFab(amrex::convert(ba,By_nodal_flag),dm,ncomps,ngE+ngextra));
+ Bfield_fp[lev][2].reset( new MultiFab(amrex::convert(ba,Bz_nodal_flag),dm,ncomps,ngE+ngextra));
- Efield_fp[lev][0].reset( new MultiFab(amrex::convert(ba,Ex_nodal_flag),dm,ncomps,ngE));
- Efield_fp[lev][1].reset( new MultiFab(amrex::convert(ba,Ey_nodal_flag),dm,ncomps,ngE));
- Efield_fp[lev][2].reset( new MultiFab(amrex::convert(ba,Ez_nodal_flag),dm,ncomps,ngE));
+ Efield_fp[lev][0].reset( new MultiFab(amrex::convert(ba,Ex_nodal_flag),dm,ncomps,ngE+ngextra));
+ Efield_fp[lev][1].reset( new MultiFab(amrex::convert(ba,Ey_nodal_flag),dm,ncomps,ngE+ngextra));
+ Efield_fp[lev][2].reset( new MultiFab(amrex::convert(ba,Ez_nodal_flag),dm,ncomps,ngE+ngextra));
current_fp[lev][0].reset( new MultiFab(amrex::convert(ba,jx_nodal_flag),dm,ncomps,ngJ));
current_fp[lev][1].reset( new MultiFab(amrex::convert(ba,jy_nodal_flag),dm,ncomps,ngJ));
@@ -873,7 +880,19 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
//
// The Aux patch (i.e., the full solution)
//
- if (lev == 0)
+ if (aux_is_nodal and !do_nodal)
+ {
+ // Create aux multifabs on Nodal Box Array
+ BoxArray const nba = amrex::convert(ba,IntVect::TheNodeVector());
+ Bfield_aux[lev][0].reset( new MultiFab(nba,dm,ncomps,ngE));
+ Bfield_aux[lev][1].reset( new MultiFab(nba,dm,ncomps,ngE));
+ Bfield_aux[lev][2].reset( new MultiFab(nba,dm,ncomps,ngE));
+
+ Efield_aux[lev][0].reset( new MultiFab(nba,dm,ncomps,ngE));
+ Efield_aux[lev][1].reset( new MultiFab(nba,dm,ncomps,ngE));
+ Efield_aux[lev][2].reset( new MultiFab(nba,dm,ncomps,ngE));
+ }
+ else if (lev == 0)
{
for (int idir = 0; idir < 3; ++idir) {
Efield_aux[lev][idir].reset(new MultiFab(*Efield_fp[lev][idir], amrex::make_alias, 0, ncomps));
@@ -954,15 +973,25 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
cba.coarsen(refRatio(lev-1));
if (n_field_gather_buffer > 0 || mypc->nSpeciesGatherFromMainGrid() > 0) {
- // Create the MultiFabs for B
- Bfield_cax[lev][0].reset( new MultiFab(amrex::convert(cba,Bx_nodal_flag),dm,ncomps,ngE));
- Bfield_cax[lev][1].reset( new MultiFab(amrex::convert(cba,By_nodal_flag),dm,ncomps,ngE));
- Bfield_cax[lev][2].reset( new MultiFab(amrex::convert(cba,Bz_nodal_flag),dm,ncomps,ngE));
-
- // Create the MultiFabs for E
- Efield_cax[lev][0].reset( new MultiFab(amrex::convert(cba,Ex_nodal_flag),dm,ncomps,ngE));
- Efield_cax[lev][1].reset( new MultiFab(amrex::convert(cba,Ey_nodal_flag),dm,ncomps,ngE));
- Efield_cax[lev][2].reset( new MultiFab(amrex::convert(cba,Ez_nodal_flag),dm,ncomps,ngE));
+ if (aux_is_nodal) {
+ BoxArray const& cnba = amrex::convert(cba,IntVect::TheNodeVector());
+ Bfield_cax[lev][0].reset( new MultiFab(cnba,dm,ncomps,ngE));
+ Bfield_cax[lev][1].reset( new MultiFab(cnba,dm,ncomps,ngE));
+ Bfield_cax[lev][2].reset( new MultiFab(cnba,dm,ncomps,ngE));
+ Efield_cax[lev][0].reset( new MultiFab(cnba,dm,ncomps,ngE));
+ Efield_cax[lev][1].reset( new MultiFab(cnba,dm,ncomps,ngE));
+ Efield_cax[lev][2].reset( new MultiFab(cnba,dm,ncomps,ngE));
+ } else {
+ // Create the MultiFabs for B
+ Bfield_cax[lev][0].reset( new MultiFab(amrex::convert(cba,Bx_nodal_flag),dm,ncomps,ngE));
+ Bfield_cax[lev][1].reset( new MultiFab(amrex::convert(cba,By_nodal_flag),dm,ncomps,ngE));
+ Bfield_cax[lev][2].reset( new MultiFab(amrex::convert(cba,Bz_nodal_flag),dm,ncomps,ngE));
+
+ // Create the MultiFabs for E
+ Efield_cax[lev][0].reset( new MultiFab(amrex::convert(cba,Ex_nodal_flag),dm,ncomps,ngE));
+ Efield_cax[lev][1].reset( new MultiFab(amrex::convert(cba,Ey_nodal_flag),dm,ncomps,ngE));
+ Efield_cax[lev][2].reset( new MultiFab(amrex::convert(cba,Ez_nodal_flag),dm,ncomps,ngE));
+ }
gather_buffer_masks[lev].reset( new iMultiFab(ba, dm, ncomps, 1) );
// Gather buffer masks have 1 ghost cell, because of the fact
diff --git a/Examples/batchScripts/batch_cori.sh b/Tools/batchScripts/batch_cori.sh
index e6cd5e1ef..e6cd5e1ef 100644
--- a/Examples/batchScripts/batch_cori.sh
+++ b/Tools/batchScripts/batch_cori.sh
diff --git a/Examples/batchScripts/batch_summit.sh b/Tools/batchScripts/batch_summit.sh
index 002660b91..002660b91 100644
--- a/Examples/batchScripts/batch_summit.sh
+++ b/Tools/batchScripts/batch_summit.sh
diff --git a/Examples/Tests/gpu_test/script_profiling.sh b/Tools/batchScripts/script_profiling_summit.sh
index cd6b0eadd..cd6b0eadd 100755
--- a/Examples/Tests/gpu_test/script_profiling.sh
+++ b/Tools/batchScripts/script_profiling_summit.sh
diff --git a/Tools/performance_tests/automated_test_4_labdiags_2ppc b/Tools/performance_tests/automated_test_4_labdiags_2ppc
index 282c93331..bac071f63 100644
--- a/Tools/performance_tests/automated_test_4_labdiags_2ppc
+++ b/Tools/performance_tests/automated_test_4_labdiags_2ppc
@@ -35,7 +35,7 @@ warpx.gamma_boost = 15.
warpx.boost_direction = z
# Diagnostics
-warpx.do_boosted_frame_diagnostic = 1
+warpx.do_back_transformed_diagnostics = 1
warpx.num_snapshots_lab = 20
warpx.dt_snapshots_lab = 7.0e-14
diff --git a/Tools/performance_tests/automated_test_5_loadimbalance b/Tools/performance_tests/automated_test_5_loadimbalance
index d2e03372b..17321802f 100644
--- a/Tools/performance_tests/automated_test_5_loadimbalance
+++ b/Tools/performance_tests/automated_test_5_loadimbalance
@@ -17,7 +17,7 @@ geometry.prob_lo = -20.e-6 -20.e-6 -20.e-6 # physical domain
geometry.prob_hi = 20.e-6 20.e-6 20.e-6
warpx.verbose = 1
-warpx.load_balance_int = 5
+warpx.load_balance_int = -5
interpolation.nox = 3
interpolation.noy = 3
interpolation.noz = 3
diff --git a/Tools/performance_tests/functions_perftest.py b/Tools/performance_tests/functions_perftest.py
index 8bc1000d7..213ddb77d 100644
--- a/Tools/performance_tests/functions_perftest.py
+++ b/Tools/performance_tests/functions_perftest.py
@@ -174,6 +174,7 @@ def get_nsteps(run_name):
def extract_dataframe(filename, n_steps):
# Get init time and total time through Inclusive time
partition_limit_start = 'NCalls Incl. Min Incl. Avg Incl. Max Max %'
+ print(filename)
with open(filename) as file_handler:
output_text = file_handler.read()
# get total simulation time
diff --git a/Tools/performance_tests/run_automated.py b/Tools/performance_tests/run_automated.py
index a6a05fb54..1597b9f05 100644
--- a/Tools/performance_tests/run_automated.py
+++ b/Tools/performance_tests/run_automated.py
@@ -67,7 +67,7 @@ parser.add_argument('--architecture',
default='knl',
help='which architecture to cross-compile for NERSC machines')
parser.add_argument('--mode',
- choices=['run', 'read', 'browse_output_files', 'write_csv'],
+ choices=['run', 'read', 'browse_output_files'],
default='run',
help='whether to run perftests or read their perf output. run calls read')
args = parser.parse_args()
@@ -79,20 +79,17 @@ architecture = args.architecture
# Set behavior variables
########################
-write_csv = False
+update_perf_log_repo = False
browse_output_files = False
-if args.mode == 'write_csv':
- write_csv = True
if args.mode == 'browse_output_files':
browse_output_file = True
if args.mode == 'read':
- write_csv = True
browse_output_files = True
recompile = args.recompile
perf_database_file = 'my_tests_database.h5'
if args.automated == True:
run_name = 'automated_tests'
- perf_database_file = 'automated_tests_database.h5'
+ perf_database_file = machine + '_results.h5'
rename_archive = True
store_full_input = False
update_perf_log_repo = True
@@ -100,7 +97,7 @@ if args.automated == True:
pull_3_repos = True
recompile = True
if machine == 'summit':
- compiler = 'pgi'
+ compiler = 'gnu'
architecture = 'gpu'
# List of tests to perform
@@ -124,12 +121,13 @@ perf_logs_repo = source_dir_base + 'perf_logs/'
compiler_name = {'intel': 'intel', 'gnu': 'gcc', 'pgi':'pgi'}
module_Cname = {'cpu': 'haswell', 'knl': 'knl,quad,cache', 'gpu':''}
csv_file = {'cori':'cori_knl.csv', 'summit':'summit.csv'}
-cwd = os.getcwd() + '/'
+# cwd = os.getcwd() + '/'
+cwd = warpx_dir + 'Tools/performance_tests/'
+print('cwd = ' + cwd)
bin_dir = cwd + 'Bin/'
bin_name = executable_name(compiler, architecture)
log_dir = cwd
-perf_database_file = cwd + perf_database_file
day = time.strftime('%d')
month = time.strftime('%m')
year = time.strftime('%Y')
@@ -250,49 +248,32 @@ for n_node in n_node_list:
df_newline['inputs_content'] = get_file_content( filename=cwd+current_run.input_file )
# Load file perf_database_file if exists, and
# append with results from this scan
- if os.path.exists(perf_database_file):
- # df_base = pd.read_hdf(perf_database_file, 'all_data', format='table')
- df_base = pd.read_hdf(perf_database_file, 'all_data')
+ if os.path.exists(perf_logs_repo + '/logs_hdf5/' + perf_database_file):
+ df_base = pd.read_hdf(perf_logs_repo + '/logs_hdf5/' + perf_database_file, 'all_data')
updated_df = df_base.append(df_newline, ignore_index=True)
else:
updated_df = df_newline
# Write dataframe to file perf_database_file
# (overwrite if file exists)
- updated_df.to_hdf(perf_database_file, key='all_data', mode='w')
+ updated_df.to_hdf(perf_logs_repo + '/logs_hdf5/' + perf_database_file, key='all_data', mode='w', format='table')
# Extract sub-set of pandas data frame, write it to
# csv file and copy this file to perf_logs repo
# -------------------------------------------------
-if write_csv:
- # Extract small data from data frame and write them to
- # First, generate csv files
- df = pd.read_hdf( perf_database_file )
- # One large file
- df.loc[:,'step_time'] = pd.Series(df['time_running']/df['n_steps'], index=df.index)
- # Make smaller dataframe with only data to be written to csv file
- df_small = df.copy()
- df_small.loc[ df_small['input_file']=='automated_test_6_output_2ppc', 'step_time'] = \
- df_small[ df_small['input_file']=='automated_test_6_output_2ppc' ]['time_WritePlotFile']
- df_small = df_small.loc[:, ['date', 'input_file', 'git_hashes', 'n_node', 'n_mpi_per_node', 'n_omp', 'rep', 'start_date', 'time_initialization', 'step_time'] ]
- # Write to csv
- df_small.to_csv( csv_file[machine] )
- # Errors may occur depending on the version of pandas. I had errors with v0.21.0 solved with 0.23.0
- # Second, move files to perf_logs repo
- if update_perf_log_repo:
- # get perf_logs repo
- git_repo = git.Repo( perf_logs_repo )
- if push_on_perf_log_repo:
- git_repo.git.stash('save')
- git_repo.git.pull()
- # move csv file to perf_logs repon and commit the new version
- shutil.move( csv_file[machine], perf_logs_repo + '/logs_csv/' + csv_file[machine] )
- os.chdir( perf_logs_repo )
- sys.path.append('./')
- import generate_index_html
- git_repo.git.add('./index.html')
- git_repo.git.add('./logs_csv/' + csv_file[machine])
- index = git_repo.index
- index.commit("automated tests")
+if args.mode=='read' and update_perf_log_repo:
+ # get perf_logs repo
+ git_repo = git.Repo( perf_logs_repo )
+ if push_on_perf_log_repo:
+ git_repo.git.stash('save')
+ git_repo.git.pull()
+ os.chdir( perf_logs_repo )
+ sys.path.append('./')
+ import generate_index_html
+ git_repo.git.add('./index.html')
+ git_repo.git.add('./logs_csv/' + csv_file[machine])
+ git_repo.git.add('./logs_hdf5/' + perf_database_file)
+ index = git_repo.index
+ index.commit("automated tests")
# Rename all result directories for archiving purposes:
# include date in the name, and a counter to avoid over-writing
diff --git a/Tools/performance_tests/summit.py b/Tools/performance_tests/summit.py
index 33b9e0981..6bd3e80a7 100644
--- a/Tools/performance_tests/summit.py
+++ b/Tools/performance_tests/summit.py
@@ -5,11 +5,11 @@ import os, copy
from functions_perftest import test_element
def executable_name(compiler,architecture):
- return 'perf_tests3d.' + compiler + '.TPROF.MPI.ACC.CUDA.ex'
+ return 'perf_tests3d.' + compiler + '.TPROF.MPI.CUDA.ex'
def get_config_command(compiler, architecture):
config_command = ''
- config_command += 'module load pgi;'
+ config_command += 'module load gcc;'
config_command += 'module load cuda;'
return config_command
@@ -66,7 +66,7 @@ def get_batch_string(test_list, job_time_min, Cname, n_node):
batch_string += '#BSUB -nnodes ' + str(n_node) + '\n'
batch_string += '#BSUB -J ' + test_list[0].input_file + '\n'
batch_string += '#BSUB -e error.txt\n'
- batch_string += 'module load pgi\n'
+ batch_string += 'module load gcc\n'
batch_string += 'module load cuda\n'
return batch_string
@@ -113,14 +113,14 @@ def get_test_list(n_repeat):
test_list_unq.append( test_element(input_file='automated_test_4_labdiags_2ppc',
n_mpi_per_node=6,
n_omp=1,
- n_cell=[384, 512, 512],
+ n_cell=[384, 256, 512],
max_grid_size=256,
blocking_factor=128,
n_step=50) )
test_list_unq.append( test_element(input_file='automated_test_5_loadimbalance',
n_mpi_per_node=6,
n_omp=1,
- n_cell=[64, 128, 192],
+ n_cell=[64, 64, 192],
max_grid_size=64,
blocking_factor=32,
n_step=10) )
diff --git a/Examples/Tests/Larmor/plot_particle_path.py b/Tools/plot_particle_path.py
index ef52b4f4b..ef52b4f4b 100644
--- a/Examples/Tests/Larmor/plot_particle_path.py
+++ b/Tools/plot_particle_path.py
diff --git a/Tools/script_profiling_summit.sh b/Tools/script_profiling_summit.sh
new file mode 100755
index 000000000..cd6b0eadd
--- /dev/null
+++ b/Tools/script_profiling_summit.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+#BSUB -P GEN109
+#BSUB -W 0:10
+#BSUB -nnodes 1
+#BSUB -J WarpX
+#BSUB -o WarpXo.%J
+#BSUB -e WarpXe.%J
+
+module load pgi
+module load cuda/9.1.85
+module list
+set -x
+
+omp=1
+export OMP_NUM_THREADS=${omp}
+#EXE="../main3d.pgi.DEBUG.TPROF.MPI.ACC.CUDA.ex"
+EXE="../main3d.pgi.TPROF.MPI.ACC.CUDA.ex"
+#JSRUN="jsrun -n 4 -a 1 -g 1 -c 1 --bind=packed:${omp} "
+#JSRUN="jsrun -n 1 -a 4 -g 4 -c 4 --bind=packed:${omp} "
+JSRUN="jsrun -n 1 -a 1 -g 1 -c 1 --bind=packed:${omp} "
+
+rundir="${LSB_JOBNAME}-${LSB_JOBID}"
+mkdir $rundir
+cp $0 $rundir
+cp inputs $rundir
+cd $rundir
+
+# 1. Run normally
+${JSRUN} --smpiargs="-gpu" ${EXE} inputs
+
+# 2. Run under cuda-memcheck
+# ${JSRUN} --smpiargs="-gpu" cuda-memcheck ${EXE} inputs &> memcheck.txt
+
+# 3. Run under nvprof and direct all stdout and stderr to nvprof.txt
+#${JSRUN} --smpiargs="-gpu" nvprof --profile-child-processes ${EXE} inputs &> nvprof.txt
+
+# 4. Run under nvprof and store performance data in a nvvp file
+# Can be converted to text using nvprof -i nvprof-timeline-%p.nvvp
+#${JSRUN} --smpiargs="-gpu" nvprof --profile-child-processes -o nvprof-timeline-%p.nvvp ${EXE} inputs
+
+# COLLECT PERFORMANCE METRICS - THIS IS MUCH SLOWER. Set nsteps=2 in the inputs files
+# 5. Run under nvprof and collect metrics for a subset of kernels
+#${JSRUN} --smpiargs="-gpu" nvprof --profile-child-processes --kernels '(deposit_current|gather_\w+_field|push_\w+_boris)' --analysis-metrics -o nvprof-metrics-kernel-%p.nvvp ${EXE} inputs
+
+# 6. Run under nvprof and collect metrics for all kernels -- much slower!
+#${JSRUN} --smpiargs="-gpu" nvprof --profile-child-processes --analysis-metrics -o nvprof-metrics-%p.nvvp ${EXE} inputs
+
+cp ../WarpX*.${LSB_JOBID} .
diff --git a/run_test.sh b/run_test.sh
index bd04cf5f0..b6d4a644b 100755
--- a/run_test.sh
+++ b/run_test.sh
@@ -41,7 +41,7 @@ else
fi
# Clone the AMReX regression test utility
-git clone https://github.com/RemiLehe/regression_testing.git
+git clone https://github.com/ECP-WarpX/regression_testing.git
# Prepare regression tests
mkdir -p rt-WarpX/WarpX-benchmarks