SunnySuite / Sunny.jl

Spin dynamics and generalization to SU(N) coherent states
Other
79 stars 19 forks source link

Print an error if non-positive dt is detected #192

Closed kbarros closed 9 months ago

kbarros commented 9 months ago

Print an error if non-positive dt is detected for the usual constructors of any of the integrators. There might be some internal use cases for negative dt; this can be achieved with a mutable update:

integrator = ImplicitMidpoint(0.1)
integrator.Δt *= -1

Also deprecate the Base.copy(dyn::Langevin) overload. For user code, the same can be achieved with deepcopy(dyn). It's not clear we want to recommend that to users, though. See https://github.com/SunnySuite/Sunny.jl/issues/193 for discussion.