aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 7e7fbd9d4..aaf1ec98d 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -21,11 +21,12 @@ class constants:
# --- Put the constants in their own namespace
# --- Values from WarpXConst.H
c = 299792458.
- ep0 = 8.854187817e-12
- mu0 = 1.2566370614359173e-06
- q_e = 1.602176462e-19
- m_e = 9.10938291e-31
- m_p = 1.6726231e-27
+ ep0 = 8.8541878128e-12
+ mu0 = 1.25663706212e-06
+ q_e = 1.602176634e-19
+ m_e = 9.1093837015e-31
+ m_p = 1.67262192369e-27
+ hbar = 1.054571817e-34
class Species(picmistandard.PICMI_Species):
@@ -45,7 +46,12 @@ class Species(picmistandard.PICMI_Species):
if self.mass is None: self.mass = 'm_p'
else:
if self.charge is None and self.charge_state is not None:
- self.charge = self.charge_state*constants.q_e
+ if self.charge_state == +1.:
+ self.charge = 'q_e'
+ elif self.charge_state == -1.:
+ self.charge = '-q_e'
+ else:
+ self.charge = self.charge_state*constants.q_e
# Match a string of the format '#nXx', with the '#n' optional isotope number.
m = re.match('(?P<iso>#[\d+])*(?P<sym>[A-Za-z]+)', self.particle_type)
if m is not None: