From 3684af17bbbe04fdc6dd84ff2a646c8a77076b73 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Fri, 5 Nov 2021 09:58:54 -0700 Subject: Add Python Wrappers for F,G in PML (#2481) * Add Python Wrappers for F,G in PML * Add Getters for F,G Nodal Flags * Fix Bug in FPPMLWrapper (Default Level) * Fix Bug in F,G Nodal Flags * Use GetPML Method for F,G Nodal Flags --- Python/pywarpx/fields.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'Python/pywarpx/fields.py') diff --git a/Python/pywarpx/fields.py b/Python/pywarpx/fields.py index 41f2751bc..2c9451cdd 100644 --- a/Python/pywarpx/fields.py +++ b/Python/pywarpx/fields.py @@ -835,6 +835,22 @@ def JzCPPMLWrapper(level=1, include_ghosts=False): get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) +def FCPPMLWrapper(level=1, include_ghosts=False): + assert level>0, Exception('Coarse patch only available on levels > 0') + return _MultiFABWrapper(direction=None, + get_lovects=_libwarpx.get_mesh_F_cp_lovects_pml, + get_fabs=_libwarpx.get_mesh_F_cp_pml, + get_nodal_flag=_libwarpx.get_F_nodal_flag, + level=level, include_ghosts=include_ghosts) + +def GCPPMLWrapper(level=1, include_ghosts=False): + assert level>0, Exception('Coarse patch only available on levels > 0') + return _MultiFABWrapper(direction=None, + get_lovects=_libwarpx.get_mesh_G_cp_lovects_pml, + get_fabs=_libwarpx.get_mesh_G_cp_pml, + get_nodal_flag=_libwarpx.get_G_nodal_flag, + level=level, include_ghosts=include_ghosts) + def ExFPPMLWrapper(level=0, include_ghosts=False): return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects_pml, @@ -897,3 +913,17 @@ def JzFPPMLWrapper(level=0, include_ghosts=False): get_fabs=_libwarpx.get_mesh_current_density_fp_pml, get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) + +def FFPPMLWrapper(level=0, include_ghosts=False): + return _MultiFABWrapper(direction=None, + get_lovects=_libwarpx.get_mesh_F_fp_lovects_pml, + get_fabs=_libwarpx.get_mesh_F_fp_pml, + get_nodal_flag=_libwarpx.get_F_pml_nodal_flag, + level=level, include_ghosts=include_ghosts) + +def GFPPMLWrapper(level=0, include_ghosts=False): + return _MultiFABWrapper(direction=None, + get_lovects=_libwarpx.get_mesh_G_fp_lovects_pml, + get_fabs=_libwarpx.get_mesh_G_fp_pml, + get_nodal_flag=_libwarpx.get_G_pml_nodal_flag, + level=level, include_ghosts=include_ghosts) -- cgit v1.2.3