From: Wolfgang Bangerth Date: Mon, 17 Mar 2014 12:40:31 +0000 (+0000) Subject: Avoid C++11-isms. X-Git-Tag: v8.2.0-rc1~685 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d71236619ee99f63f2a1008a88c253e6038ecb65;p=dealii.git Avoid C++11-isms. git-svn-id: https://svn.dealii.org/trunk@32664 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/curl_curl_01.cc b/tests/deal.II/curl_curl_01.cc index 2718b9df20..78c98e4bc3 100644 --- a/tests/deal.II/curl_curl_01.cc +++ b/tests/deal.II/curl_curl_01.cc @@ -1,7 +1,7 @@ // --------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2010 - 2013 by the deal.II authors +// Copyright (C) 2010 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -110,9 +110,11 @@ public: virtual void vector_value_list (const std::vector > &points, std::vector > &values) const; private: - const double PI = dealii::numbers::PI; - const double bc_constant = 0.1; + static const double bc_constant; }; +template const double ExactSolution::bc_constant = 0.1; + + // RIGHT HAND SIDE CLASS template class RightHandSide : public Function @@ -124,9 +126,10 @@ public: virtual void vector_value_list (const std::vector > &points, std::vector > &value_list) const; private: - const double PI = dealii::numbers::PI; - const double bc_constant = 0.1; + static const double bc_constant; }; +template const double RightHandSide::bc_constant = 0.1; + // DEFINE EXACT SOLUTION MEMBERS template double ExactSolution::value(const Point &p, @@ -137,8 +140,8 @@ double ExactSolution::value(const Point &p, double val = -1000; switch(component) { - case 0: val = cos(PI*p(0))*sin(PI*p(1)) + bc_constant; - case 1: val = -sin(PI*p(0))*cos(PI*p(1)) + bc_constant; + case 0: val = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant; + case 1: val = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant; } return val; @@ -148,8 +151,8 @@ void ExactSolution::vector_value(const Point &p, Vector &result) const { Assert(dim >= 2, ExcNotImplemented()); - result(0) = cos(PI*p(0))*sin(PI*p(1)) + bc_constant; - result(1) = -sin(PI*p(0))*cos(PI*p(1)) + bc_constant; + result(0) = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant; + result(1) = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant; } template @@ -165,9 +168,9 @@ void ExactSolution::value_list (const std::vector > &points, switch(component) { case 0: - values[i] = cos(PI*p(0))*sin(PI*p(1)) + bc_constant; + values[i] = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant; case 1: - values[i] = -sin(PI*p(0))*cos(PI*p(1)) + bc_constant; + values[i] = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant; } } } @@ -181,8 +184,8 @@ void ExactSolution::vector_value_list (const std::vector > &poin for (unsigned int i=0; i &p = points[i]; - values[i](0) = cos(PI*p(0))*sin(PI*p(1)) + bc_constant; - values[i](1) = -sin(PI*p(0))*cos(PI*p(1)) + bc_constant; + values[i](0) = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant; + values[i](1) = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant; } } // END EXACT SOLUTION MEMBERS @@ -201,8 +204,8 @@ void RightHandSide::vector_value (const Point &p, Assert (dim >= 2, ExcNotImplemented()); //2D solution - values(0) = (2*PI*PI + 1)*cos(PI*p(0))*sin(PI*p(1)) + bc_constant; - values(1) = -(2*PI*PI + 1)*sin(PI*p(0))*cos(PI*p(1)) + bc_constant; + values(0) = (2*numbers::PI*numbers::PI + 1)*cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant; + values(1) = -(2*numbers::PI*numbers::PI + 1)*sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant; } template void RightHandSide::vector_value_list (const std::vector > &points,