Commit c6c2bbc1 authored by Timo Koch's avatar Timo Koch
Browse files

[newton] Make it possible to specify minimum relaxation rate for line search

parent 4cef48b8
......@@ -1113,7 +1113,8 @@ private:
computeResidualReduction_(vars);
if (reduction_ < lastReduction_ || lambda <= 0.125) {
if (reduction_ < lastReduction_ || lambda <= lineSearchMinRelaxationFactor_)
{
endIterMsgStream_ << Fmt::format(", residual reduction {:.4e}->{:.4e}@lambda={:.4f}", lastReduction_, reduction_, lambda);
return;
}
......@@ -1248,6 +1249,7 @@ private:
void initParams_(const std::string& group = "")
{
useLineSearch_ = getParamFromGroup<bool>(group, "Newton.UseLineSearch");
lineSearchMinRelaxationFactor_ = getParamFromGroup<Scalar>(group, "Newton.LineSearchMinRelaxationFactor", 0.125);
useChop_ = getParamFromGroup<bool>(group, "Newton.EnableChop");
if(useLineSearch_ && useChop_)
DUNE_THROW(Dune::InvalidStateException, "Use either linesearch OR chop!");
......@@ -1351,6 +1353,7 @@ private:
// further parameters
bool useLineSearch_;
Scalar lineSearchMinRelaxationFactor_;
bool useChop_;
bool enableAbsoluteResidualCriterion_;
bool enableShiftCriterion_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment