forked from SciML/OrdinaryDiffEq.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiffEqBase.jl
More file actions
183 lines (142 loc) · 6.29 KB
/
DiffEqBase.jl
File metadata and controls
183 lines (142 loc) · 6.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
module DiffEqBase
if isdefined(Base, :Experimental) &&
isdefined(Base.Experimental, Symbol("@max_methods"))
@eval Base.Experimental.@max_methods 1
end
import PrecompileTools
import FastPower
using ArrayInterface
using StaticArraysCore # data arrays
using LinearAlgebra, Printf
using DocStringExtensions
using FunctionWrappers: FunctionWrapper
using MuladdMacro
using FastBroadcast: @.., Serial, Threaded
import RecursiveArrayTools
import TruncatedStacktraces
using Setfield
using Markdown
using ConcreteStructs: @concrete
using FastClosures: @closure
import FunctionWrappersWrappers
using SciMLBase
using SciMLLogging: SciMLLogging, AbstractVerbositySpecifier, AbstractVerbosityPreset,
None, Minimal, Standard, Detailed, All, Silent, InfoLevel, WarnLevel, ErrorLevel,
CustomLevel, AbstractMessageLevel, @verbosity_specifier, verbosity_to_bool
using SciMLOperators: AbstractSciMLOperator, AbstractSciMLScalarOperator, DEFAULT_UPDATE_FUNC
using SciMLBase: @def, DEIntegrator, AbstractDEProblem,
AbstractDiffEqInterpolation,
DECallback, AbstractDEOptions, DECache, AbstractContinuousCallback,
AbstractDiscreteCallback, AbstractLinearProblem,
AbstractNonlinearProblem,
AbstractOptimizationProblem, AbstractSteadyStateProblem,
AbstractJumpProblem,
AbstractNoiseProblem, AbstractEnsembleProblem,
AbstractDynamicalODEProblem,
AbstractDEAlgorithm, StandardODEProblem, AbstractIntegralProblem,
AbstractSensitivityAlgorithm, AbstractODEAlgorithm,
AbstractSDEAlgorithm, AbstractDDEAlgorithm, AbstractDAEAlgorithm,
AbstractSDDEAlgorithm, AbstractRODEAlgorithm, AbstractBVPAlgorithm,
DAEInitializationAlgorithm,
AbstractSteadyStateAlgorithm, AbstractODEProblem,
AbstractDiscreteProblem, AbstractNonlinearAlgorithm,
AbstractSDEProblem, AbstractRODEProblem, AbstractDDEProblem,
AbstractDAEProblem, AbstractSDDEProblem, AbstractBVProblem,
AbstractTimeseriesSolution, AbstractNoTimeSolution, numargs,
AbstractODEFunction, AbstractSDEFunction, AbstractRODEFunction,
AbstractDDEFunction, AbstractSDDEFunction, AbstractDAEFunction,
AbstractNonlinearFunction, AbstractEnsembleSolution,
AbstractODESolution, AbstractRODESolution, AbstractDAESolution,
AbstractDDESolution,
EnsembleAlgorithm, EnsembleSolution, EnsembleSummary,
NonlinearSolution,
TimeGradientWrapper, TimeDerivativeWrapper, UDerivativeWrapper,
UJacobianWrapper, ParamJacobianWrapper, JacobianWrapper,
check_error!, has_jac, has_tgrad, has_Wfact, has_Wfact_t, has_paramjac,
AbstractODEIntegrator, AbstractSDEIntegrator, AbstractRODEIntegrator,
AbstractDDEIntegrator, AbstractSDDEIntegrator,
AbstractDAEIntegrator, unwrap_cache, has_reinit, reinit!,
postamble!, last_step_failed, islinear, has_stats,
initialize_dae!, build_solution, solution_new_retcode,
solution_new_tslocation, plot_indices, NonlinearAliasSpecifier,
NullParameters, isinplace, AbstractADType, AbstractDiscretization,
DISCRETE_OUTOFPLACE_DEFAULT, DISCRETE_INPLACE_DEFAULT,
has_analytic, calculate_solution_errors!, AbstractNoiseProcess,
has_colorvec, parameterless_type, undefined_exports,
is_diagonal_noise, AbstractDiffEqFunction, sensitivity_solution,
interp_summary, AbstractHistoryFunction, LinearInterpolation,
ConstantInterpolation, HermiteInterpolation, SensitivityInterpolation,
NoAD, @add_kwonly,
calculate_ensemble_errors, isconstant,
DEFAULT_REDUCTION, isautodifferentiable,
isadaptive, isdiscrete, has_syms, AbstractAnalyticalSolution,
RECOMPILE_BY_DEFAULT, wrap_sol
import SciMLBase: solve, init, step!, solve!, __init, __solve, update_coefficients!,
update_coefficients, isadaptive, wrapfun_oop, wrapfun_iip,
unwrap_fw, promote_tspan, set_u!, set_t!, set_ut!,
extract_alg, checkkwargs, has_kwargs, _concrete_solve_adjoint, _concrete_solve_forward,
eltypedual, get_updated_symbolic_problem, get_concrete_p, get_concrete_u0, promote_u0,
isconcreteu0, isconcretedu0, get_concrete_du0, _reshape, value, unitfulvalue, anyeltypedual, allowedkeywords,
sse, totallength, __sum, DualEltypeChecker, KeywordArgError, KeywordArgWarn, KeywordArgSilent, KWARGWARN_MESSAGE, KWARGERROR_MESSAGE,
CommonKwargError, IncompatibleInitialConditionError, NO_DEFAULT_ALGORITHM_MESSAGE, NoDefaultAlgorithmError, NO_TSPAN_MESSAGE, NoTspanError,
NAN_TSPAN_MESSAGE, NaNTspanError, NON_SOLVER_MESSAGE, NonSolverError, NOISE_SIZE_MESSAGE, NoiseSizeIncompatibilityError, PROBSOLVER_PAIRING_MESSAGE,
ProblemSolverPairingError, compatible_problem_types, DIRECT_AUTODIFF_INCOMPATIBILITY_MESSAGE, DirectAutodiffError, NONNUMBER_ELTYPE_MESSAGE, NonNumberEltypeError,
GENERIC_NUMBER_TYPE_ERROR_MESSAGE, GenericNumberTypeError, COMPLEX_SUPPORT_ERROR_MESSAGE, ComplexSupportError, COMPLEX_TSPAN_ERROR_MESSAGE, ComplexTspanError,
TUPLE_STATE_ERROR_MESSAGE, TupleStateError, MASS_MATRIX_ERROR_MESSAGE, IncompatibleMassMatrixError, LATE_BINDING_TSTOPS_ERROR_MESSAGE, LateBindingTstopsNotSupportedError,
NONCONCRETE_ELTYPE_MESSAGE, NonConcreteEltypeError, _vec
import SciMLStructures
using Reexport
Reexport.@reexport using SciMLBase
SciMLBase.isfunctionwrapper(x::FunctionWrapper) = true
# Rootfinder for callbacks
using BracketingNonlinearSolve: ModAB
import SymbolicIndexingInterface as SII
## Extension Functions
## Types
"""
$(TYPEDEF)
"""
abstract type Tableau end
"""
$(TYPEDEF)
"""
abstract type ODERKTableau <: Tableau end
"""
$(TYPEDEF)
"""
abstract type DECostFunction end
import SciMLBase: Void, unwrapped_f
include("utils.jl")
include("stats.jl")
include("calculate_residuals.jl")
include("tableaus.jl")
include("dae_initialization.jl")
include("callbacks.jl")
include("common_defaults.jl")
include("solve.jl")
include("internal_euler.jl")
include("norecompile.jl")
include("integrator_accessors.jl")
include("verbosity.jl")
# This is only used for oop stiff solvers
default_factorize(A) = lu(A; check = false)
if isdefined(SciMLBase, :AbstractParameterizedFunction)
import SciMLBase: AbstractParameterizedFunction
else
"""
$(TYPEDEF)
"""
abstract type AbstractParameterizedFunction{iip} <: AbstractODEFunction{iip} end
end
"""
$(TYPEDEF)
"""
struct ConvergenceSetup{P, C}
probs::P
convergence_axis::C
end
export DEVerbosity
export initialize!, finalize!
export SensitivityADPassThrough
include("precompilation.jl")
end # module