|
1 | | -# const allowedkeywords = (:dense, |
2 | | -# :saveat, |
3 | | -# :save_idxs, |
4 | | -# :tstops, |
5 | | -# :tspan, |
6 | | -# :d_discontinuities, |
7 | | -# :save_everystep, |
8 | | -# :save_on, |
9 | | -# :save_start, |
10 | | -# :save_end, |
11 | | -# :initialize_save, |
12 | | -# :adaptive, |
13 | | -# :abstol, |
14 | | -# :reltol, |
15 | | -# :dt, |
16 | | -# :dtmax, |
17 | | -# :dtmin, |
18 | | -# :force_dtmin, |
19 | | -# :internalnorm, |
20 | | -# :controller, |
21 | | -# :gamma, |
22 | | -# :beta1, |
23 | | -# :beta2, |
24 | | -# :qmax, |
25 | | -# :qmin, |
26 | | -# :qsteady_min, |
27 | | -# :qsteady_max, |
28 | | -# :qoldinit, |
29 | | -# :failfactor, |
30 | | -# :calck, |
31 | | -# :alias_u0, |
32 | | -# :maxiters, |
33 | | -# :maxtime, |
34 | | -# :callback, |
35 | | -# :isoutofdomain, |
36 | | -# :unstable_check, |
37 | | -# :verbose, |
38 | | -# :merge_callbacks, |
39 | | -# :progress, |
40 | | -# :progress_steps, |
41 | | -# :progress_name, |
42 | | -# :progress_message, |
43 | | -# :progress_id, |
44 | | -# :timeseries_errors, |
45 | | -# :dense_errors, |
46 | | -# :weak_timeseries_errors, |
47 | | -# :weak_dense_errors, |
48 | | -# :wrap, |
49 | | -# :calculate_error, |
50 | | -# :initializealg, |
51 | | -# :alg, |
52 | | -# :save_noise, |
53 | | -# :delta, |
54 | | -# :seed, |
55 | | -# :alg_hints, |
56 | | -# :kwargshandle, |
57 | | -# :trajectories, |
58 | | -# :batch_size, |
59 | | -# :sensealg, |
60 | | -# :advance_to_tstop, |
61 | | -# :stop_at_next_tstop, |
62 | | -# :u0, |
63 | | -# :p, |
64 | | -# # These two are from the default algorithm handling |
65 | | -# :default_set, |
66 | | -# :second_time, |
67 | | -# # This is for DiffEqDevTools |
68 | | -# :prob_choice, |
69 | | -# # Jump problems |
70 | | -# :alias_jump, |
71 | | -# # This is for copying/deepcopying noise in StochasticDiffEq |
72 | | -# :alias_noise, |
73 | | -# # This is for SimpleNonlinearSolve handling for batched Nonlinear Solves |
74 | | -# :batch, |
75 | | -# # Shooting method in BVP needs to differentiate between these two categories |
76 | | -# :nlsolve_kwargs, |
77 | | -# :odesolve_kwargs, |
78 | | -# # If Solvers which internally use linsolve |
79 | | -# :linsolve_kwargs, |
80 | | -# # Solvers internally using EnsembleProblem |
81 | | -# :ensemblealg, |
82 | | -# # Fine Grained Control of Tracing (Storing and Logging) during Solve |
83 | | -# :show_trace, |
84 | | -# :trace_level, |
85 | | -# :store_trace, |
86 | | -# # Termination condition for solvers |
87 | | -# :termination_condition, |
88 | | -# # For AbstractAliasSpecifier |
89 | | -# :alias, |
90 | | -# # Parameter estimation with BVP |
91 | | -# :fit_parameters) |
92 | | - |
93 | | -# const KWARGWARN_MESSAGE = """ |
94 | | -# Unrecognized keyword arguments found. |
95 | | -# The only allowed keyword arguments to `solve` are: |
96 | | -# $allowedkeywords |
97 | | - |
98 | | -# See https://docs.sciml.ai/NonlinearSolve/stable/basics/solve/ for more details. |
99 | | - |
100 | | -# Set kwargshandle=KeywordArgError for an error message. |
101 | | -# Set kwargshandle=KeywordArgSilent to ignore this message. |
102 | | -# """ |
103 | | - |
104 | | -# const KWARGERROR_MESSAGE = """ |
105 | | -# Unrecognized keyword arguments found. |
106 | | -# The only allowed keyword arguments to `solve` are: |
107 | | -# $allowedkeywords |
108 | | - |
109 | | -# See https://docs.sciml.ai/NonlinearSolve/stable/basics/solve/ for more details. |
110 | | -# """ |
111 | | - |
112 | | -# struct CommonKwargError <: Exception |
113 | | -# kwargs::Any |
114 | | -# end |
115 | | - |
116 | | -# function Base.showerror(io::IO, e::CommonKwargError) |
117 | | -# println(io, KWARGERROR_MESSAGE) |
118 | | -# notin = collect(map(x -> x ∉ allowedkeywords, keys(e.kwargs))) |
119 | | -# unrecognized = collect(keys(e.kwargs))[notin] |
120 | | -# print(io, "Unrecognized keyword arguments: ") |
121 | | -# printstyled(io, unrecognized; bold = true, color = :red) |
122 | | -# print(io, "\n\n") |
123 | | -# println(io, TruncatedStacktraces.VERBOSE_MSG) |
124 | | -# end |
125 | | - |
126 | | -# @enum KeywordArgError KeywordArgWarn KeywordArgSilent |
127 | | - |
128 | | -# const INCOMPATIBLE_U0_MESSAGE = """ |
129 | | -# Initial condition incompatible with functional form. |
130 | | -# Detected an in-place function with an initial condition of type Number or SArray. |
131 | | -# This is incompatible because Numbers cannot be mutated, i.e. |
132 | | -# `x = 2.0; y = 2.0; x .= y` will error. |
133 | | - |
134 | | -# If using a immutable initial condition type, please use the out-of-place form. |
135 | | -# I.e. define the function `du=f(u,p,t)` instead of attempting to "mutate" the immutable `du`. |
136 | | - |
137 | | -# If your differential equation function was defined with multiple dispatches and one is |
138 | | -# in-place, then the automatic detection will choose in-place. In this case, override the |
139 | | -# choice in the problem constructor, i.e. `ODEProblem{false}(f,u0,tspan,p,kwargs...)`. |
140 | | - |
141 | | -# For a longer discussion on mutability vs immutability and in-place vs out-of-place, see: |
142 | | -# https://diffeq.sciml.ai/stable/tutorials/faster_ode_example/#Example-Accelerating-a-Non-Stiff-Equation:-The-Lorenz-Equation |
143 | | -# """ |
144 | | - |
145 | | -# struct IncompatibleInitialConditionError <: Exception end |
146 | | - |
147 | | -# function Base.showerror(io::IO, e::IncompatibleInitialConditionError) |
148 | | -# print(io, INCOMPATIBLE_U0_MESSAGE) |
149 | | -# println(io, TruncatedStacktraces.VERBOSE_MSG) |
150 | | -# end |
151 | | - |
152 | | -# const NO_DEFAULT_ALGORITHM_MESSAGE = """ |
153 | | -# Default algorithm choices require NonlinearSolve.jl. |
154 | | -# Please specify an algorithm (e.g., `solve(prob, NewtonRaphson())` or |
155 | | -# init(prob, NewtonRaphson()) or |
156 | | -# import NonlinearSolve.jl directly. |
157 | | - |
158 | | -# You can find the list of available solvers at https://diffeq.sciml.ai/stable/solvers/ode_solve/ |
159 | | -# and its associated pages. |
160 | | -# """ |
161 | | - |
162 | | -# struct NoDefaultAlgorithmError <: Exception end |
163 | | - |
164 | | -# function Base.showerror(io::IO, e::NoDefaultAlgorithmError) |
165 | | -# print(io, NO_DEFAULT_ALGORITHM_MESSAGE) |
166 | | -# println(io, TruncatedStacktraces.VERBOSE_MSG) |
167 | | -# end |
168 | | - |
169 | | -# const NON_SOLVER_MESSAGE = """ |
170 | | -# The arguments to solve are incorrect. |
171 | | -# The second argument must be a solver choice, `solve(prob,alg)` |
172 | | -# where `alg` is a `<: AbstractDEAlgorithm`, e.g. `Tsit5()`. |
173 | | - |
174 | | -# Please double check the arguments being sent to the solver. |
175 | | - |
176 | | -# You can find the list of available solvers at https://diffeq.sciml.ai/stable/solvers/ode_solve/ |
177 | | -# and its associated pages. |
178 | | -# """ |
179 | | - |
180 | | -# struct NonSolverError <: Exception end |
181 | | - |
182 | | -# function Base.showerror(io::IO, e::NonSolverError) |
183 | | -# print(io, NON_SOLVER_MESSAGE) |
184 | | -# println(io, TruncatedStacktraces.VERBOSE_MSG) |
185 | | -# end |
186 | | - |
187 | | -# const DIRECT_AUTODIFF_INCOMPATABILITY_MESSAGE = """ |
188 | | -# Incompatible solver + automatic differentiation pairing. |
189 | | -# The chosen automatic differentiation algorithm requires the ability |
190 | | -# for compiler transforms on the code which is only possible on pure-Julia |
191 | | -# solvers such as those from OrdinaryDiffEq.jl. Direct differentiation methods |
192 | | -# which require this ability include: |
193 | | - |
194 | | -# - Direct use of ForwardDiff.jl on the solver |
195 | | -# - `ForwardDiffSensitivity`, `ReverseDiffAdjoint`, `TrackerAdjoint`, and `ZygoteAdjoint` |
196 | | -# sensealg choices for adjoint differentiation. |
197 | | - |
198 | | -# Either switch the choice of solver to a pure Julia method, or change the automatic |
199 | | -# differentiation method to one that does not require such transformations. |
200 | | - |
201 | | -# For more details on automatic differentiation, adjoint, and sensitivity analysis |
202 | | -# of differential equations, see the documentation page: |
203 | | - |
204 | | -# https://diffeq.sciml.ai/stable/analysis/sensitivity/ |
205 | | -# """ |
206 | | - |
207 | | -# struct DirectAutodiffError <: Exception end |
208 | | - |
209 | | -# function Base.showerror(io::IO, e::DirectAutodiffError) |
210 | | -# println(io, DIRECT_AUTODIFF_INCOMPATABILITY_MESSAGE) |
211 | | -# println(io, TruncatedStacktraces.VERBOSE_MSG) |
212 | | -# end |
213 | | - |
214 | 1 | struct EvalFunc{F} <: Function |
215 | 2 | f::F |
216 | 3 | end |
|
0 commit comments