Skip to content
Snippets Groups Projects
Commit affec9a2 authored by Max Kahnt's avatar Max Kahnt
Browse files

Add braces to if-clause for clarity and to avoid dangling else warning.

parent cec0a443
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -107,10 +107,11 @@ namespace Solvers {
//! \brief throw an exception if value is below tolerance, project to R^+ otherwise.
static field_type checkedValue(field_type value, field_type tolerance)
{
if (value < 0)
if (value < 0) {
if (value < -tolerance)
DUNE_THROW(Dune::RangeError, "Supplied linear operator is not positive (semi-)definite: (u,Au) = " << value);
else return 0.0;
}
return value;
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment