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 <tuple>
8 : #include <utility>
9 :
10 : #include "DataStructures/DataBox/DataBox.hpp"
11 : #include "Evolution/Systems/Cce/NewmanPenrose.hpp"
12 : #include "Evolution/Systems/Cce/PreSwshDerivatives.hpp"
13 :
14 : namespace Cce {
15 : namespace Actions {
16 :
17 : /*!
18 : * \ingroup ActionsGroup
19 : * \brief Calculate \f$\Psi_0\f$ and its radial derivative
20 : * \f$\partial_\underline{\lambda}\Psi_0\f$ at the inner boundary of
21 : * the CCE grid.
22 : *
23 : * \details This action is to be called after `Tags::BondiJ` has been updated.
24 : * Note that `Tags::BondiJ` is in the asymptotically inertial frame, while the
25 : * returned \f$\Psi_0\f$ and its radial derivative are in the Cauchy frame.
26 : * \f$\underline \lambda\f$ is an affine parameter along the null
27 : * rays generated by \f$l\f$, see Eq. (19a) of \cite Moxon2020gha.
28 : */
29 1 : struct CalculatePsi0AndDerivAtInnerBoundary {
30 0 : using const_global_cache_tags = tmpl::list<Tags::LMax>;
31 0 : using mutators =
32 : tmpl::list<TransformBondiJToCauchyCoords,
33 : PreSwshDerivatives<Tags::Dy<Tags::BondiJCauchyView>>,
34 : PreSwshDerivatives<Tags::Dy<Tags::Dy<Tags::BondiJCauchyView>>>,
35 : VolumeWeyl<Tags::Psi0Match>,
36 : PreSwshDerivatives<Tags::Dy<Tags::Psi0Match>>,
37 : InnerBoundaryWeyl>;
38 :
39 : template <typename DbTags, typename... InboxTags, typename Metavariables,
40 : typename ArrayIndex, typename ActionList,
41 : typename ParallelComponent>
42 0 : static Parallel::iterable_action_return_t apply(
43 : db::DataBox<DbTags>& box,
44 : const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
45 : const Parallel::GlobalCache<Metavariables>& /*cache*/,
46 : const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
47 : const ParallelComponent* const /*meta*/) {
48 : tmpl::for_each<mutators>([&box](auto mutator_v) {
49 : using mutator = typename decltype(mutator_v)::type;
50 : db::mutate_apply<mutator>(make_not_null(&box));
51 : });
52 : return {Parallel::AlgorithmExecution::Continue, std::nullopt};
53 : }
54 : };
55 : } // namespace Actions
56 : } // namespace Cce
|