RustBCA
RustBCA copied to clipboard
[feature] Major refactor to enhance code organization, potentially improve performance
trafficstars
Is your feature request related to a problem? Please describe. RustBCA has some code consistency issues and organizational problems that should be fixed with a major refactor at some point in the future. Below is a non-complete list of the issues I'm aware of:
- interactions should be re-implemented as traits - see Issue #132
- structs should be made private, with fields accessible by method where needed
- some functions should be made methods; in particular:
choose_collision_partnerin bca.rssurface_refractionandrefraction_anglein particle.rsparticle_advanceandrotate_particlein particle.rsboundary_condition_planarandsurface_binding_energyin material.rs
- SoA (Struct of Arrays) should be considered for Particles over AoS - could improve performance significantly
- Electronic stopping should be broken into component functions so bits and pieces can be unit-tested
Additional context Biggest effect of this refactor will be easing development of alternative ways of running the code, preparing the code to be made a library for binary collisions first with the physics loop and I/O being optional, and making more parts of the code unit-testable.