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"
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 ActionGroup
23  * \brief Filters the spherical volume data stored in `BondiTag` according to
24  * the filter parameters in the `Parallel::ConstGlobalCache`.
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  * - ConstGlobalCache:
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*/,
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
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:24
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Defines classes and functions used for manipulating DataBox&#39;s.
Definition: InterpolationTargetWedgeSectionTorus.hpp:25
Definition: OptionTags.hpp:237
A Charm++ chare that caches constant data once per Charm++ node.
Definition: ConstGlobalCache.hpp:136
Definition: OptionTags.hpp:227
Filters the spherical volume data stored in BondiTag according to the filter parameters in the Parall...
Definition: FilterSwshVolumeQuantity.hpp:43
Defines functions and classes from the GSL.
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, but it may be necessary to perform the conversion explicitly when type deduction is desired.
Definition: Gsl.hpp:879
Definition: Test_ActionTesting.cpp:365
Defines class template ConstGlobalCache.
Definition: OptionTags.hpp:217
Definition: ComputeTimeDerivative.hpp:29
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182