@@ -7,7 +7,9 @@ import UnPack: @unpack
7
7
import FiniteDiff, ForwardDiff
8
8
9
9
function 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
+
11
13
@unpack method, autodiff, show_trace, delta, linsolve = alg
12
14
13
15
iip = SciMLBase. isinplace (prob)
@@ -39,7 +41,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SIAMFANLEquationsJL, arg
39
41
elseif res. errcode == - 1
40
42
retcode = ReturnCode. Default
41
43
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 ]))
43
45
return SciMLBase. build_solution (prob, alg, res. solution, res. history; retcode, stats)
44
46
else
45
47
u = NonlinearSolve. __maybe_unaliased (prob. u0, alias_u0)
@@ -86,7 +88,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SIAMFANLEquationsJL, arg
86
88
elseif res. errcode == - 1
87
89
retcode = ReturnCode. Default
88
90
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 ]))
90
92
return SciMLBase. build_solution (prob, alg, res. solution, res. history; retcode, stats)
91
93
end
92
94
@@ -163,7 +165,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SIAMFANLEquationsJL, arg
163
165
164
166
165
167
# 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 ]))
167
169
return SciMLBase. build_solution (prob, alg, res. solution, res. history; retcode, stats)
168
170
end
169
171
0 commit comments