From 49399c71760de9e8d8ff466ce08bc5c47980813a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 5 Feb 2015 21:15:20 -0600 Subject: [PATCH] Eradicate implicit casts from Tensor<1,dim> to Point. --- tests/bits/step-51.cc | 16 ++++++------- tests/bits/step-51p.cc | 16 ++++++------- tests/bits/step-7.cc | 18 +++++++-------- tests/codim_one/bem_integration.cc | 36 +++++++++++++++--------------- tests/hp/step-7.cc | 18 +++++++-------- 5 files changed, 52 insertions(+), 52 deletions(-) diff --git a/tests/bits/step-51.cc b/tests/bits/step-51.cc index 9ca8c41a29..78682b09e9 100644 --- a/tests/bits/step-51.cc +++ b/tests/bits/step-51.cc @@ -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; in_source_centers; ++i) { - const Point 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; in_source_centers; ++i) { - const Point 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; in_source_centers; ++i) { - const Point 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))); } diff --git a/tests/bits/step-51p.cc b/tests/bits/step-51p.cc index f3e605916a..969634544a 100644 --- a/tests/bits/step-51p.cc +++ b/tests/bits/step-51p.cc @@ -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; in_source_centers; ++i) { - const Point 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; in_source_centers; ++i) { - const Point 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; in_source_centers; ++i) { - const Point 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))); } diff --git a/tests/bits/step-7.cc b/tests/bits/step-7.cc index 587011afce..b3dcb08f0f 100644 --- a/tests/bits/step-7.cc +++ b/tests/bits/step-7.cc @@ -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::value (const Point &p, double return_value = 0; for (unsigned int i=0; in_source_centers; ++i) { - const Point 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::gradient (const Point &p, for (unsigned int i=0; in_source_centers; ++i) { - const Point 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::value (const Point &p, double return_value = 0; for (unsigned int i=0; in_source_centers; ++i) { - const Point 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)); } diff --git a/tests/codim_one/bem_integration.cc b/tests/codim_one/bem_integration.cc index 85483a141f..063d2dd28b 100644 --- a/tests/codim_one/bem_integration.cc +++ b/tests/codim_one/bem_integration.cc @@ -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 &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 > fe_values; }; @@ -125,8 +125,8 @@ LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(vector &dst, vector > jacobians = fe_values->get_jacobians(); vector > 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 &dst, vector 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 &dst, template double -LaplaceKernelIntegration::term_S (const Point<3> &r, - const Point<3> &a1, - const Point<3> &a2, +LaplaceKernelIntegration::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::term_S (const Point<3> &r, template double -LaplaceKernelIntegration::term_D (const Point<3> &r, - const Point<3> &a1, - const Point<3> &a2) +LaplaceKernelIntegration::term_D (const Tensor<1,3> &r, + const Tensor<1,3> &a1, + const Tensor<1,3> &a2) { Point<3> ra1, ra2, a12; diff --git a/tests/hp/step-7.cc b/tests/hp/step-7.cc index c063100147..4354841b28 100644 --- a/tests/hp/step-7.cc +++ b/tests/hp/step-7.cc @@ -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::value (const Point &p, double return_value = 0; for (unsigned int i=0; in_source_centers; ++i) { - const Point 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::gradient (const Point &p, for (unsigned int i=0; in_source_centers; ++i) { - const Point 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::value (const Point &p, double return_value = 0; for (unsigned int i=0; in_source_centers; ++i) { - const Point 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)); } -- 2.39.5