Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <unordered_map> 8 : #include <utility> 9 : 10 : #include "Domain/Structure/Direction.hpp" // IWYU pragma: keep 11 : #include "Domain/Structure/DirectionalId.hpp" 12 : #include "Domain/Structure/ElementId.hpp" // IWYU pragma: keep 13 : #include "Evolution/DiscontinuousGalerkin/Limiters/WenoOscillationIndicator.hpp" 14 : #include "Utilities/Gsl.hpp" 15 : 16 : /// \cond 17 : class DataVector; 18 : template <size_t> 19 : class Mesh; 20 : 21 : namespace boost { 22 : template <class T> 23 : struct hash; 24 : } // namespace boost 25 : /// \endcond 26 : 27 : namespace Limiters::Weno_detail { 28 : 29 : // Compute the WENO weighted reconstruction of a DataVector, see e.g., 30 : // Eq. 4.3 of Zhu2016. This is fairly standard, though different references can 31 : // differ in their choice of oscillation/smoothness indicator. The 32 : // `DerivativeWeight` enum specifies the relative weight of each derivative 33 : // term when computing the oscillation indicator. 34 : // 35 : // The reconstruction modifies the DataVector in `local_polynomial` by adding 36 : // to it a weighted combination of one or more neighbor contributions, passed 37 : // in as several DataVectors in `neighbor_polynommials`. Each neighbor 38 : // polynomial must have the same mean as the local polynomial; this is checked 39 : // with an ASSERT. 40 : template <size_t VolumeDim> 41 : void reconstruct_from_weighted_sum( 42 : gsl::not_null<DataVector*> local_polynomial, double neighbor_linear_weight, 43 : DerivativeWeight derivative_weight, const Mesh<VolumeDim>& mesh, 44 : const std::unordered_map<DirectionalId<VolumeDim>, DataVector, 45 : boost::hash<DirectionalId<VolumeDim>>>& 46 : neighbor_polynomials); 47 : 48 : } // namespace Limiters::Weno_detail