WenoOscillationIndicator.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <ostream>
8 
9 /// \cond
10 class DataVector;
11 template <size_t>
12 class Mesh;
13 /// \endcond
14 
15 namespace Limiters {
16 namespace Weno_detail {
17 
18 // Denote different schemes for computing related oscillation indicators by
19 // changing the relative weight given to each derivative of the input data.
20 // - Unity: l'th derivative has weight 1
21 // - PowTwoEll: l'th derivative has weight 2^(2 l - 1)
22 // This penalizes higher derivatives more strongly: w(l=4) = 128
23 // - PowTwoEllOverEllFactorial: l'th derivative has weight 2^(2 l - 1) / (l!)^2
24 // This penalizes the 1st and 2nd derivatives most strongly, but then higher
25 // derivatives have decreasing weights so are weakly penalized: w(l=4) = 0.222
26 enum class DerivativeWeight { Unity, PowTwoEll, PowTwoEllOverEllFactorial };
27 
28 std::ostream& operator<<(std::ostream& os,
29  DerivativeWeight derivative_weight) noexcept;
30 
31 // Compute the WENO oscillation indicator (also called the smoothness indicator)
32 //
33 // The oscillation indicator measures the amount of variation in the input data,
34 // with larger indicator values corresponding to a larger amount of variation
35 // (either from large monotonic slopes or from oscillations).
36 //
37 // Implements an indicator similar to that of Eq. 23 of Dumbser2007, but with
38 // the necessary adaptations for use on square/cube grids. We favor this
39 // indicator because it is formulated in the reference coordinates, which we
40 // use for the WENO reconstruction, and because it lends itself to an efficient
41 // implementation.
42 template <size_t VolumeDim>
43 double oscillation_indicator(const DataVector& data,
44  const Mesh<VolumeDim>& mesh,
45  DerivativeWeight derivative_weight) noexcept;
46 
47 } // namespace Weno_detail
48 } // namespace Limiters
Holds the number of grid points, basis, and quadrature in each direction of the computational grid...
Definition: Mesh.hpp:49
Stores a collection of function values.
Definition: DataVector.hpp:42
Things relating to limiting.
Definition: HwenoModifiedSolution.cpp:109