Skip to content

Commit

Permalink
Fix another AD bug in old update code
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Dec 12, 2024
1 parent 042d822 commit 1f4f3c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/variables/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,9 @@ function unit_update_magnitude_local!(s, ix, cell, dx, nf, nu, minval, maxval, a
# Note: Careful to handle AD values correctly here.
@inbounds t += value(s[i, cell])
end
for i = 1:nf
@inbounds s[i, cell] /= t
@inbounds for i = 1:nf
s_i = s[i, cell]
s[i, cell] = replace_value(s_i, clamp(value(s_i), minval, maxval)/t)
end
end
end
Expand Down

0 comments on commit 1f4f3c5

Please sign in to comment.