]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Micro simplication. 13323/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 1 Feb 2022 19:03:34 +0000 (12:03 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 1 Feb 2022 19:03:34 +0000 (12:03 -0700)
source/base/data_out_base.cc

index 92490893f751b3861d57bfdc8bb39372066f3b39..21e867ad141331f30318cfa314347cce1539a282 100644 (file)
@@ -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;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.