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 b0aa0af commit 011f790
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ sol = solve(prob_brusselator_2d, NewtonRaphson())
du0 = copy(u0)
jac_sparsity = Symbolics.jacobian_sparsity((du, u) -> brusselator_2d_loop(du, u, p), du0,
u0)
jac_prototype = float.(jac_sparsity)
fill!(jac_prototype, 0)

ff = NonlinearFunction(brusselator_2d_loop; jac_prototype = float.(jac_sparsity))
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
Expand Down

0 comments on commit 011f790

Please sign in to comment.