]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Eradicate implicit casts from Tensor<1,dim> to Point<dim>.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 6 Feb 2015 03:15:20 +0000 (21:15 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 9 Feb 2015 23:27:13 +0000 (17:27 -0600)
tests/bits/step-51.cc
tests/bits/step-51p.cc
tests/bits/step-7.cc
tests/codim_one/bem_integration.cc
tests/hp/step-7.cc

index 9ca8c41a29e91e0dde22d4f9a7ad1505683466c0..78682b09e996f2ca157b08d842cf4fb6a5ca7842 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -122,8 +122,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));
       }
 
@@ -141,10 +141,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);
       }
@@ -241,13 +241,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)));
       }
 
index f3e605916a3e89d1e2bc4f795cefbc1f0669976b..969634544ab8c1d948c94ddcee8258e8aa6bba1e 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -122,8 +122,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));
       }
 
@@ -141,10 +141,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);
       }
@@ -241,13 +241,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)));
       }
 
index 587011afcea9ceff9c83198cc6b006e866900e6e..b3dcb08f0fe8a5643e756ba2d7e81d7d5da5770a 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -113,8 +113,8 @@ double Solution<dim>::value (const Point<dim>   &p,
   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));
     }
 
@@ -130,10 +130,10 @@ Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
 
   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);
     }
@@ -162,14 +162,14 @@ double RightHandSide<dim>::value (const Point<dim>   &p,
   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 - 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)));
-      return_value += std::exp(-x_minus_xi.square() /
+      return_value += std::exp(-x_minus_xi.norm_square() /
                                (this->width * this->width));
     }
 
index 85483a141f8321cb2724a5a716436238b6a93ed0..063d2dd28b737b8f7992fd63e278b56611e49461 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -73,15 +73,15 @@ public:
                                    const Point<dim+1> &point);
 
 private:
-  double term_S(const Point<3> &r,
-                const Point<3> &a1,
-                const Point<3> &a2,
+  double term_S(const Tensor<1,3> &r,
+                const Tensor<1,3> &a1,
+                const Tensor<1,3> &a2,
                 const Point<3> &n,
                 const double &rn_c);
 
-  double term_D(const Point<3> &r,
-                const Point<3> &a1,
-                const Point<3> &a2);
+  double term_D(const Tensor<1,3> &r,
+                const Tensor<1,3> &a1,
+                const Tensor<1,3> &a2);
 
   SmartPointer<FEValues<dim,dim+1> > fe_values;
 };
@@ -125,8 +125,8 @@ LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(vector<double> &dst,
   vector<DerivativeForm<1,2,3> > jacobians = fe_values->get_jacobians();
   vector<Point<3> > normals = fe_values->get_normal_vectors();
 
-  Point<3> r,a1,a2,n,r_c,n_c;
-  r_c = point-cell->center();
+  Point<3> n,n_c;
+  Tensor<1,3> r_c = point-cell->center();
   n_c = normals[4];
 
   double rn_c = r_c*n_c;
@@ -134,9 +134,9 @@ LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(vector<double> &dst,
   vector<double> i_D(4);
   for (unsigned int q_point=0; q_point < 4; ++q_point)
     {
-      r = point-cell->vertex(q_point);
-      a1 = transpose(jacobians[q_point])[0];
-      a2 = transpose(jacobians[q_point])[1];
+      const Tensor<1,3> r = point-cell->vertex(q_point);
+      const Tensor<1,3> a1 = transpose(jacobians[q_point])[0];
+      const Tensor<1,3> a2 = transpose(jacobians[q_point])[1];
       n =  normals[q_point];
       i_S[q_point]=term_S(r,a1,a2,n,rn_c);
       i_D[q_point]=term_D(r,a1,a2);
@@ -148,9 +148,9 @@ LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(vector<double> &dst,
 
 template <int dim>
 double
-LaplaceKernelIntegration<dim>::term_S (const Point<3> &r,
-                                       const Point<3> &a1,
-                                       const Point<3> &a2,
+LaplaceKernelIntegration<dim>::term_S (const Tensor<1,3> &r,
+                                       const Tensor<1,3> &a1,
+                                       const Tensor<1,3> &a2,
                                        const Point<3> &n,
                                        const double &rn_c)
 {
@@ -174,9 +174,9 @@ LaplaceKernelIntegration<dim>::term_S (const Point<3> &r,
 
 template <int dim>
 double
-LaplaceKernelIntegration<dim>::term_D (const Point<3> &r,
-                                       const Point<3> &a1,
-                                       const Point<3> &a2)
+LaplaceKernelIntegration<dim>::term_D (const Tensor<1,3> &r,
+                                       const Tensor<1,3> &a1,
+                                       const Tensor<1,3> &a2)
 {
   Point<3> ra1, ra2, a12;
 
index c063100147df04d51b1b9bd5284f713ab8d5a46e..4354841b2805187708b1d86d23b83a1be223025b 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2005 - 2014 by the deal.II authors
+// Copyright (C) 2005 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -112,8 +112,8 @@ double Solution<dim>::value (const Point<dim>   &p,
   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));
     }
 
@@ -129,10 +129,10 @@ Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
 
   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);
     }
@@ -161,14 +161,14 @@ double RightHandSide<dim>::value (const Point<dim>   &p,
   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 - 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)));
-      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.