diff options
author | 2019-08-09 11:32:08 -0700 | |
---|---|---|
committer | 2019-08-09 11:32:08 -0700 | |
commit | 008eeedf79a615e4ae2d81dbd116eeb8e18be625 (patch) | |
tree | cf74be990a916eb66816c78c12a21b1119ba23a7 /Python/pywarpx/picmi.py | |
parent | 16dba690f2e96173eaf477fb407933fe0ad00abe (diff) | |
download | WarpX-008eeedf79a615e4ae2d81dbd116eeb8e18be625.tar.gz WarpX-008eeedf79a615e4ae2d81dbd116eeb8e18be625.tar.zst WarpX-008eeedf79a615e4ae2d81dbd116eeb8e18be625.zip |
Updates to picmi.BinomialSmoother
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 35a29b850..47f8c562f 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -272,8 +272,17 @@ class PseudoRandomLayout(picmistandard.PICMI_PseudoRandomLayout): class BinomialSmoother(picmistandard.PICMI_BinomialSmoother): - def initialize_inputs(self): + def initialize_inputs(self, solver): pywarpx.warpx.use_filter = 1 + if self.n_pass is None: + # If not specified, do at least one pass in each direction. + self.n_pass = 1 + try: + # Check if n_pass is a vector + len(self.n_pass) + except TypeError: + # If not, make it a vector + self.n_pass = solver.grid.number_of_dimensions*[self.n_pass] pywarpx.warpx.filter_npass_each_dir = self.n_pass @@ -421,7 +430,7 @@ class ElectromagneticSolver(picmistandard.PICMI_ElectromagneticSolver): pywarpx.warpx.cfl = self.cfl if self.source_smoother is not None: - self.source_smoother.initialize_inputs() + self.source_smoother.initialize_inputs(self) class ElectrostaticSolver(picmistandard.PICMI_ElectrostaticSolver): |