diff options
author | 2022-01-14 16:24:58 -0800 | |
---|---|---|
committer | 2022-01-15 00:24:58 +0000 | |
commit | 375c161d0d72ec62a7aa228f961d8c700055cfd0 (patch) | |
tree | 1a44bad765433fcfc57703c0684952ce6a7bdbe5 /Python | |
parent | 814092e2c0e1166033966ac161146024fd6b57e8 (diff) | |
download | WarpX-375c161d0d72ec62a7aa228f961d8c700055cfd0.tar.gz WarpX-375c161d0d72ec62a7aa228f961d8c700055cfd0.tar.zst WarpX-375c161d0d72ec62a7aa228f961d8c700055cfd0.zip |
Set geometry earlier in picmi (#2745)
* Set geometry earlier in Python
* Fix comment typos
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pywarpx/picmi.py | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 441e04922..69fa25ac0 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -417,6 +417,13 @@ class CylindricalGrid(picmistandard.PICMI_CylindricalGrid): self.potential_zmin = kw.pop('warpx_potential_lo_z', None) self.potential_zmax = kw.pop('warpx_potential_hi_z', None) + # Geometry + # Set these as soon as the information is available + # (since these are needed to determine which shared object to load) + pywarpx.geometry.dims = 'RZ' + pywarpx.geometry.prob_lo = self.lower_bound # physical domain + pywarpx.geometry.prob_hi = self.upper_bound + def initialize_inputs(self): pywarpx.amr.n_cell = self.number_of_cells @@ -432,10 +439,6 @@ class CylindricalGrid(picmistandard.PICMI_CylindricalGrid): assert self.lower_bound[0] >= 0., Exception('Lower radial boundary must be >= 0.') assert self.bc_rmin != 'periodic' and self.bc_rmax != 'periodic', Exception('Radial boundaries can not be periodic') - # Geometry - pywarpx.geometry.dims = 'RZ' - pywarpx.geometry.prob_lo = self.lower_bound # physical domain - pywarpx.geometry.prob_hi = self.upper_bound pywarpx.warpx.n_rz_azimuthal_modes = self.n_azimuthal_modes # Boundary conditions @@ -478,6 +481,13 @@ class Cartesian1DGrid(picmistandard.PICMI_Cartesian1DGrid): self.potential_zmin = kw.pop('warpx_potential_lo_z', None) self.potential_zmax = kw.pop('warpx_potential_hi_z', None) + # Geometry + # Set these as soon as the information is available + # (since these are needed to determine which shared object to load) + pywarpx.geometry.dims = '1' + pywarpx.geometry.prob_lo = self.lower_bound # physical domain + pywarpx.geometry.prob_hi = self.upper_bound + def initialize_inputs(self): pywarpx.amr.n_cell = self.number_of_cells @@ -488,11 +498,6 @@ class Cartesian1DGrid(picmistandard.PICMI_Cartesian1DGrid): pywarpx.amr.blocking_factor = self.blocking_factor pywarpx.amr.blocking_factor_x = self.blocking_factor_x - # Geometry - pywarpx.geometry.dims = '1' - pywarpx.geometry.prob_lo = self.lower_bound # physical domain - pywarpx.geometry.prob_hi = self.upper_bound - # Boundary conditions pywarpx.boundary.field_lo = [BC_map[bc] for bc in [self.bc_xmin]] pywarpx.boundary.field_hi = [BC_map[bc] for bc in [self.bc_xmax]] @@ -531,6 +536,13 @@ class Cartesian2DGrid(picmistandard.PICMI_Cartesian2DGrid): self.potential_zmin = kw.pop('warpx_potential_lo_z', None) self.potential_zmax = kw.pop('warpx_potential_hi_z', None) + # Geometry + # Set these as soon as the information is available + # (since these are needed to determine which shared object to load) + pywarpx.geometry.dims = '2' + pywarpx.geometry.prob_lo = self.lower_bound # physical domain + pywarpx.geometry.prob_hi = self.upper_bound + def initialize_inputs(self): pywarpx.amr.n_cell = self.number_of_cells @@ -543,11 +555,6 @@ class Cartesian2DGrid(picmistandard.PICMI_Cartesian2DGrid): pywarpx.amr.blocking_factor_x = self.blocking_factor_x pywarpx.amr.blocking_factor_y = self.blocking_factor_y - # Geometry - pywarpx.geometry.dims = '2' - pywarpx.geometry.prob_lo = self.lower_bound # physical domain - pywarpx.geometry.prob_hi = self.upper_bound - # Boundary conditions pywarpx.boundary.field_lo = [BC_map[bc] for bc in [self.bc_xmin, self.bc_ymin]] pywarpx.boundary.field_hi = [BC_map[bc] for bc in [self.bc_xmax, self.bc_ymax]] @@ -592,6 +599,13 @@ class Cartesian3DGrid(picmistandard.PICMI_Cartesian3DGrid): self.potential_zmin = kw.pop('warpx_potential_lo_z', None) self.potential_zmax = kw.pop('warpx_potential_hi_z', None) + # Geometry + # Set these as soon as the information is available + # (since these are needed to determine which shared object to load) + pywarpx.geometry.dims = '3' + pywarpx.geometry.prob_lo = self.lower_bound # physical domain + pywarpx.geometry.prob_hi = self.upper_bound + def initialize_inputs(self): pywarpx.amr.n_cell = self.number_of_cells @@ -606,11 +620,6 @@ class Cartesian3DGrid(picmistandard.PICMI_Cartesian3DGrid): pywarpx.amr.blocking_factor_y = self.blocking_factor_y pywarpx.amr.blocking_factor_z = self.blocking_factor_z - # Geometry - pywarpx.geometry.dims = '3' - pywarpx.geometry.prob_lo = self.lower_bound # physical domain - pywarpx.geometry.prob_hi = self.upper_bound - # Boundary conditions pywarpx.boundary.field_lo = [BC_map[bc] for bc in [self.bc_xmin, self.bc_ymin, self.bc_zmin]] pywarpx.boundary.field_hi = [BC_map[bc] for bc in [self.bc_xmax, self.bc_ymax, self.bc_zmax]] |