Skip to content

Commit 011f790

Browse files
committed
Check jac_prototype usage
1 parent b0aa0af commit 011f790

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/sparse.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ sol = solve(prob_brusselator_2d, NewtonRaphson())
4141
du0 = copy(u0)
4242
jac_sparsity = Symbolics.jacobian_sparsity((du, u) -> brusselator_2d_loop(du, u, p), du0,
4343
u0)
44+
jac_prototype = float.(jac_sparsity)
45+
fill!(jac_prototype, 0)
4446

45-
ff = NonlinearFunction(brusselator_2d_loop; jac_prototype = float.(jac_sparsity))
47+
ff = NonlinearFunction(brusselator_2d_loop; jac_prototype)
4648
prob_brusselator_2d = NonlinearProblem(ff, u0, p)
4749
sol = solve(prob_brusselator_2d, NewtonRaphson())
4850
@test norm(sol.resid) < 1e-8

0 commit comments

Comments
 (0)