FilterSwshVolumeQuantity.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <tuple>
7 #include <utility>
8 
10 #include "Evolution/Systems/Cce/OptionTags.hpp"
11 #include "Evolution/Systems/Cce/Tags.hpp"
12 #include "NumericalAlgorithms/Spectral/SwshFiltering.hpp"
13 #include "Parallel/GlobalCache.hpp"
14 #include "Parallel/Invoke.hpp"
15 #include "Time/Tags.hpp"
16 #include "Utilities/Gsl.hpp"
17 
18 namespace Cce {
19 namespace Actions {
20 
21 /*!
22  * \ingroup ActionsGroup
23  * \brief Filters the spherical volume data stored in `BondiTag` according to
24  * the filter parameters in the `Parallel::GlobalCache`.
25  *
26  * \details This action dispatches to the function
27  * `filter_swsh_volume_quantity()` to perform the mathematics of
28  * the filtering
29  *
30  * Uses:
31  * - DataBox:
32  * - `Cce::Tags::LMax`
33  * - GlobalCache:
34  * - `InitializationTags::FilterLMax`
35  * - `InitializationTags::RadialFilterAlpha`
36  * - `InitializationTags::RadialFilterHalfPower`
37  * \ref DataBoxGroup changes:
38  * - Adds: nothing
39  * - Removes: nothing
40  * - Modifies: `BondiTag`
41  */
42 template <typename BondiTag>
44  using const_global_cache_tags =
47  template <typename DbTags, typename... InboxTags, typename Metavariables,
48  typename ArrayIndex, typename ActionList,
49  typename ParallelComponent>
50  static auto apply(db::DataBox<DbTags>& box,
51  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
52  const Parallel::GlobalCache<Metavariables>& /*cache*/,
53  const ArrayIndex& /*array_index*/,
54  const ActionList /*meta*/,
55  const ParallelComponent* const /*meta*/) noexcept {
56  const size_t l_max = db::get<Tags::LMax>(box);
57  const size_t l_filter_start = get<Tags::FilterLMax>(box);
58  const double radial_filter_alpha = get<Tags::RadialFilterAlpha>(box);
59  const size_t radial_filter_half_power =
60  get<Tags::RadialFilterHalfPower>(box);
61  db::mutate<BondiTag>(
62  make_not_null(&box),
63  [
64  &l_max, &l_filter_start, &radial_filter_alpha, &
65  radial_filter_half_power
67  bondi_quantity) noexcept {
68  Spectral::Swsh::filter_swsh_volume_quantity(
69  make_not_null(&get(*bondi_quantity)), l_max, l_filter_start,
70  radial_filter_alpha, radial_filter_half_power);
71  });
72  return std::forward_as_tuple(std::move(box));
73  }
74 };
75 
76 } // namespace Actions
77 } // namespace Cce
utility
get
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:639
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:16
GlobalCache.hpp
tuple
DataBox.hpp
tuples::TaggedTuple
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
Cce::Tags::RadialFilterAlpha
Definition: OptionTags.hpp:282
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
Cce::Actions::FilterSwshVolumeQuantity
Filters the spherical volume data stored in BondiTag according to the filter parameters in the Parall...
Definition: FilterSwshVolumeQuantity.hpp:43
Gsl.hpp
Cce::Tags::FilterLMax
Definition: OptionTags.hpp:272
Cce::Tags::RadialFilterHalfPower
Definition: OptionTags.hpp:292
make_not_null
gsl::not_null< T * > make_not_null(T *ptr) noexcept
Construct a not_null from a pointer. Often this will be done as an implicit conversion,...
Definition: Gsl.hpp:880
db::DataBox
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183