]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Streamline initial temperature conditions, given the discussion in the introduction.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 26 Sep 2011 23:48:18 +0000 (23:48 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 26 Sep 2011 23:48:18 +0000 (23:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@24445 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 9d4c4d0bbab13e708584ba8213fea588dc502f9a..6ef4c369c0a213f09b5ea13d93af67ddf0b73fa1 100644 (file)
@@ -218,22 +218,13 @@ namespace Step32
                                       // the inner to the outer
                                       // boundary; 0<=s<=1
       const double s = (r-R0)/h;
-
-                                      /* now compute an angular variation of the linear temperature field by
-                                         stretching the variable s appropriately. note that the following
-                                         formula leaves the end points s=0 and s=1 fixed, but stretches the
-                                         region in between depending on the angle phi=atan2(x,y).
-
-                                         For a plot, see
-                                         http://www.wolframalpha.com/input/?i=plot+%28%282*sqrt%28x^2%2By^2%29-1%29%2B0.2*%282*sqrt%28x^2%2By^2%29-1%29*%281-%282*sqrt%28x^2%2By^2%29-1%29%29*sin%286*atan2%28x%2Cy%29%29%29%2C+x%3D-1+to+1%2C+y%3D-1+to+1
-                                      */
-      const double scale = (dim==3)?std::max(0.0,cos(3.14159*abs(p(2)/R1))):1.0;
+      const double q = (dim==3)?std::max(0.0,cos(numbers::PI*abs(p(2)/R1))):1.0;
       const double phi   = std::atan2(p(0),p(1));
-      const double s_mod = s
-                          +
-                          0.2 * s * (1-s) * std::sin(6*phi) * scale;
+      const double tau = s
+                        +
+                        0.2 * s * (1-s) * std::sin(6*phi) * q;
 
-      return T0*(1.0-s_mod) + T1*s_mod;
+      return T0*(1.0-tau) + T1*tau;
     }
 
 

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.