Forcing iterations in the Newton solver should always reduce the defect/residual
The options
[NewtonParameters]
ForceIteration = true
FixedLinearReduction = false
can cause contradicting behavior in the non-linear Newton
solver. I would consider this a bug.
Description
The Newton solver always performs an iteration if ForceIteration
is set to true
. In particular, the initial (current) defect might be smaller than the AbsoluteLimit
, d < d_{\text{abs}}
. In this case, the stop defect will be set to the absolute limit d_{\text{stop}} = d_{\text{abs}}
. If FixedLinearReduction
is set to false, the method NewtonPrepareStep::prepare_step
calculates the required linear reduction to reach the limit, r = d_{\text{stop}} / (10 d) > 1
. The reduction requested from the linear solver is larger than one. The linear solver therefore does not perform any step at all and the subsequent line search in the Newton solver fails.
Solver output
The output of such a mishap at high verbosity for settings
[NewtonParameters]
ForceIteration = true
AbsoluteLimit = 1E-10
Reduction = 1E-4
ReassembleThreshold = 5E-2
LineSearchMaxIterations = 10
MinLinearReduction = 1E-3
is the following:
Initial defect: 2.9109e-12
Newton iteration 0 --------------------------------
Reassembling matrix...
requested linear reduction: 3.4354e+00
matrix assembly time: 4.5042e-01
Solving linear system...
linear solver iterations: 0
linear defect reduction: 0.0000e+00
Performing line search...
trying line search damping factor: 1.0000e+00
[...]
trying line search damping factor: 1.9531e-03
max line search iterations exceeded
NewtonLineSearchError [...] NewtonLineSearch::line_search(): line search failed, max iteration
count reached, defect did not improve enough
Current bug behavior
Newton solver breaks if the initial defect is smaller than the stop criterion, while ForceIteration
is set to true
and FixedLinearReduction
to false
.
Expected correct behavior
Newton solver works with the prescribed settings or aborts for contradicting settings.
Ideas how to fix this
Given the case that the current defect is smaller than the stop defect inside prepare_step
, adjust the requested reduction accordingly. I'm not sure to which value, though. It could be a "trivial" reduction, r = 1
, but as user, I would expect the Newton solver to always perform a meaningful reduction of the residual if I set ForceIteration
to true
.