diff options
author | 2021-12-16 10:12:57 -0800 | |
---|---|---|
committer | 2021-12-16 10:12:57 -0800 | |
commit | 746ddc2ae871e70cd50940c2cca03a17a9b7ec1a (patch) | |
tree | 37ba15e42ada9f89378894156214ab7b05699e66 /Python/pywarpx/WarpX.py | |
parent | b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91 (diff) | |
download | WarpX-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/WarpX.py')
-rw-r--r-- | Python/pywarpx/WarpX.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py index 7b1a07e24..232550764 100644 --- a/Python/pywarpx/WarpX.py +++ b/Python/pywarpx/WarpX.py @@ -20,6 +20,8 @@ from .Collisions import collisions, collisions_list from .PSATD import psatd from .Diagnostics import diagnostics +from . import _libwarpx + class WarpX(Bucket): """ @@ -74,25 +76,20 @@ class WarpX(Bucket): return argv def init(self, mpi_comm=None): - from . import wx argv = ['warpx'] + self.create_argv_list() - wx.initialize(argv, mpi_comm=mpi_comm) + _libwarpx.initialize(argv, mpi_comm=mpi_comm) def evolve(self, nsteps=-1): - from . import wx - wx.evolve(nsteps) + _libwarpx.evolve(nsteps) def finalize(self, finalize_mpi=1): - from . import wx - wx.finalize(finalize_mpi) + _libwarpx.finalize(finalize_mpi) def getProbLo(self, direction): - from . import wx - return wx.libwarpx.warpx_getProbLo(direction) + return _libwarpx.libwarpx.libwarpx_so.warpx_getProbLo(direction) def getProbHi(self, direction): - from . import wx - return wx.libwarpx.warpx_getProbHi(direction) + return _libwarpx.libwarpx.libwarpx_so.warpx_getProbHi(direction) def write_inputs(self, filename='inputs', **kw): argv = self.create_argv_list() |