diff options
author | 2018-08-09 10:23:51 -0700 | |
---|---|---|
committer | 2018-08-09 10:23:51 -0700 | |
commit | 0add499dade44dd5e84edce3b95ff4b8f4c40392 (patch) | |
tree | 2f0826f52c847ad60b05ee9d1d9eb67ebd1e4269 /Python/pywarpx/picmi.py | |
parent | 80e7030ccd1cb229383820d9b9149b86cd79ebe4 (diff) | |
download | WarpX-0add499dade44dd5e84edce3b95ff4b8f4c40392.tar.gz WarpX-0add499dade44dd5e84edce3b95ff4b8f4c40392.tar.zst WarpX-0add499dade44dd5e84edce3b95ff4b8f4c40392.zip |
Various updates to picmi
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 11e1df6a2..31596d743 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -57,10 +57,6 @@ class MultiSpecies(PICMI_Base.PICMI_MultiSpecies): class GaussianBunchDistribution(PICMI_Base.PICMI_GaussianBunchDistribution): - def init(self, kw): - if self.seed is not None: - print('Warning: WarpX does not support specifying the random number seed') - def initialize_inputs(self, species_number, layout, species): species.injection_style = "gaussian_beam" species.x_m = self.centroid_position[0] @@ -79,7 +75,7 @@ class GaussianBunchDistribution(PICMI_Base.PICMI_GaussianBunchDistribution): charge = q_e elif charge == '-q_e': charge = -q_e - species.q_tot = self.number_real_particles*charge + species.q_tot = self.n_physical_particles*charge # --- These need to be defined even though they are not used species.profile = "constant" @@ -196,7 +192,9 @@ class GriddedLayout(PICMI_Base.PICMI_GriddedLayout): class PseudoRandomLayout(PICMI_Base.PICMI_PseudoRandomLayout): - pass + def init(self, kw): + if self.seed is not None: + print('Warning: WarpX does not support specifying the random number seed') class BinomialSmoother(PICMI_Base.PICMI_BinomialSmoother): @@ -277,7 +275,7 @@ class Cartesian3DGrid(PICMI_Base.PICMI_Cartesian3DGrid): class ElectromagneticSolver(PICMI_Base.PICMI_ElectromagneticSolver): def init(self, kw): - assert self.method is None or self.method in ['Yee'], Exception("Only 'Yee' FDTD is supported") + assert self.method is None or self.method in ['Yee', 'CKC'], Exception("Only 'Yee' and 'CKC' FDTD are supported") self.do_pml = kw.pop('warpx_do_pml', None) @@ -287,6 +285,9 @@ class ElectromagneticSolver(PICMI_Base.PICMI_ElectromagneticSolver): pywarpx.warpx.do_pml = self.do_pml + # --- Same method names are used, though mapped to lower case. + pywarpx.warpx.maxwell_fdtd_solver = self.method + if self.cfl is not None: pywarpx.warpx.cfl = self.cfl @@ -348,6 +349,10 @@ class Simulation(PICMI_Base.PICMI_Simulation): if self.time_step_size is not None: pywarpx.warpx.const_dt = self.timestep + if self.gamma_boost is not None: + pywarpx.warpx.gamma_boost = self.gamma_boost + pywarpx.warpx.boost_direction = z + pywarpx.amr.plot_int = self.plot_int pywarpx.amr.plot_file = self.plot_file pywarpx.algo.current_deposition = self.current_deposition_algo |