Skip to content

Commit

Permalink
Add MaxNumSub return code
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikQQY committed Nov 23, 2024
1 parent c15f8a4 commit f9052c6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "2.63.1"
version = "2.64.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
1 change: 1 addition & 0 deletions docs/src/interfaces/Solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions src/retcodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f9052c6

Please sign in to comment.