Skip to content

Commit 503d579

Browse files
committed
Check jac_prototype usage
1 parent 011f790 commit 503d579

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/sparse.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ jac_sparsity = Symbolics.jacobian_sparsity((du, u) -> brusselator_2d_loop(du, u,
4343
u0)
4444
jac_prototype = float.(jac_sparsity)
4545
fill!(jac_prototype, 0)
46+
@test all(iszero, jac_prototype)
4647

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

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

0 commit comments

Comments
 (0)