diff --git a/Project.toml b/Project.toml index a0f11d3..fb5313d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "SteadyStateDiffEq" uuid = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" -version = "2.2.0" +version = "2.2.1" [deps] ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471" diff --git a/src/solve.jl b/src/solve.jl index 5816159..ca5b6ea 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -13,9 +13,10 @@ function __get_tspan(u0, tspan::Number) (DiffEqBase.value(zero(tspan)), tspan)) end +infnorm(x) = norm(x,Inf) function DiffEqBase.__solve(prob::DiffEqBase.AbstractSteadyStateProblem, alg::DynamicSS, args...; abstol = 1e-8, reltol = 1e-6, odesolve_kwargs = (;), - save_idxs = nothing, termination_condition = SteadyStateDiffEqTerminationMode(), + save_idxs = nothing, termination_condition = NormTerminationMode(infnorm), kwargs...) tspan = __get_tspan(prob.u0, alg) diff --git a/test/core.jl b/test/core.jl index 7d067f3..7725265 100644 --- a/test/core.jl +++ b/test/core.jl @@ -76,10 +76,9 @@ sol2 = solve(prob, DynamicSS(Tsit5()); abstol = 1e-4) @test typeof(u0) == typeof(sol2.u) for termination_condition in [ - SteadyStateDiffEqTerminationMode(), SimpleNonlinearSolveTerminationMode(), - NormTerminationMode(), RelTerminationMode(), RelNormTerminationMode(), - AbsTerminationMode(), AbsNormTerminationMode(), RelSafeTerminationMode(), - AbsSafeTerminationMode(), RelSafeBestTerminationMode(), AbsSafeBestTerminationMode() + NormTerminationMode(SteadyStateDiffEq.infnorm), RelTerminationMode(), RelNormTerminationMode(SteadyStateDiffEq.infnorm), + AbsTerminationMode(), AbsNormTerminationMode(SteadyStateDiffEq.infnorm), RelSafeTerminationMode(SteadyStateDiffEq.infnorm), + AbsSafeTerminationMode(SteadyStateDiffEq.infnorm), RelSafeBestTerminationMode(SteadyStateDiffEq.infnorm), AbsSafeBestTerminationMode(SteadyStateDiffEq.infnorm) ] sol_tc = solve(prob, DynamicSS(Tsit5()); termination_condition) @show sol_tc.retcode, termination_condition