OGS
ConvergenceCriterionPerComponentDeltaX.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
8
9namespace NumLib
10{
12
21{
22public:
24 std::vector<double>&& absolute_tolerances,
25 std::vector<double>&& relative_tolerances,
26 std::vector<double>&& damping_alpha,
27 bool daming_alpha_switch,
28 const MathLib::VecNormType norm_type);
29
30 bool hasDeltaXCheck() const override { return true; }
31 bool hasResidualCheck() const override { return false; }
32 bool hasNonNegativeDamping() const override
33 {
35 }
36
37 void checkDeltaX(const GlobalVector& minus_delta_x,
38 GlobalVector const& x) override;
39 void checkResidual(const GlobalVector& /*residual*/) override {}
40 double getDampingFactor(const GlobalVector& minus_delta_x,
41 GlobalVector const& x,
42 double damping_orig) override;
43
44 void reset() override { this->_satisfied = true; }
45
46 void setDOFTable(const LocalToGlobalIndexMap& dof_table,
47 MeshLib::Mesh const& mesh) override;
48
49private:
50 const std::vector<double> _abstols;
51 const std::vector<double> _reltols;
52 const std::vector<double> _damping_alpha;
55 MeshLib::Mesh const* _mesh = nullptr;
56};
57
58std::unique_ptr<ConvergenceCriterionPerComponentDeltaX>
60
61} // namespace NumLib
MathLib::EigenVector GlobalVector
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.
ConvergenceCriterionPerComponent(const MathLib::VecNormType norm_type)
std::unique_ptr< ConvergenceCriterionPerComponentDeltaX > createConvergenceCriterionPerComponentDeltaX(const BaseLib::ConfigTree &config)