aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/fields.py
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2021-12-16 10:12:57 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-16 10:12:57 -0800
commit746ddc2ae871e70cd50940c2cca03a17a9b7ec1a (patch)
tree37ba15e42ada9f89378894156214ab7b05699e66 /Python/pywarpx/fields.py
parentb0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91 (diff)
downloadWarpX-746ddc2ae871e70cd50940c2cca03a17a9b7ec1a.tar.gz
WarpX-746ddc2ae871e70cd50940c2cca03a17a9b7ec1a.tar.zst
WarpX-746ddc2ae871e70cd50940c2cca03a17a9b7ec1a.zip
Wrap shared object in a class to control its loading (#2637)
* Wrap shared object in a class to control its loading * Fix libwarpx attribute references * Updated callbacks.py for updated libwarpx * Removed the wx module plus other clean up * Further revision of how to use the pywarpx module. Now, _libwarpx should not be imported by external scripts except in special circumstances. * Updated documentation * Clean up end of line whitespace * Added more wrapping routines plus some clean up * Fixed use of pywarpx in two examples * Fix for getistep * Fixed for the EB Python interface * Silence a warning for our wrapper Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Python/pywarpx/fields.py')
-rw-r--r--Python/pywarpx/fields.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/pywarpx/fields.py b/Python/pywarpx/fields.py
index cb63a8af4..6f4ec1c43 100644
--- a/Python/pywarpx/fields.py
+++ b/Python/pywarpx/fields.py
@@ -42,7 +42,7 @@ class _MultiFABWrapper(object):
self.level = level
self.include_ghosts = include_ghosts
- self.dim = _libwarpx.dim
+ self.dim = _libwarpx.libwarpx.dim
# overlaps is one along the axes where the grid boundaries overlap the neighboring grid,
# which is the case with node centering.
@@ -85,13 +85,13 @@ class _MultiFABWrapper(object):
"""
try:
- if _libwarpx.geometry_dim == '3d':
+ if _libwarpx.libwarpx.geometry_dim == '3d':
idir = ['x', 'y', 'z'].index(direction)
celldir = idir
- elif _libwarpx.geometry_dim == '2d':
+ elif _libwarpx.libwarpx.geometry_dim == '2d':
idir = ['x', 'z'].index(direction)
celldir = 2*idir
- elif _libwarpx.geometry_dim == 'rz':
+ elif _libwarpx.libwarpx.geometry_dim == 'rz':
idir = ['r', 'z'].index(direction)
celldir = 2*idir
elif _libwarpx.geometry_dim == '1d':
@@ -299,7 +299,7 @@ class _MultiFABWrapper(object):
if ncomps > 1 and ic is None:
sss = tuple(list(sss) + [ncomps])
# --- Create the array to be returned.
- resultglobal = np.zeros(sss, dtype=_libwarpx._numpy_real_dtype)
+ resultglobal = np.zeros(sss, dtype=_libwarpx.libwarpx._numpy_real_dtype)
datalist = []
for i in range(len(fields)):