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
42 stars 15 forks source link

Fix to divide-by-zero blowup when normal vector is close to (1.0, 0.0… #247

Closed drobnyjt closed 6 months ago

drobnyjt commented 6 months ago

Thank you for your contribution to RustBCA!

Before submitting this PR, please make sure you have:

Fixes #246

Description

Added threshold for gimbal lock; currently using a delta of 1e-6.

Tests

Ran code-coupling in a realistic scenario with normal vectors extremely close to zero with many particles and did not see any issues.