aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rwxr-xr-xPython/pywarpx/_libwarpx.py11
-rw-r--r--Python/setup.py2
2 files changed, 10 insertions, 3 deletions
diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py
index d80a1915f..5cfe9bbaa 100755
--- a/Python/pywarpx/_libwarpx.py
+++ b/Python/pywarpx/_libwarpx.py
@@ -46,7 +46,7 @@ def _get_package_root():
return ''
cur = os.path.dirname(cur)
-# --- Use geometry to determine whether to import the 2D or 3D version.
+# --- Use geometry to determine whether to import the 1D, 2D, 3D or RZ version.
# --- This assumes that the input is setup before this module is imported,
# --- which should normally be the case.
# --- Default to 3D if geometry is not setup yet.
@@ -824,6 +824,8 @@ def _get_boundary_number(boundary):
dimensions = {'x' : 0, 'y' : 1, 'z' : 2}
elif geometry_dim == '2d':
dimensions = {'x' : 0, 'z' : 1}
+ elif geometry_dim == '1d':
+ dimensions = {'z' : 0}
else:
raise NotImplementedError("RZ is not supported for particle scraping.")
@@ -838,7 +840,12 @@ def _get_boundary_number(boundary):
raise RuntimeError(f'Unknown boundary specified: {boundary}')
boundary_num = 2 * dim_num + side
else:
- boundary_num = 4 if geometry_dim == '2d' else 6
+ if geometry_dim == '3d':
+ boundary_num = 6
+ elif geometry_dim == '2d':
+ boundary_num = 4
+ elif geometry_dim == '1d':
+ boundary_num = 2
return boundary_num
diff --git a/Python/setup.py b/Python/setup.py
index 86330717c..8142a59e6 100644
--- a/Python/setup.py
+++ b/Python/setup.py
@@ -24,7 +24,7 @@ argparser.add_argument('--with-lib-dir', type=str, default=None, help='Install w
args, unknown = argparser.parse_known_args()
sys.argv = [sys.argv[0]] + unknown
-allowed_dims = ["2d", "3d", "rz"]
+allowed_dims = ["1d", "2d", "3d", "rz"]
# Allow to control options via environment vars.
# Work-around for https://github.com/pypa/setuptools/issues/1712