]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-9: Make the implementation match the documentation.
authorDavid Wells <drwells@email.unc.edu>
Sun, 8 Jul 2018 17:31:14 +0000 (13:31 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 3 Aug 2018 02:39:05 +0000 (22:39 -0400)
There was a disconnect between what was described in the introduction and the
actual class implementation.

examples/step-9/doc/intro.dox
examples/step-9/step-9.cc

index 0bd0a51c547810c2b01c2ad150d6942166718dd5..1bd0412c5c75065afe616d9cbf9d93cb0bb5c3d5 100644 (file)
@@ -197,6 +197,10 @@ the following domain and functions (in $d=2$ space dimensions):
     \begin{array}{c}2 \\ 1+\frac 45 \sin(8\pi x)\end{array}
   \right),
   \\
+  s
+  &=&
+  0.1,
+  \\
   f({\mathbf x})
   &=&
   \left\{
@@ -215,7 +219,7 @@ the following domain and functions (in $d=2$ space dimensions):
   \\
   g
   &=&
-  e^{5(1-|{\mathbf x}|^2)} \sin(16\pi|{\mathbf x}|^2).
+  e^{5 (1 - |\mathbf x|^2)} \sin(16\pi|\mathbf x|^2).
 @f}
 For $d>2$, we extend $\beta$ and ${\mathbf x}_0$ by simply duplicating
 the last of the components shown above one more time.
@@ -242,7 +246,7 @@ cell $K$ the following indicator:
 @f[
   \eta_K =
   \left(
-    \frac {h_K}{12}
+    \frac {h_K}{24}
     \int_{\partial K}
       [\partial_n u_h]^2 \; d\sigma
   \right)^{1/2},
index ad29716a417d29ecb37fe8b0adbd7202614990d4..72cfe5f31f439b09b88c96ff4ac6b33ef0b3e9ad 100644 (file)
@@ -312,9 +312,9 @@ namespace Step9
     (void)component;
     Assert(component == 0, ExcIndexRange(component, 0, 1));
 
-    const double sine_term = std::sin(16. * numbers::PI * p.norm());
-    const double weight    = std::exp(-5. * p.norm_square()) / std::exp(-5.);
-    return sine_term * weight;
+    const double sine_term = std::sin(16. * numbers::PI * p.norm_square());
+    const double weight    = std::exp(5. * (1. - p.norm_square()));
+    return weight * sine_term;
   }
 
   // @sect3{GradientEstimation class declaration}

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.