aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pywarpx')
-rwxr-xr-xPython/pywarpx/_libwarpx.py10
-rw-r--r--Python/pywarpx/picmi.py8
2 files changed, 9 insertions, 9 deletions
diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py
index 5ffb74360..2c942c49d 100755
--- a/Python/pywarpx/_libwarpx.py
+++ b/Python/pywarpx/_libwarpx.py
@@ -84,16 +84,16 @@ class LibWarpX():
# --- The geometry must be setup before the lib warpx shared object can be loaded.
try:
_prob_lo = geometry.prob_lo
- _coord_sys = geometry.coord_sys
+ _dims = geometry.dims
except AttributeError:
raise Exception('The shared object could not be loaded. The geometry must be setup before the WarpX shared object can be accessesd. The geometry determines which version of the shared object to load.')
- if _coord_sys == 0:
- self.geometry_dim = '%dd'%len(_prob_lo)
- elif _coord_sys == 1:
+ if _dims == 'RZ':
self.geometry_dim = 'rz'
+ elif (_dims == '1' or _dims == '2' or _dims == '3'):
+ self.geometry_dim = '%dd'%len(_prob_lo)
else:
- raise Exception('Undefined coordinate system %d'%_coord_sys)
+ raise Exception('Undefined geometry %d'%_dims)
# this is a plain C/C++ shared library, not a Python module
if os.name == 'nt':
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index ebfb6830a..677253405 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -432,7 +432,7 @@ class CylindricalGrid(picmistandard.PICMI_CylindricalGrid):
assert self.bc_rmin != 'periodic' and self.bc_rmax != 'periodic', Exception('Radial boundaries can not be periodic')
# Geometry
- pywarpx.geometry.coord_sys = 1 # RZ
+ 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
@@ -488,7 +488,7 @@ class Cartesian1DGrid(picmistandard.PICMI_Cartesian1DGrid):
pywarpx.amr.blocking_factor_x = self.blocking_factor_x
# Geometry
- pywarpx.geometry.coord_sys = 0 # Cartesian
+ pywarpx.geometry.dims = '1'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound
@@ -543,7 +543,7 @@ class Cartesian2DGrid(picmistandard.PICMI_Cartesian2DGrid):
pywarpx.amr.blocking_factor_y = self.blocking_factor_y
# Geometry
- pywarpx.geometry.coord_sys = 0 # Cartesian
+ pywarpx.geometry.dims = '2'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound
@@ -606,7 +606,7 @@ class Cartesian3DGrid(picmistandard.PICMI_Cartesian3DGrid):
pywarpx.amr.blocking_factor_z = self.blocking_factor_z
# Geometry
- pywarpx.geometry.coord_sys = 0 # Cartesian
+ pywarpx.geometry.dims = '3'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound