diff options
author | 2021-12-16 10:12:57 -0800 | |
---|---|---|
committer | 2021-12-16 10:12:57 -0800 | |
commit | 746ddc2ae871e70cd50940c2cca03a17a9b7ec1a (patch) | |
tree | 37ba15e42ada9f89378894156214ab7b05699e66 /Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.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 'Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.py')
-rwxr-xr-x | Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.py b/Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.py index f6be14e5a..c9903ad22 100755 --- a/Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.py +++ b/Examples/Modules/ParticleBoundaryProcess/PICMI_inputs_reflection.py @@ -2,6 +2,7 @@ # # --- Input file to test particle reflection off an absorbing boundary +import pywarpx from pywarpx import picmi constants = picmi.constants @@ -114,22 +115,20 @@ sim.step(max_steps) # buffer functions as intended ################################################ -from pywarpx import _libwarpx - -n = _libwarpx.get_particle_boundary_buffer_size("electrons", 'z_hi') +n = pywarpx.get_particle_boundary_buffer_size("electrons", 'z_hi') print("Number of electrons in upper buffer:", n) assert n == 63 -n = _libwarpx.get_particle_boundary_buffer_size("electrons", 'z_lo') +n = pywarpx.get_particle_boundary_buffer_size("electrons", 'z_lo') print("Number of electrons in lower buffer:", n) assert n == 67 -scraped_steps = _libwarpx.get_particle_boundary_buffer("electrons", 'z_hi', 'step_scraped', 0) +scraped_steps = pywarpx.get_particle_boundary_buffer("electrons", 'z_hi', 'step_scraped', 0) for arr in scraped_steps: # print(arr) assert all(arr == 4) -scraped_steps = _libwarpx.get_particle_boundary_buffer("electrons", 'z_lo', 'step_scraped', 0) +scraped_steps = pywarpx.get_particle_boundary_buffer("electrons", 'z_lo', 'step_scraped', 0) for arr in scraped_steps: # print(arr) assert all(arr == 8) |