Skip to content

Commit aa87692

Browse files
feat: add initialization support
1 parent 4912067 commit aa87692

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/integrators/type.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end
2626
mutable struct SDDEIntegrator{algType, IIP, uType, uEltype, tType, P, eigenType,
2727
tTypeNoUnits, uEltypeNoUnits, randType, randType2, rateType,
2828
solType, cacheType, F, G, F6, OType, noiseType,
29-
EventErrorType, CallbackCacheType, H, IType} <:
29+
EventErrorType, CallbackCacheType, H, IType, IA} <:
3030
AbstractSDDEIntegrator{algType, IIP, uType, tType}
3131
f::F
3232
g::G
@@ -81,6 +81,7 @@ mutable struct SDDEIntegrator{algType, IIP, uType, uEltype, tType, P, eigenType,
8181
history::H
8282
stats::DiffEqBase.Stats
8383
integrator::IType # history integrator
84+
initializealg::IA
8485
end
8586

8687
function (integrator::SDDEIntegrator)(t, deriv::Type = Val{0}; idxs = nothing)

src/solve.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ function DiffEqBase.__init(prob::AbstractSDDEProblem,# TODO DiffEqBasee.Abstract
6666
# Keywords for Delay problems (from DDE)
6767
discontinuity_interp_points::Int = 10,
6868
discontinuity_abstol = eltype(prob.tspan)(1 // Int64(10)^12),
69-
discontinuity_reltol = 0, kwargs...) where {recompile_flag}
69+
discontinuity_reltol = 0,
70+
initializealg = StochasticDiffEq.SDEDefaultInit(), kwargs...) where {recompile_flag}
7071

7172
# alg = getalg(alg0);
7273
if prob.f isa Tuple
@@ -468,7 +469,7 @@ function DiffEqBase.__init(prob::AbstractSDDEProblem,# TODO DiffEqBasee.Abstract
468469
typeof(c),
469470
typeof(opts), typeof(noise), typeof(last_event_error),
470471
typeof(callback_cache), typeof(history),
471-
typeof(sde_integrator)}(f_with_history,
472+
typeof(sde_integrator), typeof(initializealg)}(f_with_history,
472473
g_with_history, c, noise, uprev,
473474
tprev,
474475
order_discontinuity_t0,
@@ -486,9 +487,10 @@ function DiffEqBase.__init(prob::AbstractSDDEProblem,# TODO DiffEqBasee.Abstract
486487
P,
487488
opts, iter, success_iter, eigen_est,
488489
EEst, q, QT(qoldinit), q11, history,
489-
stats, sde_integrator)
490+
stats, sde_integrator, initializealg)
490491

491492
if initialize_integrator
493+
DiffEqBase.initialize_dae!(integrator)
492494
StochasticDiffEq.initialize_callbacks!(integrator, initialize_save)
493495
initialize!(integrator, integrator.cache)
494496

0 commit comments

Comments
 (0)