Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/NonlinearSolveBase/src/termination_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ function SciMLBase.reinit!(
length(saved_value_prototype) != 0 && (cache.saved_values = saved_value_prototype)

mode = cache.mode
u_unaliased = mode isa AbstractSafeBestNonlinearTerminationMode ?
(ArrayInterface.can_setindex(u) ? copy(u) : u) : nothing
cache.u = u_unaliased
if u isa Number || !ArrayInterface.can_setindex(u)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if u isa Number || !ArrayInterface.can_setindex(u)
if u isa Number || !ArrayInterface.can_setindex(u)

cache.u = u
else
cache.u .= u
end
cache.retcode = ReturnCode.Default

cache.abstol = get_tolerance(u, abstol, T)
Expand Down
Loading