20 std::optional<double>&& absolute_tolerance,
21 std::optional<double>&& relative_tolerance,
24 _abstol(std::move(absolute_tolerance)),
25 _reltol(std::move(relative_tolerance))
30 "At least one of absolute or relative tolerance has to be "
41 INFO(
"Convergence criterion: |dx|={:.4e}, |x|={:.4e}, |dx|/|x|={:.4e}",
43 (norm_x == 0. ? std::numeric_limits<double>::quiet_NaN()
44 : (error_dx / norm_x)));
46 bool satisfied_abs =
false;
47 bool satisfied_rel =
false;
51 satisfied_abs = error_dx < *
_abstol;
71 auto const norm_type_str =
78 OGS_FATAL(
"Unknown vector norm type `{:s}'.", norm_type_str);
81 return std::make_unique<ConvergenceCriterionDeltaX>(
82 std::move(abstol), std::move(reltol), norm_type);
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
Global vector based on Eigen vector.
void checkDeltaX(const GlobalVector &minus_delta_x, GlobalVector const &x) override
ConvergenceCriterionDeltaX(std::optional< double > &&absolute_tolerance, std::optional< double > &&relative_tolerance, const MathLib::VecNormType norm_type)
const std::optional< double > _reltol
const std::optional< double > _abstol
const MathLib::VecNormType _norm_type
double norm(MatrixOrVector const &x, MathLib::VecNormType type)
VecNormType convertStringToVecNormType(const std::string &str)
convert string to VecNormType
bool checkRelativeTolerance(const double reltol, const double numerator, const double denominator)
std::unique_ptr< ConvergenceCriterionDeltaX > createConvergenceCriterionDeltaX(const BaseLib::ConfigTree &config)