aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Davide Terzani <titoiride@gmail.com> 2023-02-21 09:05:16 -0800
committerGravatar GitHub <noreply@github.com> 2023-02-21 09:05:16 -0800
commit8f31cea2a47749ca697b64a93837842f990312ed (patch)
tree155ec4b9d31063b407797203c2fa7202117ecd4c
parent7eae30870646a2efbdf9164d46c75e540251e5f0 (diff)
downloadWarpX-8f31cea2a47749ca697b64a93837842f990312ed.tar.gz
WarpX-8f31cea2a47749ca697b64a93837842f990312ed.tar.zst
WarpX-8f31cea2a47749ca697b64a93837842f990312ed.zip
Renamed "particle_vel" to "particle_mom" (#3672)
* Renamed particle_vel to particle_mom * Changed vel to u * Updated gitignore with vscode-specific folder * Updated docs for single particle * Revert "Updated gitignore with vscode-specific folder" This reverts commit cb44ef8d66c123daa93d6a13d5a1d88416e866bb. * Fixed typo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed other typo * Add species indication in warning --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
-rw-r--r--Docs/source/usage/parameters.rst8
-rwxr-xr-xExamples/Tests/AcceleratorLattice/analysis.py2
-rw-r--r--Examples/Tests/AcceleratorLattice/inputs_quad_3d2
-rw-r--r--Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d2
-rw-r--r--Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d2
-rw-r--r--Examples/Tests/boundaries/inputs_3d18
-rw-r--r--Examples/Tests/ion_stopping/inputs_3d24
-rw-r--r--Examples/Tests/larmor/inputs_2d_mr4
-rw-r--r--Examples/Tests/particle_pusher/inputs_3d2
-rw-r--r--Examples/Tests/particles_in_pml/inputs_2d4
-rw-r--r--Examples/Tests/particles_in_pml/inputs_3d4
-rw-r--r--Examples/Tests/particles_in_pml/inputs_mr_2d4
-rw-r--r--Examples/Tests/particles_in_pml/inputs_mr_3d4
-rw-r--r--Examples/Tests/pec/inputs_particle_PEC_3d4
-rwxr-xr-xExamples/Tests/photon_pusher/analysis_photon_pusher.py2
-rw-r--r--Examples/Tests/photon_pusher/inputs_3d32
-rwxr-xr-xExamples/Tests/plasma_lens/analysis.py6
-rw-r--r--Examples/Tests/plasma_lens/inputs_3d6
-rw-r--r--Examples/Tests/plasma_lens/inputs_boosted_3d6
-rw-r--r--Examples/Tests/plasma_lens/inputs_lattice_3d6
-rw-r--r--Examples/Tests/plasma_lens/inputs_short_3d6
-rw-r--r--Examples/Tests/pml/inputs_rz2
-rwxr-xr-xExamples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py2
-rw-r--r--Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d10
-rw-r--r--Examples/Tests/repelling_particles/inputs_2d4
-rw-r--r--Examples/Tests/single_particle/inputs_2d2
-rw-r--r--Examples/Tests/vay_deposition/inputs_2d4
-rw-r--r--Examples/Tests/vay_deposition/inputs_3d4
-rw-r--r--Python/pywarpx/picmi.py6
-rw-r--r--Source/Initialization/PlasmaInjector.H8
-rw-r--r--Source/Initialization/PlasmaInjector.cpp22
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp24
-rw-r--r--Source/WarpX.cpp28
33 files changed, 146 insertions, 118 deletions
diff --git a/Docs/source/usage/parameters.rst b/Docs/source/usage/parameters.rst
index dc58bc071..84990e698 100644
--- a/Docs/source/usage/parameters.rst
+++ b/Docs/source/usage/parameters.rst
@@ -654,7 +654,7 @@ Particle initialization
* ``SingleParticle``: Inject a single macroparticle.
This requires the additional parameters:
``<species_name>.single_particle_pos`` (`3 doubles`, particle 3D position [meter])
- ``<species_name>.single_particle_vel`` (`3 doubles`, particle 3D normalized momentum, i.e. :math:`\gamma \beta`)
+ ``<species_name>.single_particle_u`` (`3 doubles`, particle 3D normalized momentum, i.e. :math:`\gamma \beta`)
``<species_name>.single_particle_weight`` ( `double`, macroparticle weight, i.e. number of physical particles it represents)
* ``MultipleParticles``: Inject multiple macroparticles.
@@ -662,9 +662,9 @@ Particle initialization
``<species_name>.multiple_particles_pos_x`` (list of `doubles`, X positions of the particles [meter])
``<species_name>.multiple_particles_pos_y`` (list of `doubles`, Y positions of the particles [meter])
``<species_name>.multiple_particles_pos_z`` (list of `doubles`, Z positions of the particles [meter])
- ``<species_name>.multiple_particles_vel_x`` (list of `doubles`, X normalized momenta of the particles, i.e. :math:`\gamma \beta_x`)
- ``<species_name>.multiple_particles_vel_y`` (list of `doubles`, Y normalized momenta of the particles, i.e. :math:`\gamma \beta_y`)
- ``<species_name>.multiple_particles_vel_z`` (list of `doubles`, Z normalized momenta of the particles, i.e. :math:`\gamma \beta_z`)
+ ``<species_name>.multiple_particles_ux`` (list of `doubles`, X normalized momenta of the particles, i.e. :math:`\gamma \beta_x`)
+ ``<species_name>.multiple_particles_uy`` (list of `doubles`, Y normalized momenta of the particles, i.e. :math:`\gamma \beta_y`)
+ ``<species_name>.multiple_particles_uz`` (list of `doubles`, Z normalized momenta of the particles, i.e. :math:`\gamma \beta_z`)
``<species_name>.multiple_particles_weight`` (list of `doubles`, macroparticle weights, i.e. number of physical particles each represents)
* ``gaussian_beam``: Inject particle beam with gaussian distribution in
diff --git a/Examples/Tests/AcceleratorLattice/analysis.py b/Examples/Tests/AcceleratorLattice/analysis.py
index d2fd7f6ff..35da52443 100755
--- a/Examples/Tests/AcceleratorLattice/analysis.py
+++ b/Examples/Tests/AcceleratorLattice/analysis.py
@@ -70,7 +70,7 @@ read_lattice('lattice', z_location)
# Fetch the initial position of the particle
x0 = [float(x) for x in ds.parameters.get('electron.single_particle_pos').split()]
-ux0 = [float(x)*c for x in ds.parameters.get('electron.single_particle_vel').split()]
+ux0 = [float(x)*c for x in ds.parameters.get('electron.single_particle_u').split()]
xx = x0[0]
zz = x0[2]
diff --git a/Examples/Tests/AcceleratorLattice/inputs_quad_3d b/Examples/Tests/AcceleratorLattice/inputs_quad_3d
index 0a3b433f6..613ba7c9d 100644
--- a/Examples/Tests/AcceleratorLattice/inputs_quad_3d
+++ b/Examples/Tests/AcceleratorLattice/inputs_quad_3d
@@ -20,7 +20,7 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "SingleParticle"
electron.single_particle_pos = 0.05 0.0 0.0
-electron.single_particle_vel = 0.0 0.0 0.1 # gamma*beta
+electron.single_particle_u = 0.0 0.0 0.1 # gamma*beta
electron.single_particle_weight = 1.0
lattice.elements = lattice1 lattice2
diff --git a/Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d b/Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d
index ac1ea3b92..668ec73d2 100644
--- a/Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d
+++ b/Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d
@@ -20,7 +20,7 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "SingleParticle"
electron.single_particle_pos = 0.05 0.0 0.0
-electron.single_particle_vel = 0.0 0.0 2.0 # gamma*beta
+electron.single_particle_u = 0.0 0.0 2.0 # gamma*beta
electron.single_particle_weight = 1.0
lattice.elements = drift1 quad1 drift2 quad2
diff --git a/Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d b/Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d
index 98d3d40ad..e5ec0a595 100644
--- a/Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d
+++ b/Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d
@@ -24,7 +24,7 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "SingleParticle"
electron.single_particle_pos = 0.05 0.0 0.0
-electron.single_particle_vel = 0.0 0.0 0.1 # gamma*beta
+electron.single_particle_u = 0.0 0.0 0.1 # gamma*beta
electron.single_particle_weight = 1.0
lattice.elements = drift1 quad1 drift2 quad2
diff --git a/Examples/Tests/boundaries/inputs_3d b/Examples/Tests/boundaries/inputs_3d
index 71399fa5e..e3223af25 100644
--- a/Examples/Tests/boundaries/inputs_3d
+++ b/Examples/Tests/boundaries/inputs_3d
@@ -37,9 +37,9 @@ reflecting_particles.injection_style = "MultipleParticles"
reflecting_particles.multiple_particles_pos_x = -0.9 +0.91
reflecting_particles.multiple_particles_pos_y = 0. 0.
reflecting_particles.multiple_particles_pos_z = 0. 0.
-reflecting_particles.multiple_particles_vel_x = -0.9 +0.91
-reflecting_particles.multiple_particles_vel_y = 0. 0.
-reflecting_particles.multiple_particles_vel_z = 0. 0.
+reflecting_particles.multiple_particles_ux = -0.9 +0.91
+reflecting_particles.multiple_particles_uy = 0. 0.
+reflecting_particles.multiple_particles_uz = 0. 0.
reflecting_particles.multiple_particles_weight = 1. 1.
absorbing_particles.charge = 0.
@@ -48,9 +48,9 @@ absorbing_particles.injection_style = "MultipleParticles"
absorbing_particles.multiple_particles_pos_x = 0. 0. 0.
absorbing_particles.multiple_particles_pos_y = -0.92 +0.93 0.
absorbing_particles.multiple_particles_pos_z = 0. 0. 0.
-absorbing_particles.multiple_particles_vel_x = 0. 0. 0.
-absorbing_particles.multiple_particles_vel_y = -0.92 +0.93 0.
-absorbing_particles.multiple_particles_vel_z = 0. 0. 0.
+absorbing_particles.multiple_particles_ux = 0. 0. 0.
+absorbing_particles.multiple_particles_uy = -0.92 +0.93 0.
+absorbing_particles.multiple_particles_uz = 0. 0. 0.
absorbing_particles.multiple_particles_weight = 1. 1. 1.
periodic_particles.charge = 0.
@@ -59,9 +59,9 @@ periodic_particles.injection_style = "MultipleParticles"
periodic_particles.multiple_particles_pos_x = 0. 0.
periodic_particles.multiple_particles_pos_y = 0. 0.
periodic_particles.multiple_particles_pos_z = -0.94 +0.95
-periodic_particles.multiple_particles_vel_x = 0. 0.
-periodic_particles.multiple_particles_vel_y = 0. 0.
-periodic_particles.multiple_particles_vel_z = -0.94 +0.95
+periodic_particles.multiple_particles_ux = 0. 0.
+periodic_particles.multiple_particles_uy = 0. 0.
+periodic_particles.multiple_particles_uz = -0.94 +0.95
periodic_particles.multiple_particles_weight = 1. 1.
# Diagnostics
diff --git a/Examples/Tests/ion_stopping/inputs_3d b/Examples/Tests/ion_stopping/inputs_3d
index 9352946b8..291e1ca0a 100644
--- a/Examples/Tests/ion_stopping/inputs_3d
+++ b/Examples/Tests/ion_stopping/inputs_3d
@@ -22,9 +22,9 @@ ions1.injection_style = "MultipleParticles"
ions1.multiple_particles_pos_x = 0. 0. 0. 0.
ions1.multiple_particles_pos_y = 0. 0. 0. 0.
ions1.multiple_particles_pos_z = 0. 0. 0. 0.
-ions1.multiple_particles_vel_x = max_ion_velocity12 0. 0. max_ion_velocity12/2.
-ions1.multiple_particles_vel_y = 0. max_ion_velocity12 0. max_ion_velocity12/2.
-ions1.multiple_particles_vel_z = 0. 0. -max_ion_velocity12 -max_ion_velocity12/2.
+ions1.multiple_particles_ux = max_ion_velocity12 0. 0. max_ion_velocity12/2.
+ions1.multiple_particles_uy = 0. max_ion_velocity12 0. max_ion_velocity12/2.
+ions1.multiple_particles_uz = 0. 0. -max_ion_velocity12 -max_ion_velocity12/2.
ions1.multiple_particles_weight = 1. 1. 1. 1.
ions1.do_not_deposit = 1
@@ -33,9 +33,9 @@ ions2.injection_style = "MultipleParticles"
ions2.multiple_particles_pos_x = -0.1 +0.1 -0.1 +0.1
ions2.multiple_particles_pos_y = -0.1 -0.1 +0.1 +0.1
ions2.multiple_particles_pos_z = 0. 0. 0. 0.
-ions2.multiple_particles_vel_x = max_ion_velocity12 max_ion_velocity12 max_ion_velocity12 max_ion_velocity12
-ions2.multiple_particles_vel_y = 0. 0. 0. 0.
-ions2.multiple_particles_vel_z = 0. 0. 0. 0.
+ions2.multiple_particles_ux = max_ion_velocity12 max_ion_velocity12 max_ion_velocity12 max_ion_velocity12
+ions2.multiple_particles_uy = 0. 0. 0. 0.
+ions2.multiple_particles_uz = 0. 0. 0. 0.
ions2.multiple_particles_weight = 1. 1. 1. 1.
ions2.do_not_deposit = 1
@@ -45,9 +45,9 @@ ions3.injection_style = "MultipleParticles"
ions3.multiple_particles_pos_x = 0. 0. 0. 0.
ions3.multiple_particles_pos_y = 0. 0. 0. 0.
ions3.multiple_particles_pos_z = 0. 0. 0. 0.
-ions3.multiple_particles_vel_x = max_ion_velocity34 0. 0. max_ion_velocity34/2.
-ions3.multiple_particles_vel_y = 0. max_ion_velocity34 0. max_ion_velocity34/2.
-ions3.multiple_particles_vel_z = 0. 0. -max_ion_velocity34 -max_ion_velocity34/2.
+ions3.multiple_particles_ux = max_ion_velocity34 0. 0. max_ion_velocity34/2.
+ions3.multiple_particles_uy = 0. max_ion_velocity34 0. max_ion_velocity34/2.
+ions3.multiple_particles_uz = 0. 0. -max_ion_velocity34 -max_ion_velocity34/2.
ions3.multiple_particles_weight = 1. 1. 1. 1.
ions3.do_not_deposit = 1
@@ -57,9 +57,9 @@ ions4.injection_style = "MultipleParticles"
ions4.multiple_particles_pos_x = -0.1 +0.1 -0.1 +0.1
ions4.multiple_particles_pos_y = -0.1 -0.1 +0.1 +0.1
ions4.multiple_particles_pos_z = 0. 0. 0. 0.
-ions4.multiple_particles_vel_x = max_ion_velocity34 max_ion_velocity34 max_ion_velocity34 max_ion_velocity34
-ions4.multiple_particles_vel_y = 0. 0. 0. 0.
-ions4.multiple_particles_vel_z = 0. 0. 0. 0.
+ions4.multiple_particles_ux = max_ion_velocity34 max_ion_velocity34 max_ion_velocity34 max_ion_velocity34
+ions4.multiple_particles_uy = 0. 0. 0. 0.
+ions4.multiple_particles_uz = 0. 0. 0. 0.
ions4.multiple_particles_weight = 1. 1. 1. 1.
ions4.do_not_deposit = 1
diff --git a/Examples/Tests/larmor/inputs_2d_mr b/Examples/Tests/larmor/inputs_2d_mr
index baf10e085..5d7af3d67 100644
--- a/Examples/Tests/larmor/inputs_2d_mr
+++ b/Examples/Tests/larmor/inputs_2d_mr
@@ -48,13 +48,13 @@ 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
+electron.single_particle_u = -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
+positron.single_particle_u = 0.45825756949558416 0.0 0.0 # gamma*beta
electron.single_particle_weight = 1.0e12
positron.single_particle_weight = 1.0e12
diff --git a/Examples/Tests/particle_pusher/inputs_3d b/Examples/Tests/particle_pusher/inputs_3d
index 8f336fe66..31ab6800d 100644
--- a/Examples/Tests/particle_pusher/inputs_3d
+++ b/Examples/Tests/particle_pusher/inputs_3d
@@ -33,7 +33,7 @@ positron.charge = 1.0
positron.mass = 1.0
positron.injection_style = "SingleParticle"
positron.single_particle_pos = 0.0 0.0 0.0
-positron.single_particle_vel = 0.0 19.974984355438178 0.0
+positron.single_particle_u = 0.0 19.974984355438178 0.0
positron.single_particle_weight = 0.0
# External fields
diff --git a/Examples/Tests/particles_in_pml/inputs_2d b/Examples/Tests/particles_in_pml/inputs_2d
index 14fb4f423..7cddc12b4 100644
--- a/Examples/Tests/particles_in_pml/inputs_2d
+++ b/Examples/Tests/particles_in_pml/inputs_2d
@@ -37,14 +37,14 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "singleparticle"
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 2. 0. 0.
+electron.single_particle_u = 2. 0. 0.
electron.single_particle_weight = 1.
proton.charge = q_e
proton.mass = m_p # Very heavy ; should not move
proton.injection_style = "singleparticle"
proton.single_particle_pos = 0. 0. 0.
-proton.single_particle_vel = -2. 0. 0.
+proton.single_particle_u = -2. 0. 0.
proton.single_particle_weight = 1.
# Order of particle shape factors
diff --git a/Examples/Tests/particles_in_pml/inputs_3d b/Examples/Tests/particles_in_pml/inputs_3d
index 6b92ad630..ad9e61c29 100644
--- a/Examples/Tests/particles_in_pml/inputs_3d
+++ b/Examples/Tests/particles_in_pml/inputs_3d
@@ -37,14 +37,14 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "singleparticle"
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 2. 0. 0.
+electron.single_particle_u = 2. 0. 0.
electron.single_particle_weight = 1.
proton.charge = q_e
proton.mass = m_p # Very heavy ; should not move
proton.injection_style = "singleparticle"
proton.single_particle_pos = 0. 0. 0.
-proton.single_particle_vel = -2. 0. 0.
+proton.single_particle_u = -2. 0. 0.
proton.single_particle_weight = 1.
# Order of particle shape factors
diff --git a/Examples/Tests/particles_in_pml/inputs_mr_2d b/Examples/Tests/particles_in_pml/inputs_mr_2d
index d56a3dc95..a6db42a38 100644
--- a/Examples/Tests/particles_in_pml/inputs_mr_2d
+++ b/Examples/Tests/particles_in_pml/inputs_mr_2d
@@ -39,14 +39,14 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "singleparticle"
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 2. 0. 0.
+electron.single_particle_u = 2. 0. 0.
electron.single_particle_weight = 1.
proton.charge = q_e
proton.mass = m_p # Very heavy ; should not move
proton.injection_style = "singleparticle"
proton.single_particle_pos = 0. 0. 0.
-proton.single_particle_vel = -2. 0. 0.
+proton.single_particle_u = -2. 0. 0.
proton.single_particle_weight = 1.
# Order of particle shape factors
diff --git a/Examples/Tests/particles_in_pml/inputs_mr_3d b/Examples/Tests/particles_in_pml/inputs_mr_3d
index b4b8ceb2d..ef2c4418c 100644
--- a/Examples/Tests/particles_in_pml/inputs_mr_3d
+++ b/Examples/Tests/particles_in_pml/inputs_mr_3d
@@ -39,14 +39,14 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "singleparticle"
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 2. 0. 0.
+electron.single_particle_u = 2. 0. 0.
electron.single_particle_weight = 1.
proton.charge = q_e
proton.mass = m_p # Very heavy ; should not move
proton.injection_style = "singleparticle"
proton.single_particle_pos = 0. 0. 0.
-proton.single_particle_vel = -2. 0. 0.
+proton.single_particle_u = -2. 0. 0.
proton.single_particle_weight = 1.
# Order of particle shape factors
diff --git a/Examples/Tests/pec/inputs_particle_PEC_3d b/Examples/Tests/pec/inputs_particle_PEC_3d
index 278eb4d47..ded8582b0 100644
--- a/Examples/Tests/pec/inputs_particle_PEC_3d
+++ b/Examples/Tests/pec/inputs_particle_PEC_3d
@@ -37,14 +37,14 @@ electron.charge = -q_e
electron.mass = m_p
electron.injection_style = "singleparticle"
electron.single_particle_pos = 31.998e-6 0. 0.
-electron.single_particle_vel = 0. 0. 0.
+electron.single_particle_u = 0. 0. 0.
electron.single_particle_weight = 1.0
proton.charge = q_e
proton.mass = m_p # Very heavy ; should not move
proton.injection_style = "singleparticle"
proton.single_particle_pos = 31.998e-6 0.e-6 0.
-proton.single_particle_vel = 0. -2. 0.
+proton.single_particle_u = 0. -2. 0.
proton.single_particle_weight = 1.0
# Particle shape factor in each direction
diff --git a/Examples/Tests/photon_pusher/analysis_photon_pusher.py b/Examples/Tests/photon_pusher/analysis_photon_pusher.py
index 92d1e95f7..7518bd5ad 100755
--- a/Examples/Tests/photon_pusher/analysis_photon_pusher.py
+++ b/Examples/Tests/photon_pusher/analysis_photon_pusher.py
@@ -149,7 +149,7 @@ def generate():
f.write('{}.injection_style = "SingleParticle"\n'.format(name))
f.write("{}.single_particle_pos = {} {} {}\n".
format(name, init_pos[0], init_pos[1], init_pos[2]))
- f.write("{}.single_particle_vel = {} {} {}\n".
+ f.write("{}.single_particle_u = {} {} {}\n".
format(name, velx, vely, velz))
f.write("{}.single_particle_weight = 1.0\n".format(name))
f.write("\n".format(name))
diff --git a/Examples/Tests/photon_pusher/inputs_3d b/Examples/Tests/photon_pusher/inputs_3d
index a9ff8ac7b..e2c75981e 100644
--- a/Examples/Tests/photon_pusher/inputs_3d
+++ b/Examples/Tests/photon_pusher/inputs_3d
@@ -28,112 +28,112 @@ p_xp_1.charge = -q_e
p_xp_1.mass = m_e
p_xp_1.injection_style = "SingleParticle"
p_xp_1.single_particle_pos = 0.0 0.0 0.0
-p_xp_1.single_particle_vel = 1.0 0.0 0.0
+p_xp_1.single_particle_u = 1.0 0.0 0.0
p_xp_1.single_particle_weight = 1.0
p_xn_1.charge = -q_e
p_xn_1.mass = m_e
p_xn_1.injection_style = "SingleParticle"
p_xn_1.single_particle_pos = 0.0 0.0 0.0
-p_xn_1.single_particle_vel = -1.0 0.0 0.0
+p_xn_1.single_particle_u = -1.0 0.0 0.0
p_xn_1.single_particle_weight = 1.0
p_yp_1.charge = -q_e
p_yp_1.mass = m_e
p_yp_1.injection_style = "SingleParticle"
p_yp_1.single_particle_pos = 0.0 0.0 0.0
-p_yp_1.single_particle_vel = 0.0 1.0 0.0
+p_yp_1.single_particle_u = 0.0 1.0 0.0
p_yp_1.single_particle_weight = 1.0
p_yn_1.charge = -q_e
p_yn_1.mass = m_e
p_yn_1.injection_style = "SingleParticle"
p_yn_1.single_particle_pos = 0.0 0.0 0.0
-p_yn_1.single_particle_vel = 0.0 -1.0 0.0
+p_yn_1.single_particle_u = 0.0 -1.0 0.0
p_yn_1.single_particle_weight = 1.0
p_zp_1.charge = -q_e
p_zp_1.mass = m_e
p_zp_1.injection_style = "SingleParticle"
p_zp_1.single_particle_pos = 0.0 0.0 0.0
-p_zp_1.single_particle_vel = 0.0 0.0 1.0
+p_zp_1.single_particle_u = 0.0 0.0 1.0
p_zp_1.single_particle_weight = 1.0
p_zn_1.charge = -q_e
p_zn_1.mass = m_e
p_zn_1.injection_style = "SingleParticle"
p_zn_1.single_particle_pos = 0.0 0.0 0.0
-p_zn_1.single_particle_vel = 0.0 0.0 -1.0
+p_zn_1.single_particle_u = 0.0 0.0 -1.0
p_zn_1.single_particle_weight = 1.0
p_dp_1.charge = -q_e
p_dp_1.mass = m_e
p_dp_1.injection_style = "SingleParticle"
p_dp_1.single_particle_pos = 0.0 0.0 0.0
-p_dp_1.single_particle_vel = 1.0 1.0 1.0
+p_dp_1.single_particle_u = 1.0 1.0 1.0
p_dp_1.single_particle_weight = 1.0
p_dn_1.charge = -q_e
p_dn_1.mass = m_e
p_dn_1.injection_style = "SingleParticle"
p_dn_1.single_particle_pos = 0.0 0.0 0.0
-p_dn_1.single_particle_vel = -1.0 -1.0 -1.0
+p_dn_1.single_particle_u = -1.0 -1.0 -1.0
p_dn_1.single_particle_weight = 1.0
p_xp_10.charge = -q_e
p_xp_10.mass = m_e
p_xp_10.injection_style = "SingleParticle"
p_xp_10.single_particle_pos = 0.0 0.0 0.0
-p_xp_10.single_particle_vel = 10.0 0.0 0.0
+p_xp_10.single_particle_u = 10.0 0.0 0.0
p_xp_10.single_particle_weight = 1.0
p_xn_10.charge = -q_e
p_xn_10.mass = m_e
p_xn_10.injection_style = "SingleParticle"
p_xn_10.single_particle_pos = 0.0 0.0 0.0
-p_xn_10.single_particle_vel = -10.0 0.0 0.0
+p_xn_10.single_particle_u = -10.0 0.0 0.0
p_xn_10.single_particle_weight = 1.0
p_yp_10.charge = -q_e
p_yp_10.mass = m_e
p_yp_10.injection_style = "SingleParticle"
p_yp_10.single_particle_pos = 0.0 0.0 0.0
-p_yp_10.single_particle_vel = 0.0 10.0 0.0
+p_yp_10.single_particle_u = 0.0 10.0 0.0
p_yp_10.single_particle_weight = 1.0
p_yn_10.charge = -q_e
p_yn_10.mass = m_e
p_yn_10.injection_style = "SingleParticle"
p_yn_10.single_particle_pos = 0.0 0.0 0.0
-p_yn_10.single_particle_vel = 0.0 -10.0 0.0
+p_yn_10.single_particle_u = 0.0 -10.0 0.0
p_yn_10.single_particle_weight = 1.0
p_zp_10.charge = -q_e
p_zp_10.mass = m_e
p_zp_10.injection_style = "SingleParticle"
p_zp_10.single_particle_pos = 0.0 0.0 0.0
-p_zp_10.single_particle_vel = 0.0 0.0 10.0
+p_zp_10.single_particle_u = 0.0 0.0 10.0
p_zp_10.single_particle_weight = 1.0
p_zn_10.charge = -q_e
p_zn_10.mass = m_e
p_zn_10.injection_style = "SingleParticle"
p_zn_10.single_particle_pos = 0.0 0.0 0.0
-p_zn_10.single_particle_vel = 0.0 0.0 -10.0
+p_zn_10.single_particle_u = 0.0 0.0 -10.0
p_zn_10.single_particle_weight = 1.0
p_dp_10.charge = -q_e
p_dp_10.mass = m_e
p_dp_10.injection_style = "SingleParticle"
p_dp_10.single_particle_pos = 0.0 0.0 0.0
-p_dp_10.single_particle_vel = 10.0 10.0 10.0
+p_dp_10.single_particle_u = 10.0 10.0 10.0
p_dp_10.single_particle_weight = 1.0
p_dn_10.charge = -q_e
p_dn_10.mass = m_e
p_dn_10.injection_style = "SingleParticle"
p_dn_10.single_particle_pos = 0.0 0.0 0.0
-p_dn_10.single_particle_vel = -10.0 -10.0 -10.0
+p_dn_10.single_particle_u = -10.0 -10.0 -10.0
p_dn_10.single_particle_weight = 1.0
# Diagnostics
diff --git a/Examples/Tests/plasma_lens/analysis.py b/Examples/Tests/plasma_lens/analysis.py
index 80fdc4181..34478c248 100755
--- a/Examples/Tests/plasma_lens/analysis.py
+++ b/Examples/Tests/plasma_lens/analysis.py
@@ -95,9 +95,9 @@ elif 'lattice.elements' in ds.parameters:
x0 = float(ds.parameters.get('electrons.multiple_particles_pos_x').split()[0])
y0 = float(ds.parameters.get('electrons.multiple_particles_pos_y').split()[1])
z0 = float(ds.parameters.get('electrons.multiple_particles_pos_z').split()[0])
-ux0 = float(ds.parameters.get('electrons.multiple_particles_vel_x').split()[0])*c
-uy0 = float(ds.parameters.get('electrons.multiple_particles_vel_y').split()[1])*c
-uz0 = eval(ds.parameters.get('electrons.multiple_particles_vel_z').split()[0])*c
+ux0 = float(ds.parameters.get('electrons.multiple_particles_ux').split()[0])*c
+uy0 = float(ds.parameters.get('electrons.multiple_particles_uy').split()[1])*c
+uz0 = eval(ds.parameters.get('electrons.multiple_particles_uz').split()[0])*c
tt = 0.
xx = x0
diff --git a/Examples/Tests/plasma_lens/inputs_3d b/Examples/Tests/plasma_lens/inputs_3d
index 48f2263f0..7763013ad 100644
--- a/Examples/Tests/plasma_lens/inputs_3d
+++ b/Examples/Tests/plasma_lens/inputs_3d
@@ -31,9 +31,9 @@ electrons.injection_style = "MultipleParticles"
electrons.multiple_particles_pos_x = 0.05 0.
electrons.multiple_particles_pos_y = 0. 0.04
electrons.multiple_particles_pos_z = 0.05 0.05
-electrons.multiple_particles_vel_x = 0. 0.
-electrons.multiple_particles_vel_y = 0. 0.
-electrons.multiple_particles_vel_z = vel_z/clight vel_z/clight
+electrons.multiple_particles_ux = 0. 0.
+electrons.multiple_particles_uy = 0. 0.
+electrons.multiple_particles_uz = vel_z/clight vel_z/clight
electrons.multiple_particles_weight = 1. 1.
particles.E_ext_particle_init_style = repeated_plasma_lens
diff --git a/Examples/Tests/plasma_lens/inputs_boosted_3d b/Examples/Tests/plasma_lens/inputs_boosted_3d
index c997136d4..ecdf3b3ba 100644
--- a/Examples/Tests/plasma_lens/inputs_boosted_3d
+++ b/Examples/Tests/plasma_lens/inputs_boosted_3d
@@ -33,9 +33,9 @@ electrons.injection_style = "MultipleParticles"
electrons.multiple_particles_pos_x = 0.05 0.
electrons.multiple_particles_pos_y = 0. 0.04
electrons.multiple_particles_pos_z = 0.05 0.05
-electrons.multiple_particles_vel_x = 0. 0.
-electrons.multiple_particles_vel_y = 0. 0.
-electrons.multiple_particles_vel_z = vel_z/clight vel_z/clight
+electrons.multiple_particles_ux = 0. 0.
+electrons.multiple_particles_uy = 0. 0.
+electrons.multiple_particles_uz = vel_z/clight vel_z/clight
electrons.multiple_particles_weight = 1. 1.
particles.E_ext_particle_init_style = repeated_plasma_lens
diff --git a/Examples/Tests/plasma_lens/inputs_lattice_3d b/Examples/Tests/plasma_lens/inputs_lattice_3d
index 3473f1420..a41ca8bae 100644
--- a/Examples/Tests/plasma_lens/inputs_lattice_3d
+++ b/Examples/Tests/plasma_lens/inputs_lattice_3d
@@ -31,9 +31,9 @@ electrons.injection_style = "MultipleParticles"
electrons.multiple_particles_pos_x = 0.05 0.
electrons.multiple_particles_pos_y = 0. 0.04
electrons.multiple_particles_pos_z = 0.05 0.05
-electrons.multiple_particles_vel_x = 0. 0.
-electrons.multiple_particles_vel_y = 0. 0.
-electrons.multiple_particles_vel_z = vel_z/clight vel_z/clight
+electrons.multiple_particles_ux = 0. 0.
+electrons.multiple_particles_uy = 0. 0.
+electrons.multiple_particles_uz = vel_z/clight vel_z/clight
electrons.multiple_particles_weight = 1. 1.
lattice.elements = drift1 plasmalens1 drift2 plasmalens2 drift3 plasmalens3 drift4 plasmalens4
diff --git a/Examples/Tests/plasma_lens/inputs_short_3d b/Examples/Tests/plasma_lens/inputs_short_3d
index 4beb65ef9..8fa111df3 100644
--- a/Examples/Tests/plasma_lens/inputs_short_3d
+++ b/Examples/Tests/plasma_lens/inputs_short_3d
@@ -35,9 +35,9 @@ electrons.injection_style = "MultipleParticles"
electrons.multiple_particles_pos_x = 0.05 0.
electrons.multiple_particles_pos_y = 0. 0.04
electrons.multiple_particles_pos_z = 0.05 0.05
-electrons.multiple_particles_vel_x = 0. 0.
-electrons.multiple_particles_vel_y = 0. 0.
-electrons.multiple_particles_vel_z = vel_z/clight vel_z/clight
+electrons.multiple_particles_ux = 0. 0.
+electrons.multiple_particles_uy = 0. 0.
+electrons.multiple_particles_uz = vel_z/clight vel_z/clight
electrons.multiple_particles_weight = 1. 1.
particles.E_ext_particle_init_style = repeated_plasma_lens
diff --git a/Examples/Tests/pml/inputs_rz b/Examples/Tests/pml/inputs_rz
index b05db804a..9ca7e4894 100644
--- a/Examples/Tests/pml/inputs_rz
+++ b/Examples/Tests/pml/inputs_rz
@@ -37,7 +37,7 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "singleparticle"
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 10. 0. 0.
+electron.single_particle_u = 10. 0. 0.
electron.single_particle_weight = 1.
#################################
diff --git a/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py b/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py
index f242f970b..e123562fb 100755
--- a/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py
+++ b/Examples/Tests/radiation_reaction/test_const_B_analytical/analysis_classicalRR.py
@@ -190,7 +190,7 @@ def generate():
f.write('{}.injection_style = "SingleParticle"\n'.format(cc.name))
f.write("{}.single_particle_pos = {} {} {}\n".
format(cc.name, init_pos[0], init_pos[1], init_pos[2]))
- f.write("{}.single_particle_vel = {} {} {}\n".
+ f.write("{}.single_particle_u = {} {} {}\n".
format(cc.name, cc.init_mom[0], cc.init_mom[1], cc.init_mom[2]))
f.write("{}.single_particle_weight = {}\n".format(cc.name, very_small_weight))
f.write("{}.do_classical_radiation_reaction = 1\n".format(cc.name))
diff --git a/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d b/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d
index 3df828fd2..d18145168 100644
--- a/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d
+++ b/Examples/Tests/radiation_reaction/test_const_B_analytical/inputs_3d
@@ -27,35 +27,35 @@ particles.species_names = ele_para0 ele_perp0 ele_perp1 ele_perp2 pos_perp2
ele_para0.species_type = "electron"
ele_para0.injection_style = "SingleParticle"
ele_para0.single_particle_pos = 0.0 0.0 0.0
-ele_para0.single_particle_vel = 285.7142857142856 428.5714285714285 857.142857142857
+ele_para0.single_particle_u = 285.7142857142856 428.5714285714285 857.142857142857
ele_para0.single_particle_weight = 1e-08
ele_para0.do_classical_radiation_reaction = 1
ele_perp0.species_type = "electron"
ele_perp0.injection_style = "SingleParticle"
ele_perp0.single_particle_pos = 0.0 0.0 0.0
-ele_perp0.single_particle_vel = -47.91574237499548 6.388765649999412 12.777531299998806
+ele_perp0.single_particle_u = -47.91574237499548 6.388765649999412 12.777531299998806
ele_perp0.single_particle_weight = 1e-08
ele_perp0.do_classical_radiation_reaction = 1
ele_perp1.species_type = "electron"
ele_perp1.injection_style = "SingleParticle"
ele_perp1.single_particle_pos = 0.0 0.0 0.0
-ele_perp1.single_particle_vel = 1.4274296030894868e-14 178.88543819998318 -89.44271909999159
+ele_perp1.single_particle_u = 1.4274296030894868e-14 178.88543819998318 -89.44271909999159
ele_perp1.single_particle_weight = 1e-08
ele_perp1.do_classical_radiation_reaction = 1
ele_perp2.species_type = "electron"
ele_perp2.injection_style = "SingleParticle"
ele_perp2.single_particle_pos = 0.0 0.0 0.0
-ele_perp2.single_particle_vel = -958.3148474999095 127.77531299998823 255.55062599997612
+ele_perp2.single_particle_u = -958.3148474999095 127.77531299998823 255.55062599997612
ele_perp2.single_particle_weight = 1e-08
ele_perp2.do_classical_radiation_reaction = 1
pos_perp2.species_type = "positron"
pos_perp2.injection_style = "SingleParticle"
pos_perp2.single_particle_pos = 0.0 0.0 0.0
-pos_perp2.single_particle_vel = -958.3148474999095 127.77531299998823 255.55062599997612
+pos_perp2.single_particle_u = -958.3148474999095 127.77531299998823 255.55062599997612
pos_perp2.single_particle_weight = 1e-08
pos_perp2.do_classical_radiation_reaction = 1
diff --git a/Examples/Tests/repelling_particles/inputs_2d b/Examples/Tests/repelling_particles/inputs_2d
index 77c3850bd..a4abd67c9 100644
--- a/Examples/Tests/repelling_particles/inputs_2d
+++ b/Examples/Tests/repelling_particles/inputs_2d
@@ -31,7 +31,7 @@ electron1.charge = q_e
electron1.mass = m_e
electron1.injection_style = "singleparticle"
electron1.single_particle_pos = 1.e-6 0. 0.
-electron1.single_particle_vel = 0. 0. 0.
+electron1.single_particle_u = 0. 0. 0.
electron1.single_particle_weight = 5.e12
electron1.initialize_self_fields = 1
@@ -39,7 +39,7 @@ electron2.charge = q_e
electron2.mass = m_e
electron2.injection_style = "singleparticle"
electron2.single_particle_pos = -1.e-6 0. 0.
-electron2.single_particle_vel = 0. 0. 0.
+electron2.single_particle_u = 0. 0. 0.
electron2.single_particle_weight = 5.e12
electron2.initialize_self_fields = 1
diff --git a/Examples/Tests/single_particle/inputs_2d b/Examples/Tests/single_particle/inputs_2d
index bee31c020..71ca2101c 100644
--- a/Examples/Tests/single_particle/inputs_2d
+++ b/Examples/Tests/single_particle/inputs_2d
@@ -23,7 +23,7 @@ electron.charge = -q_e
electron.mass = m_e
electron.injection_style = "SingleParticle"
electron.single_particle_pos = 0.0 0.0 0.0
-electron.single_particle_vel = 1.e20 0.0 0.0 # gamma*beta
+electron.single_particle_u = 1.e20 0.0 0.0 # gamma*beta
electron.single_particle_weight = 1.0
# Diagnostics
diff --git a/Examples/Tests/vay_deposition/inputs_2d b/Examples/Tests/vay_deposition/inputs_2d
index a47e1f832..c4928831a 100644
--- a/Examples/Tests/vay_deposition/inputs_2d
+++ b/Examples/Tests/vay_deposition/inputs_2d
@@ -26,7 +26,7 @@ electron.charge = -q_e
electron.injection_style = "SingleParticle"
electron.mass = 9e-22
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 0.5 0. 0.5
+electron.single_particle_u = 0.5 0. 0.5
electron.single_particle_weight = 1.
# geometry
@@ -40,7 +40,7 @@ ion.charge = q_e
ion.injection_style = "SingleParticle"
ion.mass = 9e-22
ion.single_particle_pos = 0. 0. 0.
-ion.single_particle_vel = -0.5 0. -0.5
+ion.single_particle_u = -0.5 0. -0.5
ion.single_particle_weight = 1.
# max_step
diff --git a/Examples/Tests/vay_deposition/inputs_3d b/Examples/Tests/vay_deposition/inputs_3d
index 663da28e4..a672049e1 100644
--- a/Examples/Tests/vay_deposition/inputs_3d
+++ b/Examples/Tests/vay_deposition/inputs_3d
@@ -26,7 +26,7 @@ electron.charge = -q_e
electron.injection_style = "SingleParticle"
electron.mass = 9e-22
electron.single_particle_pos = 0. 0. 0.
-electron.single_particle_vel = 0.5 0.5 0.5
+electron.single_particle_u = 0.5 0.5 0.5
electron.single_particle_weight = 1.
# geometry
@@ -40,7 +40,7 @@ ion.charge = q_e
ion.injection_style = "SingleParticle"
ion.mass = 9e-22
ion.single_particle_pos = 0. 0. 0.
-ion.single_particle_vel = -0.5 -0.5 -0.5
+ion.single_particle_u = -0.5 -0.5 -0.5
ion.single_particle_weight = 1.
# max_step
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 2ebd161b7..6a19de3f5 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -450,9 +450,9 @@ class ParticleListDistribution(picmistandard.PICMI_ParticleListDistribution):
species.multiple_particles_pos_x = self.x
species.multiple_particles_pos_y = self.y
species.multiple_particles_pos_z = self.z
- species.multiple_particles_vel_x = np.array(self.ux)/constants.c
- species.multiple_particles_vel_y = np.array(self.uy)/constants.c
- species.multiple_particles_vel_z = np.array(self.uz)/constants.c
+ species.multiple_particles_ux = np.array(self.ux)/constants.c
+ species.multiple_particles_uy = np.array(self.uy)/constants.c
+ species.multiple_particles_uz = np.array(self.uz)/constants.c
species.multiple_particles_weight = self.weight
if density_scale is not None:
species.multiple_particles_weight = self.weight*density_scale
diff --git a/Source/Initialization/PlasmaInjector.H b/Source/Initialization/PlasmaInjector.H
index b49e6d88c..6ad4ec198 100644
--- a/Source/Initialization/PlasmaInjector.H
+++ b/Source/Initialization/PlasmaInjector.H
@@ -72,16 +72,16 @@ public:
bool add_single_particle = false;
amrex::Vector<amrex::ParticleReal> single_particle_pos;
- amrex::Vector<amrex::ParticleReal> single_particle_vel;
+ amrex::Vector<amrex::ParticleReal> single_particle_u;
amrex::ParticleReal single_particle_weight;
bool add_multiple_particles = false;
amrex::Vector<amrex::ParticleReal> multiple_particles_pos_x;
amrex::Vector<amrex::ParticleReal> multiple_particles_pos_y;
amrex::Vector<amrex::ParticleReal> multiple_particles_pos_z;
- amrex::Vector<amrex::ParticleReal> multiple_particles_vel_x;
- amrex::Vector<amrex::ParticleReal> multiple_particles_vel_y;
- amrex::Vector<amrex::ParticleReal> multiple_particles_vel_z;
+ amrex::Vector<amrex::ParticleReal> multiple_particles_ux;
+ amrex::Vector<amrex::ParticleReal> multiple_particles_uy;
+ amrex::Vector<amrex::ParticleReal> multiple_particles_uz;
amrex::Vector<amrex::ParticleReal> multiple_particles_weight;
bool gaussian_beam = false;
diff --git a/Source/Initialization/PlasmaInjector.cpp b/Source/Initialization/PlasmaInjector.cpp
index b6f9ae9ad..c828e663e 100644
--- a/Source/Initialization/PlasmaInjector.cpp
+++ b/Source/Initialization/PlasmaInjector.cpp
@@ -185,8 +185,8 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name)
utils::parser::getArrWithParser(
pp_species_name, "single_particle_pos", single_particle_pos, 0, 3);
utils::parser::getArrWithParser(
- pp_species_name, "single_particle_vel", single_particle_vel, 0, 3);
- for (auto& x : single_particle_vel) {
+ pp_species_name, "single_particle_u", single_particle_u, 0, 3);
+ for (auto& x : single_particle_u) {
x *= PhysConst::c;
}
utils::parser::getWithParser(
@@ -201,24 +201,24 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name)
utils::parser::getArrWithParser(
pp_species_name, "multiple_particles_pos_z", multiple_particles_pos_z);
utils::parser::getArrWithParser(
- pp_species_name, "multiple_particles_vel_x", multiple_particles_vel_x);
+ pp_species_name, "multiple_particles_ux", multiple_particles_ux);
utils::parser::getArrWithParser(
- pp_species_name, "multiple_particles_vel_y", multiple_particles_vel_y);
+ pp_species_name, "multiple_particles_uy", multiple_particles_uy);
utils::parser::getArrWithParser(
- pp_species_name, "multiple_particles_vel_z", multiple_particles_vel_z);
+ pp_species_name, "multiple_particles_uz", multiple_particles_uz);
utils::parser::getArrWithParser(
pp_species_name, "multiple_particles_weight", multiple_particles_weight);
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
((multiple_particles_pos_x.size() == multiple_particles_pos_y.size()) &&
(multiple_particles_pos_x.size() == multiple_particles_pos_z.size()) &&
- (multiple_particles_pos_x.size() == multiple_particles_vel_x.size()) &&
- (multiple_particles_pos_x.size() == multiple_particles_vel_y.size()) &&
- (multiple_particles_pos_x.size() == multiple_particles_vel_z.size()) &&
+ (multiple_particles_pos_x.size() == multiple_particles_ux.size()) &&
+ (multiple_particles_pos_x.size() == multiple_particles_uy.size()) &&
+ (multiple_particles_pos_x.size() == multiple_particles_uz.size()) &&
(multiple_particles_pos_x.size() == multiple_particles_weight.size())),
"Error: The multiple particles source quantities must all have the same number of elements");
- for (auto& vx : multiple_particles_vel_x) { vx *= PhysConst::c; }
- for (auto& vy : multiple_particles_vel_y) { vy *= PhysConst::c; }
- for (auto& vz : multiple_particles_vel_z) { vz *= PhysConst::c; }
+ for (auto& vx : multiple_particles_ux) { vx *= PhysConst::c; }
+ for (auto& vy : multiple_particles_uy) { vy *= PhysConst::c; }
+ for (auto& vz : multiple_particles_uz) { vz *= PhysConst::c; }
add_multiple_particles = true;
return;
} else if (injection_style == "gaussian_beam") {
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 1390fdda6..3e4c60737 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -783,17 +783,17 @@ PhysicalParticleContainer::AddParticles (int lev)
MapParticletoBoostedFrame(plasma_injector->single_particle_pos[0],
plasma_injector->single_particle_pos[1],
plasma_injector->single_particle_pos[2],
- plasma_injector->single_particle_vel[0],
- plasma_injector->single_particle_vel[1],
- plasma_injector->single_particle_vel[2]);
+ plasma_injector->single_particle_u[0],
+ plasma_injector->single_particle_u[1],
+ plasma_injector->single_particle_u[2]);
}
AddNParticles(lev, 1,
&(plasma_injector->single_particle_pos[0]),
&(plasma_injector->single_particle_pos[1]),
&(plasma_injector->single_particle_pos[2]),
- &(plasma_injector->single_particle_vel[0]),
- &(plasma_injector->single_particle_vel[1]),
- &(plasma_injector->single_particle_vel[2]),
+ &(plasma_injector->single_particle_u[0]),
+ &(plasma_injector->single_particle_u[1]),
+ &(plasma_injector->single_particle_u[2]),
1, &(plasma_injector->single_particle_weight), 0, nullptr, 0);
return;
}
@@ -804,18 +804,18 @@ PhysicalParticleContainer::AddParticles (int lev)
MapParticletoBoostedFrame(plasma_injector->multiple_particles_pos_x[i],
plasma_injector->multiple_particles_pos_y[i],
plasma_injector->multiple_particles_pos_z[i],
- plasma_injector->multiple_particles_vel_x[i],
- plasma_injector->multiple_particles_vel_y[i],
- plasma_injector->multiple_particles_vel_z[i]);
+ plasma_injector->multiple_particles_ux[i],
+ plasma_injector->multiple_particles_uy[i],
+ plasma_injector->multiple_particles_uz[i]);
}
}
AddNParticles(lev, plasma_injector->multiple_particles_pos_x.size(),
plasma_injector->multiple_particles_pos_x.dataPtr(),
plasma_injector->multiple_particles_pos_y.dataPtr(),
plasma_injector->multiple_particles_pos_z.dataPtr(),
- plasma_injector->multiple_particles_vel_x.dataPtr(),
- plasma_injector->multiple_particles_vel_y.dataPtr(),
- plasma_injector->multiple_particles_vel_z.dataPtr(),
+ plasma_injector->multiple_particles_ux.dataPtr(),
+ plasma_injector->multiple_particles_uy.dataPtr(),
+ plasma_injector->multiple_particles_uz.dataPtr(),
1, plasma_injector->multiple_particles_weight.dataPtr(), 0, nullptr, 0);
return;
}
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 21945d6fa..48037eaa1 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -1650,6 +1650,34 @@ WarpX::BackwardCompatibility ()
ablastr::warn_manager::WarnPriority::low);
}
+ std::vector<std::string> backward_sp_names;
+ pp_particles.queryarr("species_names", backward_sp_names);
+ for(std::string speciesiter : backward_sp_names){
+ ParmParse pp_species(speciesiter);
+ std::vector<amrex::Real> backward_vel;
+ std::stringstream ssspecies;
+
+ ssspecies << "'" << speciesiter << ".multiple_particles_vel_<x,y,z>'";
+ ssspecies << " are not supported anymore. ";
+ ssspecies << "Please use the renamed variables ";
+ ssspecies << "'" << speciesiter << ".multiple_particles_u<x,y,z>' .";
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
+ !pp_species.queryarr("multiple_particles_vel_x", backward_vel) &&
+ !pp_species.queryarr("multiple_particles_vel_y", backward_vel) &&
+ !pp_species.queryarr("multiple_particles_vel_z", backward_vel),
+ ssspecies.str());
+
+ ssspecies.str("");
+ ssspecies.clear();
+ ssspecies << "'" << speciesiter << ".single_particle_vel'";
+ ssspecies << " is not supported anymore. ";
+ ssspecies << "Please use the renamed variable ";
+ ssspecies << "'" << speciesiter << ".single_particle_u' .";
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
+ !pp_species.queryarr("single_particle_vel", backward_vel),
+ ssspecies.str());
+ }
+
ParmParse pp_collisions("collisions");
int ncollisions;
if (pp_collisions.query("ncollisions", ncollisions)){