]> https://gitweb.dealii.org/ - dealii.git/commitdiff
tests: use deal.II constant for PI, might fix tests on cygwin
authorTimo Heister <timo.heister@gmail.com>
Mon, 11 Nov 2013 18:27:45 +0000 (18:27 +0000)
committerTimo Heister <timo.heister@gmail.com>
Mon, 11 Nov 2013 18:27:45 +0000 (18:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@31629 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/function_parser.cc
tests/bits/find_cell_alt_7.cc
tests/bits/parsed_function.cc
tests/fe/rt_approximation_01.cc
tests/multigrid/mg_output.cc
tests/multigrid/mg_renumbered_01.cc
tests/multigrid/mg_renumbered_02.cc
tests/multigrid/mg_renumbered_03.cc
tests/multigrid/step-16-02.cc
tests/multigrid/transfer_03.cc

index 10c49aa7d70afcc87a4795accf5ccfab638b84c8..c82bc72bf3d8ba57f7adf54978de152bc4441703 100644 (file)
@@ -38,7 +38,7 @@ int main ()
 
   // Define some constants that will be used by the function parser
   std::map<std::string, double> constants;
-  constants["pi"] = M_PI;
+  constants["pi"] = numbers::PI;
 
   // Define the variables that will be used inside the expressions
   std::string variables = "x,y";
index d141bfff66b5c5d3cf1cad1890557a7e2785ed27..be2a769410f305f1d122fd0935f80c32739fe836 100644 (file)
@@ -40,7 +40,7 @@ void check (Triangulation<2> &tria)
   // Test for a number of points, every ten degrees
   for (unsigned int i=0; i<200; i++)
     {
-      Point<2> p(std::sin((double)i/100.*M_PI), std::cos((double)i/100.*M_PI));
+      Point<2> p(std::sin((double)i/100.*numbers::PI), std::cos((double)i/100.*PI));
       p *= 1.-1e-8;
 
       std::pair<Triangulation<2>::active_cell_iterator, Point<2> > cell
index 647f052f9276f3c31482c4bb1dd8af3fd9e4b16f..4d17dd742c09627f945904f88bcad3545f810f27 100644 (file)
@@ -82,7 +82,7 @@ void Test()
               double delta=0.;
               for (unsigned int di=0; di<i; ++di)
                 {
-                  delta = values[j](di) - std::cos(M_PI*(i+1)*vertices[j][di])*t;
+                  delta = values[j](di) - std::cos(numbers::PI*(i+1)*vertices[j][di])*t;
                   if (std::abs(delta) > 1e-10)
                     deallog << "p(" << di << "): " << vertices[j] << ", delta: "
                             << delta << std::endl;
index 8cd27d16327b0ecd75d7d06fe278e93efc20e720..04978dbc61da98a8124d77e5085c31634b79de70 100644 (file)
@@ -490,7 +490,7 @@ int main ()
     MappingQ1Eulerian<2> mapping_euler (deformation, *dof_handler_def);
 
     // Try rotating the elements
-    for (double rotat = 0; rotat < 2 * M_PI; rotat += 0.25 * M_PI)
+    for (double rotat = 0; rotat < 2 * numbers::PI; rotat += 0.25 * numbers::PI)
       {
         // Rotate element
         VectorTools::project (*dof_handler_def, hn_constraints_def,
index 39c5e72e06ff443fa41d126cefd5a43fd5412540..c82d8560e2784886e1308f23abfda27abd377275 100644 (file)
@@ -81,7 +81,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
                                      Point<dim>(0,0) :
                                      Point<dim>(0,0,0));
           const double dist = p.distance(origin);
-          if (dist<0.25/M_PI)
+          if (dist<0.25/numbers::PI)
             {
               cell->set_refine_flag ();
               cell_refined = true;
index d860d13c06dba7eb09655f24b6b8a02682f146b1..e906286c7be764e2462499117e566e3d8d170541 100644 (file)
@@ -439,7 +439,7 @@ void LaplaceProblem<dim>::refine_local ()
                                      Point<dim>(0,0) :
                                      Point<dim>(0,0,0));
           const double dist = p.distance(origin);
-          if (dist<0.25/M_PI)
+          if (dist<0.25/numbers::PI)
             {
               cell->set_refine_flag ();
               cell_refined = true;
index fda0e5a06beb4f47e300b6b4bcd32ec5bc3f66e6..2a95e8ab481e212d982edb8d74cb588b007c0e3e 100644 (file)
@@ -317,7 +317,7 @@ void LaplaceProblem<dim>::refine_local ()
                                      Point<dim>(0,0) :
                                      Point<dim>(0,0,0));
           const double dist = p.distance(origin);
-          if (dist<0.25/M_PI)
+          if (dist<0.25/numbers::PI)
             {
               cell->set_refine_flag ();
               cell_refined = true;
index 9bcb1b87fc7fa44b6b337076b2dd9c477bfcf4ef..007066aecbe1fcda56b2815d44caee5e09cc9bb3 100644 (file)
@@ -385,7 +385,7 @@ void LaplaceProblem<dim>::refine_local ()
                                      Point<dim>(0,0) :
                                      Point<dim>(0,0,0));
           const double dist = p.distance(origin);
-          if (dist<0.25/M_PI)
+          if (dist<0.25/numbers::PI)
             {
               cell->set_refine_flag ();
               cell_refined = true;
index 66a9e22e6c423b63c65bf4f38d80627f9b1617cf..60e181bcf9a3d23413c1897d3ce6129d3adf542f 100644 (file)
@@ -27,6 +27,7 @@
 #include <deal.II/base/function.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/utilities.h>
+#include <deal.II/base/numbers.h>
 
 #include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -519,7 +520,7 @@ void LaplaceProblem<dim>::refine_grid (const std::string& reftype)
                                         Point<dim>(0,0) :
                                         Point<dim>(0,0,0));
              const double dist = p.distance(origin);
-             if(dist<0.25/M_PI)
+             if(dist<0.25/numbers::PI)
                {
                  cell->set_refine_flag ();
                  cell_refined = true;
index c7c0f700a5af374d4510cc2a24f843eb7c049a54..c5bd1654762c7ed64484167efa027e3f3a30a5d0 100644 (file)
@@ -80,7 +80,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
                                      Point<dim>(0,0) :
                                      Point<dim>(0,0,0));
           const double dist = p.distance(origin);
-          if (dist<0.25/M_PI)
+          if (dist<0.25/numbers::PI)
             {
               cell->set_refine_flag ();
               cell_refined = true;

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.