lcpp-org / RustBCA

A free, open-source Binary Collision Approximation (BCA) code for ion-material interactions including sputtering, implantation, and reflection
https://github.com/lcpp-org/RustBCA/wiki
GNU General Public License v3.0
41 stars 14 forks source link

[bug] Bindings sometimes output particles with zero energy or particles embedded in domain #145

Closed drobnyjt closed 3 years ago

drobnyjt commented 3 years ago

Description Python and C bindings occasionally produce particles that have zero energy or are embedded in the domain - this is inconvenient for the current use-case, coupling to a PIC code.

Expected behavior Perhaps this should be clarified in the naming of the library functions, but the bindings should be simply producing emitted particles that leave the RustBCA domain.

Additional context A best solution might involve adding library functions for other kinds of coupling - for example, to a material code like Xolotl.

drobnyjt commented 3 years ago

Turns out this was not a bug, but a design choice made long ago. The particle output consists of particle that have left the material (sputtered, reflected) OR those that were incident (implanted). For generic bindings, this makes sense - one might want to evolve the material composition of the wall alongside tracking emitted particles. So I'll close this issue unless it is determined that the particle filtering is too costly, in which case it may require a new version of the bindings.