From 9a911ec4a1f53e85cfba0b612131d5e7cebed912 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Tue, 7 Jun 2016 10:59:52 +0200 Subject: [PATCH] Turn two divs into a div and two mult --- dune/solvers/iterationsteps/obstacletnnmgstep.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dune/solvers/iterationsteps/obstacletnnmgstep.hh b/dune/solvers/iterationsteps/obstacletnnmgstep.hh index 41e89e07..2a6f0f9b 100644 --- a/dune/solvers/iterationsteps/obstacletnnmgstep.hh +++ b/dune/solvers/iterationsteps/obstacletnnmgstep.hh @@ -274,9 +274,12 @@ class ObstacleTNNMGStep for (int j = 0; j < blockSize; ++j) { + auto const inverseCoarseCorrection = + field_type(1) / coarseCorrection_[i][j]; + // compute relative defect constraints - defectConstraint.lower(j) /= coarseCorrection_[i][j]; - defectConstraint.upper(j) /= coarseCorrection_[i][j]; + defectConstraint.lower(j) *= inverseCoarseCorrection; + defectConstraint.upper(j) *= inverseCoarseCorrection; // orient relative defect constraints if (defectConstraint.lower(j) > defectConstraint.upper(j)) -- GitLab