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/WarpXPIC.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/WarpXPIC.py')
-rw-r--r-- | Python/pywarpx/WarpXPIC.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Python/pywarpx/WarpXPIC.py b/Python/pywarpx/WarpXPIC.py index 241951d13..e98ff823d 100644 --- a/Python/pywarpx/WarpXPIC.py +++ b/Python/pywarpx/WarpXPIC.py @@ -17,46 +17,46 @@ from ._libwarpx import libwarpx class WarpXPIC(PICAPI): def get_time(self): - return libwarpx.warpx_gett_new(0) + return libwarpx.libwarpx_so.warpx_gett_new(0) def set_time(self, time): - for i in range(libwarpx.warpx_finestLevel()+1): - libwarpx.warpx_sett_new(i, time) + for i in range(libwarpx.libwarpx_so.warpx_finestLevel()+1): + libwarpx.libwarpx_so.warpx_sett_new(i, time) def get_step_size(self): - libwarpx.warpx_ComputeDt() - return libwarpx.warpx_getdt(0) + libwarpx.libwarpx_so.warpx_ComputeDt() + return libwarpx.libwarpx_so.warpx_getdt(0) def get_step_number(self): - return libwarpx.warpx_getistep(0) + return libwarpx.libwarpx_so.warpx_getistep(0) def set_step_number(self, it): - for i in range(libwarpx.warpx_finestLevel()+1): - libwarpx.warpx_setistep(i, it) + for i in range(libwarpx.libwarpx_so.warpx_finestLevel()+1): + libwarpx.libwarpx_so.warpx_setistep(i, it) def push_positions(self, dt): - libwarpx.warpx_PushX(0, dt) + libwarpx.libwarpx_so.warpx_PushX(0, dt) def push_velocities_withE(self, dt): - libwarpx.warpx_EPushV(0, dt) + libwarpx.libwarpx_so.warpx_EPushV(0, dt) def push_velocities_withB(self, dt): - libwarpx.warpx_BPushV(0, dt) + libwarpx.libwarpx_so.warpx_BPushV(0, dt) def get_self_fields(self): - libwarpx.warpx_FieldGather(0) + libwarpx.libwarpx_so.warpx_FieldGather(0) def calculate_source(self): - libwarpx.warpx_CurrentDeposition(0) + libwarpx.libwarpx_so.warpx_CurrentDeposition(0) def push_Efields(self, dt): - libwarpx.warpx_EvolveE(0, dt) - libwarpx.warpx_FillBoundaryE(0, True) + libwarpx.libwarpx_so.warpx_EvolveE(0, dt) + libwarpx.libwarpx_so.warpx_FillBoundaryE(0, True) def push_Bfields(self, dt): - libwarpx.warpx_EvolveB(0, dt) - libwarpx.warpx_FillBoundaryB(0, True) + libwarpx.libwarpx_so.warpx_EvolveB(0, dt) + libwarpx.libwarpx_so.warpx_FillBoundaryB(0, True) def apply_particle_boundary_conditions(self): - libwarpx.mypc_Redistribute() # Redistribute particles - libwarpx.warpx_MoveWindow(self.istep,True) # !!! not the correct place yet + libwarpx.libwarpx_so.mypc_Redistribute() # Redistribute particles + libwarpx.libwarpx_so.warpx_MoveWindow(self.istep,True) # !!! not the correct place yet |