Skip to content

Commit be6b9a5

Browse files
authored
fix: initial objective for termination conditions (#579)
* fix: initial objective for termination conditions * fix: min compats * test: needs NonlinearSolve
1 parent 9ac5ca0 commit be6b9a5

File tree

12 files changed

+44
-24
lines changed

12 files changed

+44
-24
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ NonlinearSolveSpectralMethods = "1.1"
104104
OrdinaryDiffEqTsit5 = "1.1.0"
105105
PETSc = "0.3"
106106
Pkg = "1.10"
107-
PolyesterForwardDiff = "0.1"
107+
PolyesterForwardDiff = "0.1.3"
108108
PrecompileTools = "1.2"
109109
Preferences = "1.4"
110110
Random = "1.10"
111111
ReTestItems = "1.24"
112112
Reexport = "1.2"
113113
SIAMFANLEquations = "1.0.1"
114-
SciMLBase = "2.58"
114+
SciMLBase = "2.68.1"
115115
SimpleNonlinearSolve = "2.1"
116116
SparseArrays = "1.10"
117117
SparseConnectivityTracer = "0.6.5"
@@ -121,7 +121,7 @@ StableRNGs = "1"
121121
StaticArrays = "1.9"
122122
StaticArraysCore = "1.4"
123123
Sundials = "4.23.1"
124-
SymbolicIndexingInterface = "0.3.31"
124+
SymbolicIndexingInterface = "0.3.36"
125125
Test = "1.10"
126126
Zygote = "0.6.69, 0.7"
127127
julia = "1.10"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ OrdinaryDiffEqTsit5 = "1.1.0"
5454
PETSc = "0.3"
5555
Plots = "1"
5656
Random = "1.10"
57-
SciMLBase = "2.58"
57+
SciMLBase = "2.68.1"
5858
SciMLJacobianOperators = "0.1"
5959
SimpleNonlinearSolve = "2"
6060
SparseConnectivityTracer = "0.6.5"

lib/BracketingNonlinearSolve/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ InteractiveUtils = "<0.0.1, 1"
3030
NonlinearSolveBase = "1.1"
3131
PrecompileTools = "1.2"
3232
Reexport = "1.2"
33-
SciMLBase = "2.58"
33+
SciMLBase = "2.68.1"
3434
Test = "1.10"
3535
TestItemRunner = "1"
3636
julia = "1.10"

lib/NonlinearSolveBase/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NonlinearSolveBase"
22
uuid = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
33
authors = ["Avik Pal <[email protected]> and contributors"]
4-
version = "1.5.2"
4+
version = "1.5.3"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -70,11 +70,11 @@ Printf = "1.10"
7070
RecursiveArrayTools = "3"
7171
SciMLBase = "2.68.1"
7272
SciMLJacobianOperators = "0.1.1"
73-
SciMLOperators = "0.3.10"
73+
SciMLOperators = "0.3.13"
7474
SparseArrays = "1.10"
7575
SparseMatrixColorings = "0.4.5"
7676
StaticArraysCore = "1.4"
77-
SymbolicIndexingInterface = "0.3.31"
77+
SymbolicIndexingInterface = "0.3.36"
7878
Test = "1.10"
7979
TimerOutputs = "0.5.23"
8080
julia = "1.10"

lib/NonlinearSolveBase/src/termination_conditions.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ function CommonSolve.init(
4949

5050
if mode isa AbstractSafeNonlinearTerminationMode
5151
if mode isa AbsNormSafeTerminationMode || mode isa AbsNormSafeBestTerminationMode
52-
initial_objective = Linf_NORM(du)
52+
initial_objective = Utils.apply_norm(mode.internalnorm, du)
5353
u0_norm = nothing
5454
else
55-
initial_objective = Linf_NORM(du) /
56-
(Utils.nonallocating_maximum(+, du, u) + eps(TT))
55+
initial_objective = Utils.apply_norm(mode.internalnorm, du) /
56+
(Utils.apply_norm(mode.internalnorm, du, u) + eps(reltol))
5757
u0_norm = mode.max_stalled_steps === nothing ? nothing : L2_NORM(u)
5858
end
5959
objectives_trace = Vector{TT}(undef, mode.patience_steps)
@@ -107,10 +107,10 @@ function SciMLBase.reinit!(
107107

108108
if mode isa AbstractSafeNonlinearTerminationMode
109109
if mode isa AbsNormSafeTerminationMode || mode isa AbsNormSafeBestTerminationMode
110-
cache.initial_objective = Linf_NORM(du)
110+
cache.initial_objective = Utils.apply_norm(mode.internalnorm, du)
111111
else
112-
cache.initial_objective = Linf_NORM(du) /
113-
(Utils.nonallocating_maximum(+, du, u) + eps(TT))
112+
cache.initial_objective = Utils.apply_norm(mode.internalnorm, du) /
113+
(Utils.apply_norm(mode.internalnorm, du, u) + eps(TT))
114114
cache.max_stalled_steps !== nothing && (cache.u0_norm = L2_NORM(u))
115115
end
116116
cache.best_objective_value = cache.initial_objective

lib/NonlinearSolveFirstOrder/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ PrecompileTools = "1.2"
5353
Random = "1.10"
5454
ReTestItems = "1.24"
5555
Reexport = "1"
56-
SciMLBase = "2.58"
56+
SciMLBase = "2.68.1"
5757
SciMLJacobianOperators = "0.1.0"
5858
Setfield = "1.1.1"
5959
SparseArrays = "1.10"

lib/NonlinearSolveQuasiNewton/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Pkg = "1.10"
5252
PrecompileTools = "1.2"
5353
ReTestItems = "1.24"
5454
Reexport = "1"
55-
SciMLBase = "2.58"
56-
SciMLOperators = "0.3.11"
55+
SciMLBase = "2.68.1"
56+
SciMLOperators = "0.3.13"
5757
StableRNGs = "1"
5858
StaticArrays = "1.9.8"
5959
StaticArraysCore = "1.4.3"

lib/NonlinearSolveSpectralMethods/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Pkg = "1.10"
4141
PrecompileTools = "1.2"
4242
ReTestItems = "1.24"
4343
Reexport = "1"
44-
SciMLBase = "2.58"
44+
SciMLBase = "2.68.1"
4545
StableRNGs = "1"
4646
StaticArrays = "1.9.8"
4747
Test = "1.10"

lib/SCCNonlinearSolve/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Pkg = "1.10"
2424
PrecompileTools = "1.2"
2525
ReTestItems = "1.24"
2626
Reexport = "1"
27-
SciMLBase = "2.60"
27+
SciMLBase = "2.68.1"
2828
StableRNGs = "1"
2929
StaticArrays = "1.9.8"
30-
SymbolicIndexingInterface = "0.3.30"
30+
SymbolicIndexingInterface = "0.3.36"
3131
Test = "1.10"
3232
julia = "1.10"
3333

lib/SciMLJacobianOperators/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ ForwardDiff = "0.10.36, 1"
2929
InteractiveUtils = "<0.0.1, 1"
3030
LinearAlgebra = "1.10"
3131
ReverseDiff = "1.15"
32-
SciMLBase = "2.58"
33-
SciMLOperators = "0.3"
32+
SciMLBase = "2.68.1"
33+
SciMLOperators = "0.3.13"
3434
Test = "1.10"
3535
TestItemRunner = "1"
3636
Tracker = "0.2.35"

0 commit comments

Comments
 (0)