From a056388af4bfb1975d55e8e8ac4af8cea68e6692 Mon Sep 17 00:00:00 2001 From: Ryan Sandberg Date: Wed, 6 Sep 2023 17:04:21 -0700 Subject: add symmetrize to PICMI (#4271) * add symmetrize to PICMI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * don't set defaults in PICMI - they don't matter --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- Python/pywarpx/picmi.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Python/pywarpx/picmi.py') diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index d1f5136bc..c7124780a 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -277,6 +277,10 @@ class MultiSpecies(picmistandard.PICMI_MultiSpecies): class GaussianBunchDistribution(picmistandard.PICMI_GaussianBunchDistribution): + def init(self, kw): + self.do_symmetrize = kw.pop('warpx_do_symmetrize', None) + self.symmetrization_order = kw.pop('warpx_symmetrization_order', None) + def initialize_inputs(self, species_number, layout, species, density_scale): species.injection_style = "gaussian_beam" species.x_m = self.centroid_position[0] @@ -329,6 +333,9 @@ class GaussianBunchDistribution(picmistandard.PICMI_GaussianBunchDistribution): species.uy = self.centroid_velocity[1]/constants.c species.uz = self.centroid_velocity[2]/constants.c + species.do_symmetrize = self.do_symmetrize + species.symmetrization_order = self.symmetrization_order + class DensityDistributionBase(object): """This is a base class for several predefined density distributions. It -- cgit v1.2.3