From f9052c6d104dd77fd1b7e7b18602e76ee61a6c94 Mon Sep 17 00:00:00 2001 From: Qingyu Qu <2283984853@qq.com> Date: Sat, 23 Nov 2024 14:47:15 +0800 Subject: [PATCH] Add MaxNumSub return code --- Project.toml | 2 +- docs/src/interfaces/Solutions.md | 1 + src/retcodes.jl | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e926c8d1f..c809c13c2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.63.1" +version = "2.64.0" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/docs/src/interfaces/Solutions.md b/docs/src/interfaces/Solutions.md index 5c25e31f7..61723742b 100644 --- a/docs/src/interfaces/Solutions.md +++ b/docs/src/interfaces/Solutions.md @@ -81,6 +81,7 @@ SciMLBase.ReturnCode.Success SciMLBase.ReturnCode.Terminated SciMLBase.ReturnCode.DtNaN SciMLBase.ReturnCode.MaxIters +SciMLBase.ReturnCode.MaxNumSub SciMLBase.ReturnCode.DtLessThanMin SciMLBase.ReturnCode.Unstable SciMLBase.ReturnCode.InitialFailure diff --git a/src/retcodes.jl b/src/retcodes.jl index 0910331b5..8bf2409d0 100644 --- a/src/retcodes.jl +++ b/src/retcodes.jl @@ -149,6 +149,26 @@ EnumX.@enumx ReturnCode begin """ MaxIters + """ + ReturnCode.MaxNumSub + + A failure exit state of the solver. If this return code is given, then the + solving process was unsuccessful and exited early because during the solver's + adaptivity, mesh length exceeded the `max_num_subintervals` either set by default or specified + by users in the solver. + + ## Common Reasons for Seeing this Return Code + + - This commonly occurs in BVP solving if the original mesh are too coarse or + the tolerance are too stringent. It is recommended that in such cases, one tries to increase the default `max_num_subintervals` + in solvers, or decrease the tolerance. + + ## Properties + + - `successful_retcode` = `false` + """ + MaxNumSub + """ ReturnCode.DtLessThanMin @@ -417,6 +437,8 @@ function Base.convert(::Type{ReturnCode.T}, retcode::Symbol) ReturnCode.Terminated elseif retcode == :MaxIters || retcode == :MAXITERS_EXCEED ReturnCode.MaxIters + elseif retcode == :MaxNumSub + ReturnCode.MaxNumSub elseif retcode == :MaxTime || retcode == :TIME_LIMIT ReturnCode.MaxTime elseif retcode == :DtLessThanMin