diff options
-rw-r--r-- | Python/pywarpx/picmi.py | 18 | ||||
-rw-r--r-- | Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json | 18 | ||||
-rw-r--r-- | Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json | 26 |
3 files changed, 34 insertions, 28 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: diff --git a/Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json b/Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json index 83864c131..6de1ccaa4 100644 --- a/Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json +++ b/Regression/Checksum/benchmarks_json/Python_Langmuir_rz_multimode.json @@ -2,20 +2,20 @@ "electrons": { "particle_cpu": 206080.0, "particle_id": 169156013440.0, - "particle_momentum_x": 2.1038307987216888e-20, - "particle_momentum_y": 2.374515558939564e-20, - "particle_momentum_z": 3.1024445102509245e-20, + "particle_momentum_x": 2.1038306637670152e-20, + "particle_momentum_y": 2.3745154066196203e-20, + "particle_momentum_z": 3.1024443112370830e-20, "particle_position_x": 6.61250119096399, "particle_position_y": 14.719999999999999, "particle_theta": 1156106.5707136206, "particle_weight": 81147583679.15047 }, "lev=0": { - "By": 2.496097846228156, - "Ex": 879037550423.2649, - "Ez": 1707660097260.0088, - "jx": 210208695620033.78, - "jz": 407196128263304.25, + "By": 2.496097613843332, + "Ex": 879037494036.5272, + "Ez": 1707659987719.488, + "jx": 210208682137002.0, + "jz": 407196102143353.38, "part_per_cell": 1472000.0 } -}
\ No newline at end of file +} diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json b/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json index 535a3a6fe..f00d487d1 100644 --- a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json +++ b/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json @@ -2,24 +2,24 @@ "electrons": { "particle_cpu": 695224.0, "particle_id": 290501119140.0, - "particle_momentum_x": 2.367557775119529e-19, - "particle_momentum_y": 1.9290614631916863e-21, - "particle_momentum_z": 1.893835032184678e-20, + "particle_momentum_x": 2.36755772669732e-19, + "particle_momentum_y": 1.9290614212841715e-21, + "particle_momentum_z": 1.8938349865018830e-20, "particle_position_x": 7.0065548820957835, "particle_position_y": 7.006554897199218, "particle_position_z": 4.600065455619851, "particle_weight": 21640883789.062504 }, "lev=0": { - "Bx": 2.057094142692001, - "By": 2449255.0148639255, - "Bz": 71239.03584863919, - "Ex": 752773924385165.6, - "Ey": 1907341753195.897, - "Ez": 28672359500699.152, - "jx": 1.928774119411483e+18, - "jy": 69804337605269.28, - "jz": 742686862695719.5, + "Bx": 2.0570940778040221, + "By": 2449254.9647385371, + "Bz": 71239.03439068704, + "Ex": 752773908979237.0, + "Ey": 1907341714160.9873, + "Ez": 28672358913898.098, + "jx": 1.9287740799385943e+18, + "jy": 69804336095097.0, + "jz": 742686844234635.5, "rho": 27910721385.365227 } -}
\ No newline at end of file +} |