diff --git a/src/Integrators.jl b/src/Integrators.jl index 92cbf8496..d0b09ea86 100644 --- a/src/Integrators.jl +++ b/src/Integrators.jl @@ -19,15 +19,13 @@ mutable struct Langevin Δt :: Float64 λ :: Float64 kT :: Float64 -end -function Langevin(Δt; λ, kT) - Δt <= 0 && error("Select positive Δt") - return Langevin(Δt, λ, kT) + function Langevin(Δt; λ, kT) + Δt <= 0 && error("Select positive Δt") + return new(Δt, λ, kT) + end end -Base.copy(dyn::Langevin) = Langevin(dyn.Δt, dyn.λ, dyn.kT) - """ ImplicitMidpoint(Δt::Float64; atol=1e-12) where N @@ -42,15 +40,14 @@ periods of simulation time. mutable struct ImplicitMidpoint Δt :: Float64 atol :: Float64 -end -function ImplicitMidpoint(Δt; atol=1e-12) - Δt <= 0 && error("Select positive Δt") - return ImplicitMidpoint(Δt, atol) + function ImplicitMidpoint(Δt; atol=1e-12) + Δt <= 0 && error("Select positive Δt") + return new(Δt, atol) + end end - ################################################################################ # Dipole integration ################################################################################