Commit ae2582b9 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[doc][newton] add comments on detail functions

parent d5921a8c
......@@ -98,7 +98,9 @@ auto hybridInnerProduct(const V& v1, const V& v2, Scalar init, Reduce&& r, Trans
return init;
}
// TODO: Document why this is computed like this
// Maximum relative shift at a degree of freedom.
// For (primary variables) values below 1.0 we use
// an absolute shift.
template<class Scalar, class V>
auto maxRelativeShift(const V& v1, const V& v2)
-> std::enable_if_t<Dune::IsNumber<V>::value, Scalar>
......@@ -107,6 +109,8 @@ auto maxRelativeShift(const V& v1, const V& v2)
return abs(v1 - v2)/max<Scalar>(1.0, abs(v1 + v2)*0.5);
}
// Maximum relative shift for generic vector types.
// Recursively calls maxRelativeShift until Dune::IsNumber is true.
template<class Scalar, class V>
auto maxRelativeShift(const V& v1, const V& v2)
-> std::enable_if_t<!Dune::IsNumber<V>::value, Scalar>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment