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

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

parent b5bf1b6b
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,16 @@ ConvergenceCriterionResidual::ConvergenceCriterionResidual(
"specified.");
}
void ConvergenceCriterionResidual::checkDeltaX(const GlobalVector& minus_delta_x,
GlobalVector const& x)
{
auto error_dx = MathLib::LinAlg::norm(minus_delta_x, _norm_type);
auto norm_x = MathLib::LinAlg::norm(x, _norm_type);
INFO("Convergence criterion: |dx|=%.4e, |x|=%.4e, |dx|/|x|=%.4e", error_dx,
norm_x, error_dx / norm_x);
}
void ConvergenceCriterionResidual::checkResidual(const GlobalVector& residual)
{
auto norm_res = MathLib::LinAlg::norm(residual, _norm_type);
......
......@@ -30,11 +30,13 @@ public:
boost::optional<double>&& relative_tolerance,
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 {}
/// The function will only do diagnostic output and no actual check of the
/// solution increment is made
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