@@ -7,7 +7,9 @@ import UnPack: @unpack
77import FiniteDiff, ForwardDiff
88
99function SciMLBase. __solve (prob:: NonlinearProblem , alg:: SIAMFANLEquationsJL , args... ; abstol = 1e-8 ,
10- reltol = 1e-8 , alias_u0:: Bool = false , maxiters = 1000 , kwargs... )
10+ reltol = 1e-8 , alias_u0:: Bool = false , maxiters = 1000 , termination_condition = nothing , kwargs... )
11+ @assert (termination_condition === nothing ) || (termination_condition isa AbsNormTerminationMode) " SIAMFANLEquationsJL does not support termination conditions!"
12+
1113 @unpack method, autodiff, show_trace, delta, linsolve = alg
1214
1315 iip = SciMLBase. isinplace (prob)
@@ -39,7 +41,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SIAMFANLEquationsJL, arg
3941 elseif res. errcode == - 1
4042 retcode = ReturnCode. Default
4143 end
42- stats = method == :pseudotransient ? nothing : (SciMLBase. NLStats (res. stats. ifun[1 ], res. stats. ijac[1 ], - 1 , - 1 , res. stats. iarm[1 ]))
44+ stats = method == :pseudotransient ? nothing : (SciMLBase. NLStats (res. stats. ifun[1 ], res. stats. ijac[1 ], 0 , 0 , res. stats. iarm[1 ]))
4345 return SciMLBase. build_solution (prob, alg, res. solution, res. history; retcode, stats)
4446 else
4547 u = NonlinearSolve. __maybe_unaliased (prob. u0, alias_u0)
@@ -86,7 +88,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SIAMFANLEquationsJL, arg
8688 elseif res. errcode == - 1
8789 retcode = ReturnCode. Default
8890 end
89- stats = method == :pseudotransient ? nothing : (SciMLBase. NLStats (res. stats. ifun[1 ], res. stats. ijac[1 ], - 1 , - 1 , res. stats. iarm[1 ]))
91+ stats = method == :pseudotransient ? nothing : (SciMLBase. NLStats (res. stats. ifun[1 ], res. stats. ijac[1 ], 0 , 0 , res. stats. iarm[1 ]))
9092 return SciMLBase. build_solution (prob, alg, res. solution, res. history; retcode, stats)
9193 end
9294
@@ -163,7 +165,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SIAMFANLEquationsJL, arg
163165
164166
165167 # pseudo transient continuation has a fixed cost per iteration, iteration statistics are not interesting here.
166- stats = method == :pseudotransient ? nothing : (SciMLBase. NLStats (res. stats. ifun[1 ], res. stats. ijac[1 ], - 1 , - 1 , res. stats. iarm[1 ]))
168+ stats = method == :pseudotransient ? nothing : (SciMLBase. NLStats (res. stats. ifun[1 ], res. stats. ijac[1 ], 0 , 0 , res. stats. iarm[1 ]))
167169 return SciMLBase. build_solution (prob, alg, res. solution, res. history; retcode, stats)
168170end
169171
0 commit comments