Skip to content

Commit 9197a0e

Browse files
committed
imports, other preparations
1 parent 18c8ffa commit 9197a0e

File tree

21 files changed

+62
-45
lines changed

21 files changed

+62
-45
lines changed

lib/BracketingNonlinearSolve/src/bisection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function SciMLBase.__solve(
4747
if sign(fl) == sign(fr)
4848
@SciMLMessage("The interval is not an enclosing interval, opposite signs at the \
4949
boundaries are required.",
50-
nonlinear_verbose[], :non_enclosing_interval, :error_control)
50+
verbose, :non_enclosing_interval, :error_control)
5151
return SciMLBase.build_solution(
5252
prob, alg, left, fl; retcode = ReturnCode.InitialFailure, left, right
5353
)

lib/BracketingNonlinearSolve/src/brent.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function SciMLBase.__solve(
3535
if sign(fl) == sign(fr)
3636
@SciMLMessage("The interval is not an enclosing interval, opposite signs at the \
3737
boundaries are required.",
38-
nonlinear_verbose[], :non_enclosing_interval, :error_control)
38+
verbose, :non_enclosing_interval, :error_control)
3939
return SciMLBase.build_solution(
4040
prob, alg, left, fl; retcode = ReturnCode.InitialFailure, left, right
4141
)

lib/BracketingNonlinearSolve/src/falsi.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function SciMLBase.__solve(
3434
if sign(fl) == sign(fr)
3535
@SciMLMessage("The interval is not an enclosing interval, opposite signs at the \
3636
boundaries are required.",
37-
nonlinear_verbose[], :non_enclosing_interval, :error_control)
37+
verbose, :non_enclosing_interval, :error_control)
3838
return SciMLBase.build_solution(
3939
prob, alg, left, fl; retcode = ReturnCode.InitialFailure, left, right
4040
)

lib/BracketingNonlinearSolve/src/itp.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function SciMLBase.__solve(
8585
if sign(fl) == sign(fr)
8686
@SciMLMessage("The interval is not an enclosing interval, opposite signs at the \
8787
boundaries are required.",
88-
nonlinear_verbose[], :non_enclosing_interval, :error_control)
88+
verbose, :non_enclosing_interval, :error_control)
8989
return SciMLBase.build_solution(
9090
prob, alg, left, fl; retcode = ReturnCode.InitialFailure, left, right
9191
)

lib/BracketingNonlinearSolve/src/ridder.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function SciMLBase.__solve(
3434
if sign(fl) == sign(fr)
3535
@SciMLMessage("The interval is not an enclosing interval, opposite signs at the \
3636
boundaries are required.",
37-
nonlinear_verbose[], :non_enclosing_interval, :error_control)
37+
verbose, :non_enclosing_interval, :error_control)
3838
return SciMLBase.build_solution(
3939
prob, alg, left, fl; retcode = ReturnCode.InitialFailure, left, right
4040
)

lib/NonlinearSolveBase/ext/NonlinearSolveBaseLinearSolveExt.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ using ArrayInterface: ArrayInterface
55
using CommonSolve: CommonSolve, init, solve!
66
using LinearSolve: LinearSolve, QRFactorization, SciMLLinearSolveAlgorithm
77
using SciMLBase: ReturnCode, LinearProblem, LinearAliasSpecifier
8+
using SciMLVerbosity: @SciMLMessage
89

910
using LinearAlgebra: ColumnNorm
1011

lib/NonlinearSolveBase/src/abstract_types.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ the cache:
280280
- `maxtime`: the maximum time limit for the solver. (Optional)
281281
- `timer`: the timer for the solver. (Optional)
282282
- `total_time`: the total time taken by the solver. (Optional)
283+
- `verbose`: a verbosity object that contains options determining what log messages are emitted.
283284
"""
284285
abstract type AbstractNonlinearSolveCache <: AbstractNonlinearSolveBaseAPI end
285286

lib/NonlinearSolveBase/src/descent/newton.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function InternalAPI.init(
3939
if Utils.unwrap_val(pre_inverted)
4040
lincache = nothing
4141
else
42+
if haskey(kwargs, :verbose)
43+
linsolve_kwargs = merge((verbose = kwargs[:verbose].linear_verbosity,), linsolve_kwargs)
44+
end
45+
4246
lincache = construct_linear_solver(
4347
alg, alg.linsolve, J, Utils.safe_vec(fu), Utils.safe_vec(u);
4448
stats, abstol, reltol, linsolve_kwargs...
@@ -72,6 +76,11 @@ function InternalAPI.init(
7276
A, b = J, Utils.safe_vec(fu)
7377
end
7478

79+
if haskey(kwargs, :verbose)
80+
linsolve_kwargs = merge(
81+
(verbose = kwargs[:verbose].linear_verbosity,), linsolve_kwargs)
82+
end
83+
7584
lincache = construct_linear_solver(
7685
alg, alg.linsolve, A, b, Utils.safe_vec(u);
7786
stats, abstol, reltol, linsolve_kwargs...

lib/NonlinearSolveBase/src/descent/steepest.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ function InternalAPI.init(
3737
@bb δu_ = similar(u)
3838
end
3939
if Utils.unwrap_val(pre_inverted)
40+
41+
if haskey(kwargs, :verbose)
42+
linsolve_kwargs = merge(
43+
(verbose = kwargs[:verbose].linear_verbosity,), linsolve_kwargs)
44+
end
45+
4046
lincache = construct_linear_solver(
4147
alg, alg.linsolve, transpose(J), Utils.safe_vec(fu), Utils.safe_vec(u);
4248
stats, abstol, reltol, linsolve_kwargs...

lib/NonlinearSolveBase/src/jacobian.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ function construct_concrete_adtype(f::NonlinearFunction, ad::AbstractADType)
180180
if f.sparsity === nothing
181181
if f.jac_prototype === nothing
182182
if SciMLBase.has_colorvec(f)
183-
@SciMLMessage("`colorvec` is provided but `sparsity` and `jac_prototype` is not \
184-
specified. `colorvec` will be ignored.", nonlinear_verbose[], :colorvec_no_prototype, :performance )
183+
@warn "`colorvec` is provided but `sparsity` and `jac_prototype` is not \
184+
specified. `colorvec` will be ignored."
185185
end
186186
return ad # No sparse AD
187187
else
188188
if !sparse_or_structured_prototype(f.jac_prototype)
189189
if SciMLBase.has_colorvec(f)
190-
@SciMLMessage("`colorvec` is provided but `jac_prototype` is not a sparse \
191-
or structured matrix. `colorvec` will be ignored.", nonlinear_verbose[], :colorvec_non_sparse, :performance)
190+
@warn "`colorvec` is provided but `jac_prototype` is not a sparse \
191+
or structured matrix. `colorvec` will be ignored."
192192
end
193193
return ad
194194
end

0 commit comments

Comments
 (0)