]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use deal_II_numbers::PI instead of M_PI
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Oct 2006 00:55:27 +0000 (00:55 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Oct 2006 00:55:27 +0000 (00:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@14079 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-9/step-9.cc

index 87f41b7a714c6be0eb0565d299faa50927c6a3d9..5cc0d7712df4af04701263118caf5bea7fc6fbb7 100644 (file)
 #include <iostream>
 
 
-
-                                // In strict ANSI C mode, the
-                                // following constant are not defined
-                                // by default, so we do it ourselves:
-#ifndef M_PI
-#  define      M_PI            3.14159265358979323846
-#endif
-
                                 // The last step is as in previous
                                 // programs:
 using namespace dealii;
@@ -339,7 +331,7 @@ AdvectionField<dim>::value (const Point<dim> &p) const
   Point<dim> value;
   value[0] = 2;
   for (unsigned int i=1; i<dim; ++i)
-    value[i] = 1+0.8*std::sin(8*M_PI*p[0]);
+    value[i] = 1+0.8*std::sin(8*deal_II_numbers::PI*p[0]);
 
   return value;
 }
@@ -486,7 +478,7 @@ BoundaryValues<dim>::value (const Point<dim>   &p,
 {
   Assert (component == 0, ExcIndexRange (component, 0, 1));
 
-  const double sine_term = std::sin(16*M_PI*std::sqrt(p.square()));
+  const double sine_term = std::sin(16*deal_II_numbers::PI*std::sqrt(p.square()));
   const double weight    = std::exp(-5*p.square()) / std::exp(-5.);
   return sine_term * weight;
 }

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.