diff --git a/src/perform_step/SROCK_perform_step.jl b/src/perform_step/SROCK_perform_step.jl index 046cfc7b..5e9eba74 100644 --- a/src/perform_step/SROCK_perform_step.jl +++ b/src/perform_step/SROCK_perform_step.jl @@ -14,7 +14,7 @@ cosh_inv = log(ω₀ + Sqrt_ω) # arcosh(ω₀) ω₁ = (Sqrt_ω*cosh(mdeg*cosh_inv))/(mdeg*sinh(mdeg*cosh_inv)) - if alg_interpretation(integrator.alg) == :Stratonovich + if SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich α = cosh(mdeg*cosh_inv)/(2*ω₀*cosh((mdeg-1)*cosh_inv)) γ = 1/(2*α) β = -γ @@ -42,7 +42,7 @@ k = integrator.f(uᵢ₋₁,p,tᵢ₋₁) u = dt*μ*k + ν*uᵢ₋₁ + κ*uᵢ₋₂ - if (i > mdeg - 2) && alg_interpretation(integrator.alg) == :Stratonovich + if (i > mdeg - 2) && SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich if i == mdeg - 1 gₘ₋₂ = integrator.g(uᵢ₋₁,p,tᵢ₋₁) if W.dW isa Number || !is_diagonal_noise(integrator.sol.prob) @@ -58,7 +58,7 @@ u .+= (β .* gₘ₋₂ .+ γ .* gₘ₋₁) .* W.dW end end - elseif (i == mdeg) && alg_interpretation(integrator.alg) == :Ito + elseif (i == mdeg) && SciMLBase.alg_interpretation(integrator.alg) == :Ito if W.dW isa Number gₘ₋₂ = integrator.g(uᵢ₋₁,p,tᵢ₋₁) uᵢ₋₂ = uᵢ₋₁ + sqrt(abs(dt))*gₘ₋₂ @@ -105,7 +105,7 @@ end cosh_inv = log(ω₀ + Sqrt_ω) # arcosh(ω₀) ω₁ = (Sqrt_ω*cosh(mdeg*cosh_inv))/(mdeg*sinh(mdeg*cosh_inv)) - if alg_interpretation(integrator.alg) == :Stratonovich + if SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich α = cosh(mdeg*cosh_inv)/(2*ω₀*cosh((mdeg-1)*cosh_inv)) γ = 1/(2*α) β = -γ @@ -132,7 +132,7 @@ end κ = - Tᵢ₋₂/Tᵢ integrator.f(k,uᵢ₋₁,p,tᵢ₋₁) @.. u = dt*μ*k + ν*uᵢ₋₁ + κ*uᵢ₋₂ - if (i > mdeg - 2) && alg_interpretation(integrator.alg) == :Stratonovich + if (i > mdeg - 2) && SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich if i == mdeg - 1 integrator.g(gₘ₋₂,uᵢ₋₁,p,tᵢ₋₁) if W.dW isa Number || is_diagonal_noise(integrator.sol.prob) @@ -152,7 +152,7 @@ end @.. u += γ*k end end - elseif (i == mdeg) && alg_interpretation(integrator.alg) == :Ito + elseif (i == mdeg) && SciMLBase.alg_interpretation(integrator.alg) == :Ito if W.dW isa Number || is_diagonal_noise(integrator.sol.prob) integrator.g(gₘ₋₂,uᵢ₋₁,p,tᵢ₋₁) @.. uᵢ₋₂ = uᵢ₋₁ + sqrt(abs(dt))*gₘ₋₂ diff --git a/src/perform_step/low_order.jl b/src/perform_step/low_order.jl index e5c85818..054ee5f5 100644 --- a/src/perform_step/low_order.jl +++ b/src/perform_step/low_order.jl @@ -208,11 +208,11 @@ end K = @.. uprev + dt * du1 L = integrator.g(uprev,p,t) mil_correction = zero(u) - if alg_interpretation(integrator.alg) == :Ito + if SciMLBase.alg_interpretation(integrator.alg) == :Ito utilde = K + L*integrator.sqdt ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt) mil_correction = ggprime.*(W.dW.^2 .- abs(dt))./2 - elseif alg_interpretation(integrator.alg) == :Stratonovich + elseif SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich utilde = uprev + L*integrator.sqdt ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt) mil_correction = ggprime.*(W.dW.^2)./2 @@ -241,11 +241,11 @@ end integrator.g(L,uprev,p,t) @.. K = uprev + dt * du1 @.. du2 = zero(eltype(u)) # This makes it safe to re-use the array - if alg_interpretation(integrator.alg) == :Ito + if SciMLBase.alg_interpretation(integrator.alg) == :Ito @.. tmp = K + integrator.sqdt * L integrator.g(du2,tmp,p,t) @.. tmp = (du2-L)/(2integrator.sqdt)*(W.dW.^2 - abs(dt)) - elseif alg_interpretation(integrator.alg) == :Stratonovich + elseif SciMLBase.alg_interpretation(integrator.alg) == :Stratonovich @.. tmp = uprev + integrator.sqdt * L integrator.g(du2,tmp,p,t) @.. tmp = (du2-L)/(2integrator.sqdt)*(W.dW.^2) @@ -275,7 +275,7 @@ end J = get_iterated_I(dt, dW, W.dZ, Jalg) mil_correction = zero(u) - if alg_interpretation(integrator.alg) == :Ito + if SciMLBase.alg_interpretation(integrator.alg) == :Ito if dW isa Number || is_diagonal_noise(integrator.sol.prob) J = J .- 1//2 .* abs(dt) else @@ -289,7 +289,7 @@ end K = uprev + dt*du1 if is_diagonal_noise(integrator.sol.prob) - tmp = (alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L + tmp = (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L gtmp = integrator.g(tmp,p,t) Dgj = (gtmp - L)/sqdt ggprime_norm = integrator.opts.internalnorm(Dgj,t) @@ -343,7 +343,7 @@ end J = Jalg.J @.. mil_correction = zero(u) - if alg_interpretation(integrator.alg) == :Ito + if SciMLBase.alg_interpretation(integrator.alg) == :Ito if dW isa Number || is_diagonal_noise(integrator.sol.prob) @.. J -= 1 // 2 * abs(dt) else @@ -357,7 +357,7 @@ end @.. K = uprev + dt*du1 if is_diagonal_noise(integrator.sol.prob) - tmp .= (alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L + tmp .= (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L integrator.g(gtmp,tmp,p,t) @.. Dgj = (gtmp - L)/sqdt ggprime_norm = integrator.opts.internalnorm(Dgj,t) @@ -397,7 +397,7 @@ end J = get_iterated_I(dt, dW, W.dZ, Jalg, integrator.alg.p, integrator.alg.c, alg_order(integrator.alg)) - if alg_interpretation(integrator.alg) == :Ito + if SciMLBase.alg_interpretation(integrator.alg) == :Ito if dW isa Number || is_diagonal_noise(integrator.sol.prob) J = J .- 1//2 .* abs(dt) else @@ -413,7 +413,7 @@ end if dW isa Number || is_diagonal_noise(integrator.sol.prob) K = @.. uprev + dt*du₁ - utilde = (alg_interpretation(integrator.alg) == :Ito ? K : uprev) + L*integrator.sqdt + utilde = (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) + L*integrator.sqdt ggprime = (integrator.g(utilde,p,t) .- L) ./ (integrator.sqdt) mil_correction = ggprime .* J u = K + L .* dW + mil_correction @@ -467,7 +467,7 @@ end @.. mil_correction = zero(eltype(u)) ggprime_norm = zero(eltype(ggprime)) - if alg_interpretation(integrator.alg) == :Ito + if SciMLBase.alg_interpretation(integrator.alg) == :Ito if dW isa Number || is_diagonal_noise(integrator.sol.prob) @.. J -= 1 // 2 * abs(dt) else @@ -478,7 +478,7 @@ end if dW isa Number || is_diagonal_noise(integrator.sol.prob) @.. K = uprev + dt*du₁ @.. du₂ = zero(eltype(u)) - tmp .= (alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L + tmp .= (SciMLBase.alg_interpretation(integrator.alg) == :Ito ? K : uprev) .+ integrator.sqdt .* L integrator.g(du₂,tmp,p,t) @.. ggprime = (du₂ - L)/sqdt ggprime_norm = integrator.opts.internalnorm(ggprime,t) diff --git a/src/perform_step/sdirk.jl b/src/perform_step/sdirk.jl index 00f346b2..7a325568 100644 --- a/src/perform_step/sdirk.jl +++ b/src/perform_step/sdirk.jl @@ -24,14 +24,14 @@ end if cache isa ImplicitRKMilConstantCache || integrator.opts.adaptive == true - if alg_interpretation(alg) == :Ito || + if SciMLBase.alg_interpretation(alg) == :Ito || cache isa ImplicitEMConstantCache K = @.. uprev + dt * ftmp utilde = K + L*integrator.sqdt ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt) mil_correction = ggprime .* (integrator.W.dW.^2 .- abs(dt))./2 gtmp += mil_correction - elseif alg_interpretation(alg) == :Stratonovich || + elseif SciMLBase.alg_interpretation(alg) == :Stratonovich || cache isa ImplicitEulerHeunConstantCache utilde = uprev + L*integrator.sqdt ggprime = (integrator.g(utilde,p,t).-L)./(integrator.sqdt) @@ -154,12 +154,12 @@ end if cache isa ImplicitRKMilCache gtmp3 = cache.gtmp3 - if alg_interpretation(alg) == :Ito + if SciMLBase.alg_interpretation(alg) == :Ito @.. z = uprev + dt * tmp + integrator.sqdt * gtmp integrator.g(gtmp3,z,p,t) @.. gtmp3 = (gtmp3-gtmp)/(integrator.sqdt) # ggprime approximation @.. gtmp2 += gtmp3*(dW.^2 - abs(dt))/2 - elseif alg_interpretation(alg) == :Stratonovich + elseif SciMLBase.alg_interpretation(alg) == :Stratonovich @.. z = uprev + integrator.sqdt * gtmp integrator.g(gtmp3,z,p,t) @.. gtmp3 = (gtmp3-gtmp)/(integrator.sqdt) # ggprime approximation