]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix up a place where we use Point<dim> for directions when we should be
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 5 Feb 2015 02:49:53 +0000 (20:49 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 5 Feb 2015 03:25:14 +0000 (21:25 -0600)
using Tensor<1,dim>.

source/grid/grid_out.cc

index c8a025f6e57faceb35e0ba23584c0dd0a0a648fb..590155f7236c3e9ba55ddc801dc083b2e38bfd0a 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 1999 - 2014 by the deal.II authors
+// Copyright (C) 1999 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -3581,19 +3581,19 @@ namespace internal
           // in this plane. we chose the first one
           // to be the projection of the z-axis
           // to this plane
-          const Point<dim> vector1
+          const Tensor<1,dim> vector1
             = Point<dim>(0,0,1) - ((Point<dim>(0,0,1) * view_direction) * view_direction);
-          const Point<dim> unit_vector1 = vector1 / std::sqrt(vector1.square());
+          const Tensor<1,dim> unit_vector1 = vector1 / vector1.norm();
 
           // now the third vector is fixed. we
           // chose the projection of a more or
           // less arbitrary vector to the plane
           // perpendicular to the first one
-          const Point<dim> vector2
+          const Tensor<1,dim> vector2
             = (Point<dim>(1,0,0)
                - ((Point<dim>(1,0,0) * view_direction) * view_direction)
                - ((Point<dim>(1,0,0) * unit_vector1)   * unit_vector1));
-          const Point<dim> unit_vector2 = vector2 / std::sqrt(vector2.square());
+          const Tensor<1,dim> unit_vector2 = vector2 / vector2.norm();
 
 
           for (; cell!=endc; ++cell)

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.