Commit 542b8cd2 authored by bianucci's avatar bianucci

Fix for wrong eps computation in Vandermonde with gcc-5.

Apparently in gcc-5 the abs function has return type int instead of double, switching it to fabs solved the issue.
The visible symptom of the issue was getting "nan" values in the computed differential operator values in the Dcpse tests.
parent 2ae3ec59
......@@ -115,6 +115,7 @@ void Vandermonde<dim, T, MatrixType>::computeEps(T factor)
avgNeighbourSpacing /= offsets.size();
eps = factor * avgNeighbourSpacing;
assert(eps != 0);
template<unsigned int dim, typename T, typename MatrixType>
......@@ -123,7 +124,7 @@ T Vandermonde<dim, T, MatrixType>::computeAbsSum(const Point<dim, T> &x)
T absSum = 0;
for (unsigned int i = 0; i < dim; ++i)
absSum += abs(x.value(i));
absSum += fabs(x.value(i));
return absSum;
Markdown is supported
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