Skip to content

Commit

Permalink
test: ARKODE is not a DAE solver
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 21, 2024
1 parent fd9cf89 commit 8f0f2a0
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions test/downstream/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,6 @@ using ModelingToolkit: t_nounits as t, D_nounits as D

@testset "CheckInit" begin
abstol = 1e-10
@testset "Sundials + ODEProblem" begin
function rhs(u, p, t)
return [u[1] * t, u[1]^2 - u[2]^2]
end
function rhs!(du, u, p, t)
du[1] = u[1] * t
du[2] = u[1]^2 - u[2]^2
end

oopfn = ODEFunction{false}(rhs, mass_matrix = [1 0; 0 0])
iipfn = ODEFunction{true}(rhs!, mass_matrix = [1 0; 0 0])

@testset "Inplace = $(SciMLBase.isinplace(f))" for f in [oopfn, iipfn]
prob = ODEProblem(f, [1.0, 1.0], (0.0, 1.0))
integ = init(prob, Sundials.ARKODE())
u0, _, success = SciMLBase.get_initial_values(
prob, integ, f, SciMLBase.CheckInit(), Val(SciMLBase.isinplace(f)); abstol)
@test success
@test u0 == prob.u0

integ.u[2] = 2.0
@test_throws SciMLBase.CheckInitFailureError SciMLBase.get_initial_values(
prob, integ, f, SciMLBase.CheckInit(), Val(SciMLBase.isinplace(f)); abstol)
end
end

@testset "Sundials + DAEProblem" begin
function daerhs(du, u, p, t)
return [du[1] - u[1] * t - p, u[1]^2 - u[2]^2]
Expand Down

0 comments on commit 8f0f2a0

Please sign in to comment.