From: Timo Heister Date: Sun, 6 Feb 2011 20:38:55 +0000 (+0000) Subject: step-32: rescale 3d starting value to avoid artifacts at the +/- z poles X-Git-Tag: v8.0.0~4398 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b74d42a5c14997905e26eb201fdca1bba3a9165b;p=dealii.git step-32: rescale 3d starting value to avoid artifacts at the +/- z poles git-svn-id: https://svn.dealii.org/trunk@23299 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 14e0e21ebe..6d07266426 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -175,10 +175,11 @@ namespace EquationData 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 phi = std::atan2(p(0),p(1)); - const double s_mod = (s - + - 0.2 * s * (1-s) * std::sin(6*phi)); + const double s_mod = s + + + 0.2 * s * (1-s) * std::sin(6*phi) * scale; return T0*(1.0-s_mod) + T1*s_mod; }