From 54c4f3405747bc637c5bb286f1c70510d1ef3a2b Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 8 Jul 2018 13:31:14 -0400 Subject: [PATCH] step-9: Make the implementation match the documentation. There was a disconnect between what was described in the introduction and the actual class implementation. --- examples/step-9/doc/intro.dox | 8 ++++++-- examples/step-9/step-9.cc | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/step-9/doc/intro.dox b/examples/step-9/doc/intro.dox index 0bd0a51c54..1bd0412c5c 100644 --- a/examples/step-9/doc/intro.dox +++ b/examples/step-9/doc/intro.dox @@ -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}, diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index ad29716a41..72cfe5f31f 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -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} -- 2.39.5