33 return std::make_pair(
34 std::make_unique<ConcreteNLS>(linear_solver, max_iter), tag);
38 auto const recompute_jacobian =
47 "The damping factor for the Newton method must be positive, "
52 auto const damping_reduction =
55 std::unique_ptr<NewtonStepStrategy> standard_newton;
56 if (damping_reduction)
58 standard_newton = std::make_unique<DampingReductionStrategy>(
59 damping, *damping_reduction);
63 standard_newton = std::make_unique<FixedDampingStrategy>(damping);
67 return std::make_pair(
68 std::make_unique<ConcreteNLS>(linear_solver, max_iter,
69 std::move(standard_newton),
74 if (boost::iequals(type,
"PETScSNES"))
81 return std::make_pair(std::make_unique<ConcreteNLS>(
82 linear_solver, max_iter, std::move(prefix)),
85 static constexpr std::array valid_types = {
"PETScSNES",
"Newton",
"Picard"};
87 static constexpr std::array valid_types = {
"Newton",
"Picard"};
90 OGS_FATAL(
"Invalid non-linear solver type '{}'. Supported values: {}.",
91 type, fmt::join(valid_types,
", "));