diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index 352fdb0c5c1a2ecf9ffe8934f2a19f4c119b3b77..e3fae3fffc6783eee4eaf1e260c6749c4850a8ba 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -132,7 +132,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { psi.subDiff(0, D); if (D[1] > 0) { // NOTE: Numerical instability can actually get us here - assert(abs(D[1]) < 1e-15); + assert(std::abs(D[1]) < 1e-15); return 0; } diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index e6caf46a20fb1bb5b8e80b61a58295d95b831f25..c5b4f74880df64ff8d3fc00895197337d5b73479 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -476,13 +476,15 @@ int main(int argc, char *argv[]) { double ret1 = compute_state_update_bisection(h, unorm, L, s4_old[i][0]); - assert(abs(1.0 / h * ret1 - (s4_old[i] - unorm / L) / h - - exp(-ret1)) < 1e-12); + assert(std::abs(1.0 / h * ret1 - (s4_old[i] - unorm / L) / h - + exp(-ret1)) < 1e-11); + double ret2 = compute_state_update_lambert(h, unorm, L, s4_old[i][0]); - assert(abs(1.0 / h * ret2 - (s4_old[i] - unorm / L) / h - - exp(-ret2)) < 1e-12); - assert(abs(ret2 - ret1) < 1e-14); + assert(std::abs(1.0 / h * ret2 - (s4_old[i] - unorm / L) / h - + exp(-ret2)) < 1e-11); + + assert(std::abs(ret2 - ret1) < 1e-14); (*s4_new)[i][0] = ret1; } @@ -540,13 +542,13 @@ int main(int argc, char *argv[]) { double ret1 = compute_state_update_bisection(h, unorm, L, s5_old[i][0]); - assert(abs(1.0 / h * ret1 - (s5_old[i] - unorm / L) / h - - exp(-ret1)) < 1e-12); + assert(std::abs(1.0 / h * ret1 - (s5_old[i] - unorm / L) / h - + exp(-ret1)) < 1e-12); double ret2 = compute_state_update_lambert(h, unorm, L, s5_old[i][0]); - assert(abs(1.0 / h * ret2 - (s5_old[i] - unorm / L) / h - - exp(-ret2)) < 1e-12); - assert(abs(ret2 - ret1) < 1e-14); + assert(std::abs(1.0 / h * ret2 - (s5_old[i] - unorm / L) / h - + exp(-ret2)) < 1e-12); + assert(std::abs(ret2 - ret1) < 1e-14); (*s5_new)[i][0] = ret1; }