From f4ee21bdcc1a6f7cf5a5c746ce846a7cc31b87c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 1 Feb 2022 12:03:34 -0700 Subject: [PATCH] Micro simplication. --- source/base/data_out_base.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; -- 2.39.5