RustBCA icon indicating copy to clipboard operation
RustBCA copied to clipboard

Need test coverage of all functions

Open drobnyjt opened this issue 5 years ago • 5 comments
trafficstars

drobnyjt avatar May 11 '20 19:05 drobnyjt

An essential step here would be to separate large, currently integrated functions into testable units - examples being the different forms of electronic stopping, or the different pieces thereof (mean ionization energy, etc.)

drobnyjt avatar May 15 '20 19:05 drobnyjt

Added integrated test for momentum conservation during binary collision. Setting this up caught a bug in the MAGIC implementation of the ZBL potential - the screening length used was incorrect, leading to the generation of NaNs. It also highlighted the need to separate a handful of lines of code in main.rs out into functions - the most obvious example being updating the recoil energy - but, the momentum conservation test works, for all energies and physics options tested, momentum is conserved to within an epsilon of 1E-12.

drobnyjt avatar May 19 '20 02:05 drobnyjt

Test coverage now includes rootfinder (both Newton and CPR (if built with --features cpr_rootfinder)). I need to write a polynomial rootfinder test.

Additionally, tests have been added for all the forms of the scattering integral - Gauss-Mehler, Gauss-Legendre, Mendenhall-Weller, and MAGIC.

drobnyjt avatar Sep 17 '20 04:09 drobnyjt

Mesh0D and Mesh2D are adequately tested, but units tests need to be written for Mesh1D.

drobnyjt avatar Mar 03 '21 05:03 drobnyjt

Added tests for the new planar surface binding potential and for the Sphere geometry.

drobnyjt avatar Mar 07 '21 03:03 drobnyjt