OGS
ConvergenceCriterionPerComponentResidual.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <vector>
14 
17 
18 namespace NumLib
19 {
20 class LocalToGlobalIndexMap;
21 
30 {
31 public:
33  std::vector<double>&& absolute_tolerances,
34  std::vector<double>&& relative_tolerances,
35  const MathLib::VecNormType norm_type);
36 
37  bool hasDeltaXCheck() const override { return true; }
38  bool hasResidualCheck() const override { return true; }
39 
42  void checkDeltaX(const GlobalVector& minus_delta_x,
43  GlobalVector const& x) override;
44  void checkResidual(const GlobalVector& residual) override;
45 
46  void setDOFTable(const LocalToGlobalIndexMap& dof_table,
47  MeshLib::Mesh const& mesh) override;
48 
49 private:
50  const std::vector<double> _abstols;
51  const std::vector<double> _reltols;
53  MeshLib::Mesh const* _mesh = nullptr;
54  std::vector<double> _residual_norms_0;
55 };
56 
57 std::unique_ptr<ConvergenceCriterionPerComponentResidual>
59  BaseLib::ConfigTree const& config);
60 
61 } // namespace NumLib
Global vector based on Eigen vector.
Definition: EigenVector.h:26
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.
void checkResidual(const GlobalVector &residual) override
Check if the residual satisfies the convergence criterion.
void checkDeltaX(const GlobalVector &minus_delta_x, GlobalVector const &x) override
ConvergenceCriterionPerComponentResidual(std::vector< double > &&absolute_tolerances, std::vector< double > &&relative_tolerances, const MathLib::VecNormType norm_type)
VecNormType
Norm type. Not declared as class type in order to use the members as integers.
Definition: LinAlgEnums.h:22
std::unique_ptr< ConvergenceCriterionPerComponentResidual > createConvergenceCriterionPerComponentResidual(const BaseLib::ConfigTree &config)