OGS
ConvergenceCriterionDeltaX.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <optional>
14
17
18namespace NumLib
19{
27{
28public:
29 ConvergenceCriterionDeltaX(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 false; }
35
36 void checkDeltaX(const GlobalVector& minus_delta_x,
37 GlobalVector const& x) override;
38 void checkResidual(const GlobalVector& /*residual*/) override {}
39
40 void reset() override { this->_satisfied = true; }
41
42private:
43 const std::optional<double> _abstol;
44 const std::optional<double> _reltol;
45};
46
47std::unique_ptr<ConvergenceCriterionDeltaX> createConvergenceCriterionDeltaX(
48 BaseLib::ConfigTree const& config);
49
50} // namespace NumLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
void checkResidual(const GlobalVector &) override
Check if the residual satisfies the convergence criterion.
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)
std::unique_ptr< ConvergenceCriterionDeltaX > createConvergenceCriterionDeltaX(const BaseLib::ConfigTree &config)