]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make some temporary variables const.
authorDavid Wells <wellsd2@rpi.edu>
Sat, 25 Jun 2016 21:30:21 +0000 (17:30 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 25 Jun 2016 23:42:17 +0000 (19:42 -0400)
examples/step-25/step-25.cc

index 5ee224cf5833ec40e1aed7203ba9130c3b1c1f06..c7f18d23c29b0fa96ee9dba582f4594d4eee26f2 100644 (file)
@@ -193,15 +193,15 @@ namespace Step25
 
       case 3:
       {
-        double theta  = numbers::PI/4;
-        double phi = numbers::PI/4;
-        double tau = 1.;
-        double c0  = 1.;
-        double s   = 1.;
-        double arg = p[0]*std::cos(theta) +
-                     p[1]*std::sin(theta) * std::cos(phi) +
-                     std::sin(theta) * std::sin(phi) *
-                     (p[2]*std::cosh(tau)+t*std::sinh(tau));
+        const double theta  = numbers::PI/4;
+        const double phi = numbers::PI/4;
+        const double tau = 1.;
+        const double c0  = 1.;
+        const double s   = 1.;
+        const double arg = p[0]*std::cos(theta) +
+                           p[1]*std::sin(theta) * std::cos(phi) +
+                           std::sin(theta) * std::sin(phi) *
+                           (p[2]*std::cosh(tau)+t*std::sinh(tau));
         return 4.*std::atan(c0*std::exp(s*arg));
       }
 

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.