GOMC-WSU / GOMC

GOMC - GPU Optimized Monte Carlo is a parallel molecular simulation code designed for high-performance simulation of large systems
https://gomc-wsu.org
MIT License
76 stars 36 forks source link

Fix #463: Simulations with Mie potential could produce NaNs and terminate #464

Closed LSchwiebert closed 2 years ago

LSchwiebert commented 2 years ago

Low values for the exponent (<= 6.0) could result in division by zero. This patch resolves issue #463 by doing better error handling on the input Mie potentials. Error messages are generated if the exponents are too small.

If epsilon = 0 then the exponent is adjusted to avoid division by zero and the simulation continues, as these exponents aren't used in this case.