Skip to content
Snippets Groups Projects
Commit 9dc9ee10 authored by Norihiro Watanabe's avatar Norihiro Watanabe Committed by Dmitri Naumov
Browse files

[Num/ODE] print norms of delta x in ConvergenceCriterionPerComponentResidual

parent 13fb9c58
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,30 @@ ConvergenceCriterionPerComponentResidual::
OGS_FATAL("The given tolerances vector is empty.");
}
void ConvergenceCriterionPerComponentResidual::checkDeltaX(
const GlobalVector& minus_delta_x, GlobalVector const& x)
{
if ((!_dof_table) || (!_mesh))
OGS_FATAL("D.o.f. table or mesh have not been set.");
for (unsigned global_component = 0; global_component < _abstols.size();
++global_component)
{
// TODO short cut if tol <= 0.0
auto error_dx = norm(minus_delta_x, global_component, _norm_type,
*_dof_table, *_mesh);
auto norm_x =
norm(x, global_component, _norm_type, *_dof_table, *_mesh);
INFO(
"Convergence criterion, component %u: |dx|=%.4e, |x|=%.4e, "
"|dx|/|x|=%.4e",
error_dx, global_component, norm_x, error_dx / norm_x);
}
}
void ConvergenceCriterionPerComponentResidual::checkResidual(
const GlobalVector& residual)
{
......
......@@ -33,11 +33,11 @@ public:
std::vector<double>&& relative_tolerances,
MathLib::VecNormType norm_type);
bool hasDeltaXCheck() const override { return false; }
bool hasDeltaXCheck() const override { return true; }
bool hasResidualCheck() const override { return true; }
void checkDeltaX(const GlobalVector& /*minus_delta_x*/,
GlobalVector const& /*x*/) override {}
void checkDeltaX(const GlobalVector& minus_delta_x,
GlobalVector const& x) override;
void checkResidual(const GlobalVector& residual) override;
void preFirstIteration() override { _is_first_iteration = true; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment