SpECTRE Documentation Coverage Report
Current view: top level - NumericalAlgorithms/Spectral - SwshFiltering.hpp Hit Total Coverage
Commit: 2ae2b99409ac582030d56a4560a92a3e066a7e54 Lines: 4 5 80.0 %
Date: 2022-01-15 08:40:38
Legend: Lines: hit not hit

          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             : 
       8             : #include "DataStructures/ComplexDataVector.hpp"  // IWYU pragma: keep
       9             : #include "DataStructures/ComplexModalVector.hpp"  // IWYU pragma: keep
      10             : #include "DataStructures/SpinWeighted.hpp"  // IWYU pragma: keep
      11             : #include "Utilities/Gsl.hpp"
      12             : 
      13             : // IWYU pragma: no_forward_declare ComplexDataVector
      14             : // IWYU pragma: no_forward_declare ComplexModalVector
      15             : // IWYU pragma: no_forward_declare SpinWeighted
      16             : 
      17             : namespace Spectral {
      18             : namespace Swsh {
      19             : /// @{
      20             : /*!
      21             :  * \ingroup SwshGroup
      22             :  * \brief Filter a volume collocation set in the form of consecutive
      23             :  * libsharp-compatible spherical shells.
      24             :  *
      25             :  * \details Two separate filters are applied. First, an exponential radial
      26             :  * filter is applied to each radial ray, with parameters `exponential_alpha` and
      27             :  * `exponential_half_power` (see `Spectral::filtering::exponential_filter` for
      28             :  * details on these parameters). Next, a modal Heaviside angular filter is
      29             :  * applied which simply sets to zero all `l > limit_l` modes.
      30             :  * \note It is assumed that Gauss-Lobatto points are used for the radial
      31             :  * direction (as that is the representation for CCE evolution). If that is too
      32             :  * restrictive, this function will need generalization.
      33             :  * \warning In principle, the radial filter in this function could cache the
      34             :  * matrix used, but currently does not. If such a cache becomes desirable for
      35             :  * performance, care must be taken regarding the exponential parameters. An
      36             :  * implementation similar to `dg::Actions::ExponentialFilter` may be necessary.
      37             :  * \note  For comparisons with SpEC CCE, `exponential_half_power` of 8,
      38             :  * `exponential_alpha` of 108, and `limit_l` of `l_max - 3` should be used. This
      39             :  * gives a highly aggressive radial filter, though, and for runs not attempting
      40             :  * to compare with SpEC it is recommended to use smaller parameters to preserve
      41             :  * more of the radial modes.
      42             :  */
      43             : template <int Spin>
      44           1 : void filter_swsh_volume_quantity(
      45             :     gsl::not_null<SpinWeighted<ComplexDataVector, Spin>*> to_filter,
      46             :     size_t l_max, size_t limit_l, double exponential_alpha,
      47             :     size_t exponential_half_power, gsl::not_null<ComplexDataVector*> buffer,
      48             :     gsl::not_null<SpinWeighted<ComplexModalVector, Spin>*> transform_buffer);
      49             : 
      50             : template <int Spin>
      51           1 : void filter_swsh_volume_quantity(
      52             :     gsl::not_null<SpinWeighted<ComplexDataVector, Spin>*> to_filter,
      53             :     size_t l_max, size_t limit_l, double exponential_alpha,
      54             :     size_t exponential_half_power);
      55             : /// @}
      56             : /// @{
      57             : /*!
      58             :  * \ingroup SwshGroup
      59             :  * \brief Filter a libsharp-compatible set of collocation points on a spherical
      60             :  * surface.
      61             :  *
      62             :  * \details A modal Heaviside angular filter is applied which simply sets to
      63             :  * zero all `l > limit_l` modes.
      64             :  * \note For comparisons with SpEC CCE, `limit_l` of `l_max - 3` should be used.
      65             :  */
      66             : template <int Spin>
      67           1 : void filter_swsh_boundary_quantity(
      68             :     gsl::not_null<SpinWeighted<ComplexDataVector, Spin>*> to_filter,
      69             :     size_t l_max, size_t limit_l,
      70             :     gsl::not_null<SpinWeighted<ComplexModalVector, Spin>*> transform_buffer);
      71             : 
      72             : template <int Spin>
      73           1 : void filter_swsh_boundary_quantity(
      74             :     gsl::not_null<SpinWeighted<ComplexDataVector, Spin>*> to_filter,
      75             :     size_t l_max, size_t limit_l);
      76             : /// @}
      77             : }  // namespace Swsh
      78             : }  // namespace Spectral

Generated by: LCOV version 1.14