]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid the use of the M_PI macro. 18541/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 3 Jun 2025 13:31:16 +0000 (07:31 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 3 Jun 2025 13:53:03 +0000 (07:53 -0600)
examples/step-81/step-81.cc

index 9e4eaa13f1303c0e2a5be45e4c4cb41f5b44f2d4..0ddd7cc55743ed1a22bb9e100d379310bce9e3bd 100644 (file)
@@ -224,9 +224,10 @@ namespace Step81
     const auto distance = (dipole_position - point).norm() / dipole_radius;
     if (distance > 1.)
       return J_a;
-    double scale = std::cos(distance * M_PI / 2.) *
-                   std::cos(distance * M_PI / 2.) / (M_PI / 2. - 2. / M_PI) /
-                   dipole_radius / dipole_radius;
+    double scale = std::cos(distance * numbers::PI / 2.) *
+                   std::cos(distance * numbers::PI / 2.) /
+                   (numbers::PI / 2. - 2. / numbers::PI) / dipole_radius /
+                   dipole_radius;
     J_a = dipole_strength * dipole_orientation * scale;
     return J_a;
   }

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.