]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Either make implicit casts from Tensor<1,dim> to Point<dim> explicit, or correct...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 6 Feb 2015 03:16:46 +0000 (21:16 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 9 Feb 2015 23:27:14 +0000 (17:27 -0600)
examples/step-7/step-7.cc

index f66e0448076786fabf681607df0fe73fff00cf6c..d60488a5d08581308f3487b5a3c6d8f23411869f 100644 (file)
@@ -1,6 +1,6 @@
 /* ---------------------------------------------------------------------
  *
- * Copyright (C) 2000 - 2014 by the deal.II authors
+ * Copyright (C) 2000 - 2015 by the deal.II authors
  *
  * This file is part of the deal.II library.
  *
@@ -210,8 +210,8 @@ namespace Step7
     double return_value = 0;
     for (unsigned int i=0; i<this->n_source_centers; ++i)
       {
-        const Point<dim> x_minus_xi = p - this->source_centers[i];
-        return_value += std::exp(-x_minus_xi.square() /
+        const Tensor<1,dim> x_minus_xi = p - this->source_centers[i];
+        return_value += std::exp(-x_minus_xi.norm_square() /
                                  (this->width * this->width));
       }
 
@@ -251,13 +251,13 @@ namespace Step7
 
     for (unsigned int i=0; i<this->n_source_centers; ++i)
       {
-        const Point<dim> x_minus_xi = p - this->source_centers[i];
+        const Tensor<1,dim> x_minus_xi = p - this->source_centers[i];
 
         // For the gradient, note that its direction is along (x-x_i), so we
         // add up multiples of this distance vector, where the factor is given
         // by the exponentials.
         return_value += (-2 / (this->width * this->width) *
-                         std::exp(-x_minus_xi.square() /
+                         std::exp(-x_minus_xi.norm_square() /
                                   (this->width * this->width)) *
                          x_minus_xi);
       }
@@ -295,16 +295,16 @@ namespace Step7
     double return_value = 0;
     for (unsigned int i=0; i<this->n_source_centers; ++i)
       {
-        const Point<dim> x_minus_xi = p - this->source_centers[i];
+        const Tensor<1,dim> x_minus_xi = p - this->source_centers[i];
 
         // The first contribution is the Laplacian:
-        return_value += ((2*dim - 4*x_minus_xi.square()/
+        return_value += ((2*dim - 4*x_minus_xi.norm_square()/
                           (this->width * this->width)) /
                          (this->width * this->width) *
-                         std::exp(-x_minus_xi.square() /
+                         std::exp(-x_minus_xi.norm_square() /
                                   (this->width * this->width)));
         // And the second is the solution itself:
-        return_value += std::exp(-x_minus_xi.square() /
+        return_value += std::exp(-x_minus_xi.norm_square() /
                                  (this->width * this->width));
       }
 

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.