From: Wolfgang Bangerth Date: Tue, 1 Feb 2022 19:03:34 +0000 (-0700) Subject: Micro simplication. X-Git-Tag: v9.4.0-rc1~542^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4ee21bdcc1a6f7cf5a5c746ce846a7cc31b87c7;p=dealii.git Micro simplication. --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 92490893f7..21e867ad14 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -3283,13 +3283,10 @@ namespace DataOutBase b[1] * (v_inter[2] - v_min[2]) - c + v_min[2]; // normalize the gradient - double gradient_norm = - std::sqrt(std::pow(gradient[0], 2.0) + std::pow(gradient[1], 2.0)); - gradient[0] /= gradient_norm; - gradient[1] /= gradient_norm; + gradient /= gradient.norm(); - double lambda = -gradient[0] * (v_min[0] - v_max[0]) - - gradient[1] * (v_min[1] - v_max[1]); + const double lambda = -gradient[0] * (v_min[0] - v_max[0]) - + gradient[1] * (v_min[1] - v_max[1]); Point<6> gradient_parameters;