OGS
ConvergenceCriterionPerComponentDeltaX.h
Go to the documentation of this file.
1
11#pragma once
12
15
16namespace NumLib
17{
18class LocalToGlobalIndexMap;
19
28{
29public:
31 std::vector<double>&& absolute_tolerances,
32 std::vector<double>&& relative_tolerances,
33 std::vector<double>&& damping_alpha,
34 bool daming_alpha_switch,
35 const MathLib::VecNormType norm_type);
36
37 bool hasDeltaXCheck() const override { return true; }
38 bool hasResidualCheck() const override { return false; }
39 bool hasNonNegativeDamping() const override
40 {
42 }
43
44 void checkDeltaX(const GlobalVector& minus_delta_x,
45 GlobalVector const& x) override;
46 void checkResidual(const GlobalVector& /*residual*/) override {}
47 double getDampingFactor(const GlobalVector& minus_delta_x,
48 GlobalVector const& x,
49 double damping_orig) override;
50
51 void reset() override { this->_satisfied = true; }
52
53 void setDOFTable(const LocalToGlobalIndexMap& dof_table,
54 MeshLib::Mesh const& mesh) override;
55
56private:
57 const std::vector<double> _abstols;
58 const std::vector<double> _reltols;
59 const std::vector<double> _damping_alpha;
62 MeshLib::Mesh const* _mesh = nullptr;
63};
64
65std::unique_ptr<ConvergenceCriterionPerComponentDeltaX>
67
68} // namespace NumLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
ConvergenceCriterionPerComponentDeltaX(std::vector< double > &&absolute_tolerances, std::vector< double > &&relative_tolerances, std::vector< double > &&damping_alpha, bool daming_alpha_switch, const MathLib::VecNormType norm_type)
void checkResidual(const GlobalVector &) override
Check if the residual satisfies the convergence criterion.
double getDampingFactor(const GlobalVector &minus_delta_x, GlobalVector const &x, double damping_orig) override
void checkDeltaX(const GlobalVector &minus_delta_x, GlobalVector const &x) override
void setDOFTable(const LocalToGlobalIndexMap &dof_table, MeshLib::Mesh const &mesh) override
Sets the d.o.f. table used to extract data for a specific component.
std::unique_ptr< ConvergenceCriterionPerComponentDeltaX > createConvergenceCriterionPerComponentDeltaX(const BaseLib::ConfigTree &config)