diff options
Diffstat (limited to 'Python')
-rwxr-xr-x | Python/pywarpx/_libwarpx.py | 114 | ||||
-rw-r--r-- | Python/pywarpx/fields.py | 196 |
2 files changed, 257 insertions, 53 deletions
diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py index 2550cb92a..d7e3e8ba2 100755 --- a/Python/pywarpx/_libwarpx.py +++ b/Python/pywarpx/_libwarpx.py @@ -166,6 +166,17 @@ libwarpx.warpx_getChargeDensityCPLoVects.restype = _LP_c_int libwarpx.warpx_getChargeDensityFP.restype = _LP_LP_c_real libwarpx.warpx_getChargeDensityFPLoVects.restype = _LP_c_int +libwarpx.warpx_getEx_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getEy_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getEz_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getBx_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getBy_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getBz_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getJx_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getJy_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getJz_nodal_flag.restype = _LP_c_int +libwarpx.warpx_getRho_nodal_flag.restype = _LP_c_int + #libwarpx.warpx_getPMLSigma.restype = _LP_c_real #libwarpx.warpx_getPMLSigmaStar.restype = _LP_c_real #libwarpx.warpx_ComputePMLFactors.argtypes = (ctypes.c_int, c_real) @@ -183,6 +194,7 @@ libwarpx.warpx_addNParticles.argtypes = (ctypes.c_int, ctypes.c_int, libwarpx.warpx_getProbLo.restype = c_real libwarpx.warpx_getProbHi.restype = c_real +libwarpx.warpx_getCellSize.restype = c_real libwarpx.warpx_getistep.restype = ctypes.c_int libwarpx.warpx_gett_new.restype = c_real libwarpx.warpx_getdt.restype = c_real @@ -199,6 +211,9 @@ libwarpx.warpx_FillBoundaryB.argtypes = [] libwarpx.warpx_UpdateAuxilaryData.argtypes = [] libwarpx.warpx_SyncCurrent.argtypes = [] libwarpx.warpx_PushParticlesandDepose.argtypes = [c_real] +libwarpx.warpx_getProbLo.argtypes = [ctypes.c_int] +libwarpx.warpx_getProbHi.argtypes = [ctypes.c_int] +libwarpx.warpx_getCellSize.argtypes = [ctypes.c_int, ctypes.c_int] libwarpx.warpx_getistep.argtypes = [ctypes.c_int] libwarpx.warpx_setistep.argtypes = [ctypes.c_int, ctypes.c_int] libwarpx.warpx_gett_new.argtypes = [ctypes.c_int] @@ -267,6 +282,22 @@ def evolve(num_steps=-1): libwarpx.warpx_evolve(num_steps); +def getProbLo(direction): + assert 0 <= direction < dim, 'Inappropriate direction specified' + return libwarpx.warpx_getProbLo(direction) + + +def getProbHi(direction): + assert 0 <= direction < dim, 'Inappropriate direction specified' + return libwarpx.warpx_getProbHi(direction) + + +def getCellSize(direction, level=0): + assert 0 <= direction < 3, 'Inappropriate direction specified' + assert 0 <= level and level <= libwarpx.warpx_finestLevel(), 'Inappropriate level specified' + return libwarpx.warpx_getCellSize(direction, level) + + #def get_sigma(direction): # ''' # @@ -1539,6 +1570,8 @@ def get_mesh_current_density_fp_lovects_pml(level, direction, include_ghosts=Tru return _get_mesh_array_lovects(level, direction, include_ghosts, libwarpx.warpx_getCurrentDensityFPLoVects_PML) except ValueError: raise Exception('PML not initialized') + + def get_mesh_charge_density_cp_lovects(level, include_ghosts=True): ''' @@ -1579,3 +1612,84 @@ def get_mesh_charge_density_fp_lovects(level, include_ghosts=True): ''' return _get_mesh_array_lovects(level, None, include_ghosts, libwarpx.warpx_getChargeDensityFPLoVects) + +def _get_nodal_flag(getdatafunc): + data = getdatafunc() + nodal_flag_ref = np.ctypeslib.as_array(data, (dim,)) + + # --- Make a copy of the data to avoid memory problems + nodal_flag = nodal_flag_ref.copy() + + del nodal_flag_ref + _libc.free(data) + return nodal_flag + + +def get_Ex_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Ex along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getEx_nodal_flag) + + +def get_Ey_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Ey along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getEy_nodal_flag) + + +def get_Ez_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Ez along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getEz_nodal_flag) + + +def get_Bx_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Bx along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getBx_nodal_flag) + + +def get_By_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for By along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getBy_nodal_flag) + + +def get_Bz_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Bz along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getBz_nodal_flag) + + +def get_Jx_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Jx along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getJx_nodal_flag) + + +def get_Jy_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Jy along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getJy_nodal_flag) + + +def get_Jz_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Jz along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getJz_nodal_flag) + + +def get_Rho_nodal_flag(): + ''' + This returns a 1d array of the nodal flags for Rho along each direction. A 1 means node centered, and 0 cell centered. + ''' + return _get_nodal_flag(libwarpx.warpx_getRho_nodal_flag) diff --git a/Python/pywarpx/fields.py b/Python/pywarpx/fields.py index 69aa25185..eeed3283d 100644 --- a/Python/pywarpx/fields.py +++ b/Python/pywarpx/fields.py @@ -29,23 +29,24 @@ class _MultiFABWrapper(object): This provides a convenient way to query and set fields that are broken up into FABs. The indexing is based on global indices. - direction: component to access, one of the values (0, 1, 2) or None - - overlaps: is one along the axes where the grid boundaries overlap the neighboring grid - get_lovects: routine that returns the list of lo vectors - get_fabs: routine that returns the list of FABs + - get_nodal_flag: routine that returns the list of nodal flag - level: refinement level """ - def __init__(self, direction, overlaps, get_lovects, get_fabs, level, include_ghosts=False): + def __init__(self, direction, get_lovects, get_fabs, get_nodal_flag, level, include_ghosts=False): self.direction = direction - self.overlaps = np.array(overlaps) self.get_lovects = get_lovects self.get_fabs = get_fabs + self.get_nodal_flag = get_nodal_flag self.level = level self.include_ghosts = include_ghosts self.dim = _libwarpx.dim - if self.dim == 2: - # --- Grab the first and last overlaps (for x and z) - self.overlaps = self.overlaps[::2] + + # overlaps is one along the axes where the grid boundaries overlap the neighboring grid, + # which is the case with node centering + self.overlaps = self.get_nodal_flag() def _getlovects(self): if self.direction is None: @@ -74,6 +75,48 @@ class _MultiFABWrapper(object): def __len__(self): return lend(self._getlovects()) + def mesh(self, direction): + """Returns the mesh along the specified direction with the appropriate centering. + - direction: In 3d, one of 'x', 'y', or 'z'. + In 2d, Cartesian, one of 'x', or 'z'. + In RZ, one of 'r', or 'z' + """ + + try: + if _libwarpx.geometry_dim == '3d': + idir = ['x', 'y', 'z'].index(direction) + celldir = idir + elif _libwarpx.geometry_dim == '2d': + idir = ['x', 'z'].index(direction) + celldir = 2*idir + elif _libwarpx.geometry_dim == 'rz': + idir = ['r', 'z'].index(direction) + celldir = 2*idir + except ValueError: + raise Exception('Inappropriate direction given') + + # --- Get the total number of cells along the direction + hivects = self._gethivects() + nn = hivects[idir,:].max() - self.nghosts + self.overlaps[idir] + if npes > 1: + nn = comm_world.allreduce(nn, op=mpi.MAX) + + # --- Cell size in the direction + dd = _libwarpx.getCellSize(celldir, self.level) + + # --- Get the nodal flag along direction + nodal_flag = self.get_nodal_flag()[idir] + + # --- The centering shift + if nodal_flag == 1: + # node centered + shift = 0. + else: + # cell centered + shift = 0.5*dd + + return np.arange(nn)*dd + shift + def __getitem__(self, index): """Returns slices of a decomposed array, The shape of the object returned depends on the number of ix, iy and iz specified, which @@ -465,301 +508,348 @@ class _MultiFABWrapper(object): def ExWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_electric_field_lovects, get_fabs=_libwarpx.get_mesh_electric_field, + get_nodal_flag=_libwarpx.get_Ex_nodal_flag, level=level, include_ghosts=include_ghosts) def EyWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_electric_field_lovects, get_fabs=_libwarpx.get_mesh_electric_field, + get_nodal_flag=_libwarpx.get_Ey_nodal_flag, level=level, include_ghosts=include_ghosts) def EzWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_electric_field_lovects, get_fabs=_libwarpx.get_mesh_electric_field, + get_nodal_flag=_libwarpx.get_Ez_nodal_flag, level=level, include_ghosts=include_ghosts) def BxWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[1,0,0], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_magnetic_field_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field, + get_nodal_flag=_libwarpx.get_Bx_nodal_flag, level=level, include_ghosts=include_ghosts) def ByWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[0,1,0], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_magnetic_field_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field, + get_nodal_flag=_libwarpx.get_By_nodal_flag, level=level, include_ghosts=include_ghosts) def BzWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[0,0,1], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_magnetic_field_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field, + get_nodal_flag=_libwarpx.get_Bz_nodal_flag, level=level, include_ghosts=include_ghosts) def JxWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_current_density_lovects, get_fabs=_libwarpx.get_mesh_current_density, + get_nodal_flag=_libwarpx.get_Jx_nodal_flag, level=level, include_ghosts=include_ghosts) def JyWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_current_density_lovects, get_fabs=_libwarpx.get_mesh_current_density, + get_nodal_flag=_libwarpx.get_Jy_nodal_flag, level=level, include_ghosts=include_ghosts) def JzWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_current_density_lovects, get_fabs=_libwarpx.get_mesh_current_density, + get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) def ExCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_electric_field_cp_lovects, get_fabs=_libwarpx.get_mesh_electric_field_cp, + get_nodal_flag=_libwarpx.get_Ex_nodal_flag, level=level, include_ghosts=include_ghosts) def EyCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_electric_field_cp_lovects, get_fabs=_libwarpx.get_mesh_electric_field_cp, + get_nodal_flag=_libwarpx.get_Ey_nodal_flag, level=level, include_ghosts=include_ghosts) def EzCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_electric_field_cp_lovects, get_fabs=_libwarpx.get_mesh_electric_field_cp, + get_nodal_flag=_libwarpx.get_Ez_nodal_flag, level=level, include_ghosts=include_ghosts) def BxCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=0, overlaps=[1,0,0], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_magnetic_field_cp_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field_cp, + get_nodal_flag=_libwarpx.get_Bx_nodal_flag, level=level, include_ghosts=include_ghosts) def ByCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=1, overlaps=[0,1,0], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_magnetic_field_cp_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field_cp, + get_nodal_flag=_libwarpx.get_By_nodal_flag, level=level, include_ghosts=include_ghosts) def BzCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=2, overlaps=[0,0,1], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_magnetic_field_cp_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field_cp, + get_nodal_flag=_libwarpx.get_Bz_nodal_flag, level=level, include_ghosts=include_ghosts) def JxCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_current_density_cp_lovects, get_fabs=_libwarpx.get_mesh_current_density_cp, + get_nodal_flag=_libwarpx.get_Jx_nodal_flag, level=level, include_ghosts=include_ghosts) def JyCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_current_density_cp_lovects, get_fabs=_libwarpx.get_mesh_current_density_cp, + get_nodal_flag=_libwarpx.get_Jy_nodal_flag, level=level, include_ghosts=include_ghosts) def JzCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_current_density_cp_lovects, get_fabs=_libwarpx.get_mesh_current_density_cp, + get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) def RhoCPWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=None, overlaps=[1,1,0], + return _MultiFABWrapper(direction=None, get_lovects=_libwarpx.get_mesh_charge_density_cp_lovects, get_fabs=_libwarpx.get_mesh_charge_density_cp, + get_nodal_flag=_libwarpx.get_Rho_nodal_flag, level=level, include_ghosts=include_ghosts) def ExFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects, get_fabs=_libwarpx.get_mesh_electric_field_fp, + get_nodal_flag=_libwarpx.get_Ex_nodal_flag, level=level, include_ghosts=include_ghosts) def EyFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects, get_fabs=_libwarpx.get_mesh_electric_field_fp, + get_nodal_flag=_libwarpx.get_Ey_nodal_flag, level=level, include_ghosts=include_ghosts) def EzFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects, get_fabs=_libwarpx.get_mesh_electric_field_fp, + get_nodal_flag=_libwarpx.get_Ez_nodal_flag, level=level, include_ghosts=include_ghosts) def BxFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[1,0,0], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_magnetic_field_fp_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field_fp, + get_nodal_flag=_libwarpx.get_Bx_nodal_flag, level=level, include_ghosts=include_ghosts) def ByFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[0,1,0], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_magnetic_field_fp_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field_fp, + get_nodal_flag=_libwarpx.get_By_nodal_flag, level=level, include_ghosts=include_ghosts) def BzFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[0,0,1], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_magnetic_field_fp_lovects, get_fabs=_libwarpx.get_mesh_magnetic_field_fp, + get_nodal_flag=_libwarpx.get_Bz_nodal_flag, level=level, include_ghosts=include_ghosts) def JxFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_current_density_fp_lovects, get_fabs=_libwarpx.get_mesh_current_density_fp, + get_nodal_flag=_libwarpx.get_Jx_nodal_flag, level=level, include_ghosts=include_ghosts) def JyFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_current_density_fp_lovects, get_fabs=_libwarpx.get_mesh_current_density_fp, + get_nodal_flag=_libwarpx.get_Jy_nodal_flag, level=level, include_ghosts=include_ghosts) def JzFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_current_density_fp_lovects, get_fabs=_libwarpx.get_mesh_current_density_fp, + get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) def RhoFPWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=None, overlaps=[1,1,1], + return _MultiFABWrapper(direction=None, get_lovects=_libwarpx.get_mesh_charge_density_fp_lovects, get_fabs=_libwarpx.get_mesh_charge_density_fp, + get_nodal_flag=_libwarpx.get_Rho_nodal_flag, level=level, include_ghosts=include_ghosts) def ExCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_electric_field_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_electric_field_cp_pml, + get_nodal_flag=_libwarpx.get_Ex_nodal_flag, level=level, include_ghosts=include_ghosts) def EyCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_electric_field_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_electric_field_cp_pml, + get_nodal_flag=_libwarpx.get_Ey_nodal_flag, level=level, include_ghosts=include_ghosts) def EzCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_electric_field_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_electric_field_cp_pml, + get_nodal_flag=_libwarpx.get_Ez_nodal_flag, level=level, include_ghosts=include_ghosts) def BxCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=0, overlaps=[1,0,0], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_magnetic_field_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_magnetic_field_cp_pml, + get_nodal_flag=_libwarpx.get_Bx_nodal_flag, level=level, include_ghosts=include_ghosts) def ByCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=1, overlaps=[0,1,0], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_magnetic_field_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_magnetic_field_cp_pml, + get_nodal_flag=_libwarpx.get_By_nodal_flag, level=level, include_ghosts=include_ghosts) def BzCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=2, overlaps=[0,0,1], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_magnetic_field_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_magnetic_field_cp_pml, + get_nodal_flag=_libwarpx.get_Bz_nodal_flag, level=level, include_ghosts=include_ghosts) def JxCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_current_density_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_current_density_cp_pml, + get_nodal_flag=_libwarpx.get_Jx_nodal_flag, level=level, include_ghosts=include_ghosts) def JyCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_current_density_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_current_density_cp_pml, + get_nodal_flag=_libwarpx.get_Jy_nodal_flag, level=level, include_ghosts=include_ghosts) def JzCPPMLWrapper(level=1, include_ghosts=False): assert level>0, Exception('Coarse patch only available on levels > 0') - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_current_density_cp_lovects_pml, get_fabs=_libwarpx.get_mesh_current_density_cp_pml, + get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) def ExFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_electric_field_fp_pml, + get_nodal_flag=_libwarpx.get_Ex_nodal_flag, level=level, include_ghosts=include_ghosts) def EyFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_electric_field_fp_pml, + get_nodal_flag=_libwarpx.get_Ey_nodal_flag, level=level, include_ghosts=include_ghosts) def EzFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_electric_field_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_electric_field_fp_pml, + get_nodal_flag=_libwarpx.get_Ez_nodal_flag, level=level, include_ghosts=include_ghosts) def BxFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[1,0,0], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_magnetic_field_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_magnetic_field_fp_pml, + get_nodal_flag=_libwarpx.get_Bx_nodal_flag, level=level, include_ghosts=include_ghosts) def ByFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[0,1,0], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_magnetic_field_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_magnetic_field_fp_pml, + get_nodal_flag=_libwarpx.get_By_nodal_flag, level=level, include_ghosts=include_ghosts) def BzFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[0,0,1], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_magnetic_field_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_magnetic_field_fp_pml, + get_nodal_flag=_libwarpx.get_Bz_nodal_flag, level=level, include_ghosts=include_ghosts) def JxFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=0, overlaps=[0,1,1], + return _MultiFABWrapper(direction=0, get_lovects=_libwarpx.get_mesh_current_density_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_current_density_fp_pml, + get_nodal_flag=_libwarpx.get_Jx_nodal_flag, level=level, include_ghosts=include_ghosts) def JyFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=1, overlaps=[1,0,1], + return _MultiFABWrapper(direction=1, get_lovects=_libwarpx.get_mesh_current_density_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_current_density_fp_pml, + get_nodal_flag=_libwarpx.get_Jy_nodal_flag, level=level, include_ghosts=include_ghosts) def JzFPPMLWrapper(level=0, include_ghosts=False): - return _MultiFABWrapper(direction=2, overlaps=[1,1,0], + return _MultiFABWrapper(direction=2, get_lovects=_libwarpx.get_mesh_current_density_fp_lovects_pml, get_fabs=_libwarpx.get_mesh_current_density_fp_pml, + get_nodal_flag=_libwarpx.get_Jz_nodal_flag, level=level, include_ghosts=include_ghosts) |