From: Wolfgang Bangerth Date: Fri, 6 Feb 2015 03:16:46 +0000 (-0600) Subject: Either make implicit casts from Tensor<1,dim> to Point explicit, or correct... X-Git-Tag: v8.3.0-rc1~492^2~13 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d88aa226626ff2203729b70e86c915b40cff435a;p=dealii.git Either make implicit casts from Tensor<1,dim> to Point explicit, or correct the data type of where we store the result. --- diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index 9688fa486b..3af72e1dd8 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -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; 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)); } @@ -173,10 +173,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); } @@ -285,13 +285,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))); }