Skip to content

Commit daa4703

Browse files
committed
replace diffeqop with matrixop, fix update behaviour in test
1 parent 8bee9fe commit daa4703

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ RandomNumbers = "e6cf234a-135c-5ec9-84dd-332b85af5143"
2525
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
2626
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2727
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
28+
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
2829
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2930
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
3031
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

src/StochasticDiffEq.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using DocStringExtensions
2424
import DiffEqBase: ODE_DEFAULT_NORM, ODE_DEFAULT_ISOUTOFDOMAIN,
2525
ODE_DEFAULT_PROG_MESSAGE, ODE_DEFAULT_UNSTABLE_CHECK
2626

27-
using DiffEqBase: DiffEqArrayOperator
27+
using SciMLOperators: MatrixOperator
2828

2929
using DiffEqBase: TimeGradientWrapper, UJacobianWrapper, TimeDerivativeWrapper, UDerivativeWrapper
3030

src/integrators/integrator_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ function oop_generate_W(alg,u,uprev,p,t,dt,f,uEltypeNoUnits)
418418
# get the operator
419419
J = islin ? nf.f : f.jac(uprev, p, t)
420420
if !isa(J, DiffEqBase.AbstractDiffEqLinearOperator)
421-
J = DiffEqArrayOperator(J)
421+
J = MatrixOperator(J)
422422
end
423423
W = WOperator{false}(f.mass_matrix, dt, J, u)
424424
else

test/utility_tests.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using StochasticDiffEq, LinearAlgebra, SparseArrays, Random, LinearSolve, Test
22
using StochasticDiffEq.OrdinaryDiffEq: WOperator, set_gamma!, calc_W!
3+
using StochasticDiffEq.SciMLOperators: MatrixOperator
34

45
@testset "Derivative Utilities" begin
56
@testset "calc_W!" begin
@@ -25,7 +26,7 @@ using StochasticDiffEq.OrdinaryDiffEq: WOperator, set_gamma!, calc_W!
2526
_f = (du,u,p,t) -> mul!(du,A,u); _g = (du,u,p,t) -> mul!(du,σ,u)
2627
fun = SDEFunction(_f, _g;
2728
mass_matrix=mm,
28-
jac_prototype=DiffEqArrayOperator(A))
29+
jac_prototype=MatrixOperator(A))
2930
prob = SDEProblem(fun, _g, u0, tspan)
3031
integrator = init(prob, ImplicitEM(theta=1); adaptive=false, dt=dt)
3132
W = integrator.cache.nlsolver.cache.W
@@ -52,7 +53,7 @@ using StochasticDiffEq.OrdinaryDiffEq: WOperator, set_gamma!, calc_W!
5253
prob1 = SDEProblem(SDEFunction(_f, _g; mass_matrix=mm), _g, u0, tspan)
5354
prob2 = SDEProblem(SDEFunction(_f, _g; mass_matrix=mm, jac=(u,p,t) -> t*A), _g, u0, tspan)
5455
prob1_ip = SDEProblem(SDEFunction(_f_ip, _g_ip; mass_matrix=mm), _g_ip, u0, tspan)
55-
jac_prototype=DiffEqArrayOperator(similar(A); update_func=(J,u,p,t) -> (J .= t .* A; J))
56+
jac_prototype=MatrixOperator(similar(A); update_func! = (J,u,p,t) -> (J .= t .* A; J))
5657
prob2_ip = SDEProblem(SDEFunction(_f_ip, _g_ip; mass_matrix=mm, jac_prototype=jac_prototype), _g_ip, u0, tspan)
5758

5859
for Alg in [ImplicitEM, ISSEM]

0 commit comments

Comments
 (0)