aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/WarpX.py
diff options
context:
space:
mode:
authorGravatar Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com> 2021-12-22 15:32:36 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-22 23:32:36 +0000
commitd411310e45a370cfde872b25baa7a9f20bcf4966 (patch)
treecbb12f8fc9ba701a9d2a08701aaf46a99ea9ba31 /Python/pywarpx/WarpX.py
parentf73b3cd49c430c59b6750d5e65dfd19dcf44c752 (diff)
downloadWarpX-d411310e45a370cfde872b25baa7a9f20bcf4966.tar.gz
WarpX-d411310e45a370cfde872b25baa7a9f20bcf4966.tar.zst
WarpX-d411310e45a370cfde872b25baa7a9f20bcf4966.zip
Change _libwarpx.py functions to LibWarpX class methods (#2696)
* Initial attempt at moving function into LibWarpX * Bugfix - undefined structs in get_particle_theta This is untested, identified by IDE/visual inspection only * Unify newlines * Delete libwarpx.clight (duplicated picmi.py) See picmi.constants.c * Change function descriptive comment to docstring Also remove extra newline in __init__ beginning. * Replace pywarpx/_libwarpx calls appropriately * Fix atexit register of finalize function * Reorder WarpX.py imports for pre-commit * Use picmi.Simulation.extension = libwarpx alias This will hopefully preempt user script changes if we restructure things to allow multiple WarpX runs to be done within a single Python script. * Fix libwarpx ref in WarpX.getProbLo/getProbHi * Update get_particle_boundary_buffer doc reference
Diffstat (limited to 'Python/pywarpx/WarpX.py')
-rw-r--r--Python/pywarpx/WarpX.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py
index 8c4900fab..ece837816 100644
--- a/Python/pywarpx/WarpX.py
+++ b/Python/pywarpx/WarpX.py
@@ -5,7 +5,7 @@
#
# License: BSD-3-Clause-LBNL
-from . import Particles, _libwarpx
+from . import Particles
from .Algo import algo
from .Amr import amr
from .Boundary import boundary
@@ -19,6 +19,7 @@ from .Langmuirwave import langmuirwave
from .Lasers import lasers, lasers_list
from .PSATD import psatd
from .Particles import particles, particles_list
+from ._libwarpx import libwarpx
class WarpX(Bucket):
@@ -75,19 +76,19 @@ class WarpX(Bucket):
def init(self, mpi_comm=None):
argv = ['warpx'] + self.create_argv_list()
- _libwarpx.initialize(argv, mpi_comm=mpi_comm)
+ libwarpx.initialize(argv, mpi_comm=mpi_comm)
def evolve(self, nsteps=-1):
- _libwarpx.evolve(nsteps)
+ libwarpx.evolve(nsteps)
def finalize(self, finalize_mpi=1):
- _libwarpx.finalize(finalize_mpi)
+ libwarpx.finalize(finalize_mpi)
def getProbLo(self, direction):
- return _libwarpx.libwarpx.libwarpx_so.warpx_getProbLo(direction)
+ return libwarpx.libwarpx_so.warpx_getProbLo(direction)
def getProbHi(self, direction):
- return _libwarpx.libwarpx.libwarpx_so.warpx_getProbHi(direction)
+ return libwarpx.libwarpx_so.warpx_getProbHi(direction)
def write_inputs(self, filename='inputs', **kw):
argv = self.create_argv_list()