]> 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-51/step-51.cc

index 9688fa486b9b1eca49f927c96ab8c3ff0e000fc1..3af72e1dd8fb7be1bda20a39405fc085cf744e5e 100644 (file)
@@ -1,6 +1,6 @@
 /* ---------------------------------------------------------------------
  *
- * Copyright (C) 2013 - 2014 by the deal.II authors
+ * Copyright (C) 2013 - 2015 by the deal.II authors
  *
  * This file is part of the deal.II library.
  *
@@ -154,8 +154,8 @@ namespace Step51
     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));
       }
 
@@ -173,10 +173,10 @@ namespace Step51
 
     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];
 
         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);
       }
@@ -285,13 +285,13 @@ namespace Step51
     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];
 
         return_value +=
-          ((2*dim - 2*convection*x_minus_xi - 4*x_minus_xi.square()/
+          ((2*dim - 2*convection*x_minus_xi - 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)));
       }
 

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.