diff options
author | 2019-08-09 11:56:19 -0700 | |
---|---|---|
committer | 2019-08-09 11:56:19 -0700 | |
commit | 941a74cdee2d89c832d3fc682ef9a0973deddcce (patch) | |
tree | 1ed53c4aede051e9290c493b22db89591a763214 /Python/pywarpx/picmi.py | |
parent | ce359c59f35b707d8e40da1d6051d703525b9c07 (diff) | |
parent | 008eeedf79a615e4ae2d81dbd116eeb8e18be625 (diff) | |
download | WarpX-941a74cdee2d89c832d3fc682ef9a0973deddcce.tar.gz WarpX-941a74cdee2d89c832d3fc682ef9a0973deddcce.tar.zst WarpX-941a74cdee2d89c832d3fc682ef9a0973deddcce.zip |
Merge pull request #264 from ECP-WarpX/picmi_update
[miniPR] Implemented picmi.BinomialSmoother
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index a0069ec8f..47f8c562f 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -272,7 +272,18 @@ class PseudoRandomLayout(picmistandard.PICMI_PseudoRandomLayout): class BinomialSmoother(picmistandard.PICMI_BinomialSmoother): - pass + 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 class CylindricalGrid(picmistandard.PICMI_CylindricalGrid): @@ -418,6 +429,9 @@ class ElectromagneticSolver(picmistandard.PICMI_ElectromagneticSolver): if self.cfl is not None: pywarpx.warpx.cfl = self.cfl + if self.source_smoother is not None: + self.source_smoother.initialize_inputs(self) + class ElectrostaticSolver(picmistandard.PICMI_ElectrostaticSolver): def initialize_inputs(self): |