Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"

[compat]
Compat = "2.2, 3.0, 4"
DataStructures = "0.18, 0.19"
DiffEqBase = "6.122"
DiffEqBase = "6.217"
FunctionWrappers = "1.0"
ODEInterface = "0.5"
Reexport = "0.2, 1.0"
SciMLBase = "1.73, 2, 3.1"
SciMLLogging = "1.9.1"
julia = "1.6"

[extras]
Expand Down
2 changes: 2 additions & 0 deletions src/ODEInterfaceDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module ODEInterfaceDiffEq
using LinearAlgebra: I
using SciMLBase: CallbackSet, ReturnCode, VectorContinuousCallback, check_keywords,
warn_compat
using SciMLLogging: SciMLLogging, @SciMLMessage
import DiffEqBase: DEVerbosity, DEFAULT_VERBOSE

import DiffEqBase: solve, initialize!, savevalues!

Expand Down
21 changes: 14 additions & 7 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ function DiffEqBase.__solve(
) where
{uType, tuptType, isinplace, AlgType <: ODEInterfaceAlgorithm}
tType = eltype(tuptType)
verbose_spec = DiffEqBase._process_verbose_param(verbose)

isstiff = alg isa ODEInterfaceImplicitAlgorithm
if verbose
if SciMLLogging.verbosity_to_bool(verbose_spec)
warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist)
if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) && isstiff
if DiffEqBase.has_tgrad(prob.f)
@warn("Explicit t-gradient given to this stiff solver is ignored.")
@SciMLMessage(
"Explicit t-gradient given to this stiff solver is ignored.",
verbose_spec, :mismatched_input_output_type
)
warned = true
end
end
Expand Down Expand Up @@ -120,7 +124,10 @@ function DiffEqBase.__solve(
o[:OUTPUTFCN] = outputfcn
if !(callbacks_internal.continuous_callbacks isa Tuple{}) || !isempty(saveat)
if alg isa Union{ddeabm, ddebdf}
@warn("saveat and continuous callbacks ignored for ddeabm and ddebdf")
@SciMLMessage(
"saveat and continuous callbacks ignored for ddeabm and ddebdf",
verbose_spec, :dense_output_saveat
)
o[:OUTPUTMODE] = ODEInterface.OUTPUTFCN_WODENSE
else
o[:OUTPUTMODE] = ODEInterface.OUTPUTFCN_DENSE
Expand Down Expand Up @@ -238,16 +245,16 @@ function DiffEqBase.__solve(

if retcode < 0
if retcode == -1
verbose && @warn("Input is not consistent.")
@SciMLMessage("Input is not consistent.", verbose_spec, :inconsistent_input)
return_retcode = ReturnCode.Failure
elseif retcode == -2
verbose && @warn("Interrupted. Larger maxiters is needed.")
@SciMLMessage("Interrupted. Larger maxiters is needed.", verbose_spec, :max_iters)
return_retcode = ReturnCode.MaxIters
elseif retcode == -3
verbose && @warn("Step size went too small.")
@SciMLMessage("Step size went too small.", verbose_spec, :dt_min_unstable)
return_retcode = ReturnCode.DtLessThanMin
elseif retcode == -4
verbose && @warn("Interrupted. Problem is probably stiff.")
@SciMLMessage("Interrupted. Problem is probably stiff.", verbose_spec, :stiff_detection)
return_retcode = ReturnCode.Unstable
end
else
Expand Down
Loading