@@ -22,19 +22,46 @@ function DiffEqBase.__solve(
2222 }
2323 )
2424
25- if verbose
26- warned = ! isempty (kwargs) && check_keywords (alg, kwargs, warnlist)
27- if ! (prob. f isa DiffEqBase. AbstractParameterizedFunction) && isstiff
28- if DiffEqBase. has_tgrad (prob. f)
29- @warn " Explicit t-gradient given to this stiff solver is ignored."
30- warned = true
31- end
32- if DiffEqBase. has_jac (prob. f)
33- @warn " Explicit Jacobian given to this stiff solver is ignored."
34- warned = true
35- end
25+ # `verbose` may be a `Bool` (DiffEqBase v6) or a `DEVerbosity` / other
26+ # `AbstractVerbositySpecifier` (DiffEqBase v7+). Route each warning through
27+ # `@SciMLMessage` so a silent spec (e.g. `DEVerbosity(None())`) actually
28+ # suppresses it — a `verbose !== false` guard can't, since a silent
29+ # `DEVerbosity` is not `false`. The `:mismatched_input_output_type` toggle
30+ # is the right DEVerbosity bucket for these: every message here reports an
31+ # input the GeometricIntegrators solver cannot honor. For `Bool` verbose,
32+ # `@SciMLMessage` ignores the toggle name and just maps true→WarnLevel,
33+ # false→Silent.
34+ warned = false
35+ for (kw, val) in kwargs
36+ if kw in warnlist && val != = nothing
37+ @SciMLMessage (
38+ string (" The " , kw, " argument is ignored by " , alg, " ." ),
39+ verbose, :mismatched_input_output_type
40+ )
41+ warned = true
3642 end
37- warned && warn_compat ()
43+ end
44+ if ! (prob. f isa DiffEqBase. AbstractParameterizedFunction) && isstiff
45+ if DiffEqBase. has_tgrad (prob. f)
46+ @SciMLMessage (
47+ " Explicit t-gradient given to this stiff solver is ignored." ,
48+ verbose, :mismatched_input_output_type
49+ )
50+ warned = true
51+ end
52+ if DiffEqBase. has_jac (prob. f)
53+ @SciMLMessage (
54+ " Explicit Jacobian given to this stiff solver is ignored." ,
55+ verbose, :mismatched_input_output_type
56+ )
57+ warned = true
58+ end
59+ end
60+ if warned
61+ @SciMLMessage (
62+ " https://docs.sciml.ai/DiffEqDocs/stable/basics/compatibility_chart/" ,
63+ verbose, :mismatched_input_output_type
64+ )
3865 end
3966
4067 if callback != = nothing
@@ -68,15 +95,20 @@ function DiffEqBase.__solve(
6895 # Create function wrapper for GeometricIntegrators API
6996 # GeometricIntegrators expects: v(v, t, q, params)
7097 # DiffEqBase provides: f(du, u, p, t) for inplace or f(u, p, t) for out-of-place
98+ # SciMLBase v3's default AutoSpecialize wraps f in a FunctionWrappersWrapper that
99+ # only accepts the exact argument types captured at problem construction (e.g.
100+ # `Matrix{Float64}`), so passing a `Base.ReshapedArray` to it errors. Unwrap the
101+ # underlying user-defined function before invoking it.
102+ raw_f = SciMLBase. unwrapped_f (prob. f. f)
71103 if ! isinplace && u isa AbstractArray
72- v! = (v, t, q, params) -> (v .= vec (prob . f (reshape (q, sizeu), p, t)); nothing )
104+ v! = (v, t, q, params) -> (v .= vec (raw_f (reshape (q, sizeu), p, t)); nothing )
73105 elseif ! (u isa Vector{Float64})
74106 v! = (
75107 v, t, q,
76108 params,
77- ) -> (prob . f (reshape (v, sizeu), reshape (q, sizeu), p, t); nothing )
109+ ) -> (raw_f (reshape (v, sizeu), reshape (q, sizeu), p, t); nothing )
78110 else
79- v! = (v, t, q, params) -> prob . f (v, q, p, t)
111+ v! = (v, t, q, params) -> raw_f (v, q, p, t)
80112 end
81113
82114 ode = GeometricIntegrators. ODEProblem (v!, prob. tspan, dt, vec (prob. u0))
@@ -111,17 +143,21 @@ function DiffEqBase.__solve(
111143
112144 v! = (v, t, q, p_state, params) -> (v .= p_state) # dq/dt = p
113145
146+ # Unwrap past SciMLBase v3 AutoSpecialize FunctionWrappers for the acceleration
147+ # function so it accepts argument types other than those captured at construction.
148+ raw_f1 = SciMLBase. unwrapped_f (prob. f. f1. f)
149+
114150 # Handle both inplace and out-of-place problems
115151 if isinplace
116152 f! = (
117153 f_out, t, q, p_state,
118154 params,
119- ) -> (prob . f . f1 . f (f_out, p_state, q, p, t); nothing ) # dp/dt = f1(p, q)
155+ ) -> (raw_f1 (f_out, p_state, q, p, t); nothing ) # dp/dt = f1(p, q)
120156 else
121157 f! = (
122158 f_out, t, q, p_state,
123159 params,
124- ) -> (f_out .= prob . f . f1 . f (p_state, q, p, t); nothing )
160+ ) -> (f_out .= raw_f1 (p_state, q, p, t); nothing )
125161 end
126162
127163 pode = GeometricIntegrators. PODEProblem (
0 commit comments