diff --git a/engine/rk23.go b/engine/rk23.go index 7bac044aa..a207a743a 100644 --- a/engine/rk23.go +++ b/engine/rk23.go @@ -104,7 +104,7 @@ func (rk *RK23) Step() { rlerr = float64(cuda.MaxAbs(errnorm)) fail = 1 } - if fail == 0 || RelErr < 0.0 || rlerr < RelErr || Dt_si <= MinDt || FixDt != 0 { // mindt check to avoid infinite loop + if fail == 0 || RelErr <= 0.0 || rlerr < RelErr || Dt_si <= MinDt || FixDt != 0 { // mindt check to avoid infinite loop // step OK setLastErr(err) setMaxTorque(k4) diff --git a/engine/rk45dp.go b/engine/rk45dp.go index 4579b5e73..ac453cd4a 100644 --- a/engine/rk45dp.go +++ b/engine/rk45dp.go @@ -118,7 +118,7 @@ func (rk *RK45DP) Step() { rlerr = float64(cuda.MaxAbs(errnorm)) fail = 1 } - if fail == 0 || RelErr < 0.0 || rlerr < RelErr || Dt_si <= MinDt || FixDt != 0 { // mindt check to avoid infinite loop + if fail == 0 || RelErr <= 0.0 || rlerr < RelErr || Dt_si <= MinDt || FixDt != 0 { // mindt check to avoid infinite loop // step OK setLastErr(err) setMaxTorque(k7) diff --git a/engine/rk56.go b/engine/rk56.go index 4cbb91abf..18009b1fb 100644 --- a/engine/rk56.go +++ b/engine/rk56.go @@ -128,7 +128,7 @@ func (rk *RK56) Step() { rlerr = float64(cuda.MaxAbs(errnorm)) fail = 1 } - if fail == 0 || RelErr < 0.0 || rlerr < RelErr || Dt_si <= MinDt || FixDt != 0 { // mindt check to avoid infinite loop + if fail == 0 || RelErr <= 0.0 || rlerr < RelErr || Dt_si <= MinDt || FixDt != 0 { // mindt check to avoid infinite loop // step OK setLastErr(err) setMaxTorque(k2)