Skip to content

Commit

Permalink
Check jac_prototype usage
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Aug 18, 2023
1 parent 011f790 commit 503d579
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ jac_sparsity = Symbolics.jacobian_sparsity((du, u) -> brusselator_2d_loop(du, u,
u0)
jac_prototype = float.(jac_sparsity)
fill!(jac_prototype, 0)
@test all(iszero, jac_prototype)

ff = NonlinearFunction(brusselator_2d_loop; jac_prototype)
prob_brusselator_2d = NonlinearProblem(ff, u0, p)
sol = solve(prob_brusselator_2d, NewtonRaphson())
@test norm(sol.resid) < 1e-8
@test !all(iszero, jac_prototype)

sol = solve(prob_brusselator_2d, NewtonRaphson(autodiff = false))
@test norm(sol.resid) < 1e-6
Expand Down

0 comments on commit 503d579

Please sign in to comment.