From 9e02b95c1f7310550d0ba3d89639b44b72a17de9 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 22 Nov 2021 18:04:18 -0800 Subject: Python: Start 1D Support (#2582) * Python: Start 1D Support Start supporting 1D builds in Python. * Fix 1D: PML FillZero unused ... since PMLs are not yet supported in 1D. * BeamRelevant: Fix unused p_pos0 * FromTXYEFileLaserProfile: Not Impl in 1D * QED Schwinger: 1D not Implemented Fix unused warnings, add aborts. * 1D RealVect/IntVect: Initialization Use explicit scalar constructors, no braces. Fix warning in clang 10. * 1D NCI Filter: Fix unused members & Init Unimplemented, but throws warnings. * PSATD: 1D not Implemented - remove compile warnings - start porting some parts * NCIGodfreyFilter: Clean up 2D & Else --- Python/pywarpx/_libwarpx.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Python/pywarpx/_libwarpx.py') 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 -- cgit v1.2.3