leetmaa / KMCLib

A kinetic Monte Carlo Python/C++ library.
GNU General Public License v3.0
119 stars 49 forks source link

Modify C++ time propagator #18

Closed xstl91 closed 3 years ago

xstl91 commented 7 years ago

When I use the program, sometimes I'll get "inf" for simulation time. I guess this may be caused by the random number generated. Therefore, I use a loop in SimulationTimer::propagateTime function to avoid a random number of zero, which may cause the time being infinity. Hope this may help.

PytLab commented 7 years ago

Hello, I think using the std::isinf in standard library to check the extremely small random float number is more appropriate :)

xstl91 commented 7 years ago

Thank you for your advice. I've changed it accordingly.