Loading [MathJax]/extensions/MathZoom.js
OGS
ConvergenceCriterionResidual.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <optional>
14
17
18namespace NumLib
19{
27{
28public:
29 ConvergenceCriterionResidual(std::optional<double>&& absolute_tolerance,
30 std::optional<double>&& relative_tolerance,
31 const MathLib::VecNormType norm_type);
32
33 bool hasDeltaXCheck() const override { return true; }
34 bool hasResidualCheck() const override { return true; }
35 bool hasNonNegativeDamping() const override { return false; }
36
39 void checkDeltaX(const GlobalVector& minus_delta_x,
40 GlobalVector const& x) override;
41 void checkResidual(const GlobalVector& residual) override;
42 double getDampingFactor(GlobalVector const& /*minus_delta_x*/,
43 GlobalVector const& /*x*/,
44 double damping_scalar) override
45 {
46 return damping_scalar;
47 }
48
49private:
50 const std::optional<double> _abstol;
51 const std::optional<double> _reltol;
53};
54
55std::unique_ptr<ConvergenceCriterionResidual>
57
58} // namespace NumLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
void checkResidual(const GlobalVector &residual) override
Check if the residual satisfies the convergence criterion.
double getDampingFactor(GlobalVector const &, GlobalVector const &, double damping_scalar) override
ConvergenceCriterionResidual(std::optional< double > &&absolute_tolerance, std::optional< double > &&relative_tolerance, const MathLib::VecNormType norm_type)
void checkDeltaX(const GlobalVector &minus_delta_x, GlobalVector const &x) override
std::unique_ptr< ConvergenceCriterionResidual > createConvergenceCriterionResidual(const BaseLib::ConfigTree &config)