Skip to content

Commit 34fefbc

Browse files
feat: add initializealg to SDEIntegrator
1 parent 9a28c57 commit 34fefbc

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Random = "1.6"
5252
RandomNumbers = "1.5.3"
5353
RecursiveArrayTools = "2, 3"
5454
Reexport = "0.2, 1.0"
55-
SciMLBase = "2.59.2"
55+
SciMLBase = "2.62"
5656
SciMLOperators = "0.2.9, 0.3"
5757
SparseArrays = "1.6"
5858
SparseDiffTools = "2"

src/integrators/type.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mutable struct SDEIntegrator{algType,IIP,uType,uEltype,tType,tdirType,P2,eigenType,tTypeNoUnits,uEltypeNoUnits,randType,randType2,rateType,solType,cacheType,F4,F5,F6,OType,noiseType,EventErrorType,CallbackCacheType,RCs} <: AbstractSDEIntegrator{algType,IIP,uType,tType}
1+
mutable struct SDEIntegrator{algType,IIP,uType,uEltype,tType,tdirType,P2,eigenType,tTypeNoUnits,uEltypeNoUnits,randType,randType2,rateType,solType,cacheType,F4,F5,F6,OType,noiseType,EventErrorType,CallbackCacheType,RCs,IA} <: AbstractSDEIntegrator{algType,IIP,uType,tType}
22
f::F4
33
g::F5
44
c::F6
@@ -43,4 +43,5 @@ mutable struct SDEIntegrator{algType,IIP,uType,uEltype,tType,tdirType,P2,eigenTy
4343
qold::tTypeNoUnits
4444
q11::tTypeNoUnits
4545
stats::DiffEqBase.Stats
46+
initializealg::IA
4647
end

src/solve.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function DiffEqBase.__init(
6666
userdata=nothing,
6767
initialize_integrator=true,
6868
seed = UInt64(0), alias_u0=false, alias_jumps = Threads.threadid()==1,
69+
initializealg = SDEDefaultInit(),
6970
kwargs...) where recompile_flag
7071

7172
prob = concrete_prob(_prob)
@@ -587,7 +588,8 @@ function DiffEqBase.__init(
587588
uBottomEltype,tType,typeof(tdir),typeof(p),
588589
typeof(eigen_est),QT,
589590
uEltypeNoUnits,typeof(W),typeof(P),rateType,typeof(sol),typeof(cache),
590-
FType,GType,CType,typeof(opts),typeof(noise),typeof(last_event_error),typeof(callback_cache),typeof(rate_constants)}(
591+
FType,GType,CType,typeof(opts),typeof(noise),typeof(last_event_error),typeof(callback_cache),typeof(rate_constants),
592+
typeof(initializealg)}(
591593
f,g,c,noise,uprev,tprev,t,u,p,tType(dt),tType(dt),tType(dt),dtcache,tspan[2],tdir,
592594
just_hit_tstop,do_error_check,isout,event_last_time,
593595
vector_event_last_time,last_event_error,accept_step,
@@ -597,7 +599,7 @@ function DiffEqBase.__init(
597599
alg,sol,
598600
cache,callback_cache,tType(dt),W,P,rate_constants,
599601
opts,iter,success_iter,eigen_est,EEst,q,
600-
QT(qoldinit),q11,stats)
602+
QT(qoldinit),q11,stats,initializealg)
601603

602604
if initialize_integrator
603605
initialize_callbacks!(integrator, initialize_save)

0 commit comments

Comments
 (0)