aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/_libwarpx.py
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-12-20 18:39:08 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-21 02:39:08 +0000
commitaafb6da2362374eb255eff450b846c4fec20ac5e (patch)
tree8a24908133d464a84aedd82d07ccc720808e8b6a /Python/pywarpx/_libwarpx.py
parent634a2833a7a13cffde77c5d3229e0566c327f096 (diff)
downloadWarpX-aafb6da2362374eb255eff450b846c4fec20ac5e.tar.gz
WarpX-aafb6da2362374eb255eff450b846c4fec20ac5e.tar.zst
WarpX-aafb6da2362374eb255eff450b846c4fec20ac5e.zip
Inputs: `geometry.dims` option (#2685)
* Docs: `geometry.dims` option Add a new, required option to specify the geometry of an inputs file at runtime. * Check & Report Runtime Dims Mismatch * Examples: add `geometry.dims` * Deprecation Warning: `geometry.coord_sys` * PICMI: `geometry.dims` * Improve error message sounds a bit better * Improve Doc Description Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
Diffstat (limited to 'Python/pywarpx/_libwarpx.py')
-rwxr-xr-xPython/pywarpx/_libwarpx.py10
1 files changed, 5 insertions, 5 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':