UpdateGauge.hpp
1 // 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 
11 #include "Evolution/Systems/Cce/GaugeTransformBoundaryData.hpp"
12 #include "Evolution/Systems/Cce/OptionTags.hpp"
13 #include "Parallel/GlobalCache.hpp"
14 #include "Utilities/Gsl.hpp"
15 #include "Utilities/TMPL.hpp"
16 
17 namespace Cce {
18 namespace Actions {
19 
20 /*!
21  * \ingroup ActionsGroup
22  * \brief Updates all of the gauge quantities associated with the additional
23  * regularity-preserving gauge transformation on the boundaries for a new set of
24  * Cauchy coordinates.
25  *
26  * \details This action is to be called after `Tags::CauchyCartesianCoords` has
27  * been updated, typically via a time step of a set of coordinate evolution
28  * equations. It prepares the gauge quantities in the \ref DataBoxGroup for
29  * calls to the individual `GaugeAdjustedBoundaryValue` specializations.
30  *
31  * Internally, this dispatches to `GaugeUpdateAngularFromCartesian`,
32  * `GaugeUpdateJacobianFromCoordinates`, `GaugeUpdateInterpolator`, and
33  * `GaugeUpdateOmega` to perform the computations. Refer to the documentation
34  * for those mutators for mathematical details.
35  */
36 struct UpdateGauge {
37  using const_global_cache_tags = tmpl::list<Tags::LMax>;
38 
39  template <typename DbTags, typename... InboxTags, typename Metavariables,
40  typename ArrayIndex, typename ActionList,
41  typename ParallelComponent>
42  static std::tuple<db::DataBox<DbTags>&&> 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*/) noexcept {
50  make_not_null(&box));
54  db::mutate_apply<GaugeUpdateInterpolator<Tags::CauchyAngularCoords>>(
55  make_not_null(&box));
56  db::mutate_apply<GaugeUpdateOmega>(make_not_null(&box));
57  return {std::move(box)};
58  }
59 };
60 } // namespace Actions
61 } // namespace Cce
db::mutate_apply
constexpr void mutate_apply(F &&f, const gsl::not_null< DataBox< BoxTags > * > box, Args &&... args) noexcept
Apply the invokable f mutating items MutateTags and taking as additional arguments ArgumentTags and a...
Definition: DataBox.hpp:1381
utility
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:15
GlobalCache.hpp
Cce::Tags::CauchyAngularCoords
Definition: Tags.hpp:157
tuple
Cce::GaugeUpdateJacobianFromCoordinates
From the angular coordinates AngularCoordinateTag and the Cartesian coordinates CartesianCoordinateTa...
Definition: GaugeTransformBoundaryData.hpp:668
DataBox.hpp
cstddef
Cce::GaugeUpdateAngularFromCartesian
Update the angular coordinates stored in AngularTag via trigonometric operations applied to the Carte...
Definition: GaugeTransformBoundaryData.hpp:598
tuples::TaggedTuple
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
Cce::Actions::UpdateGauge
Updates all of the gauge quantities associated with the additional regularity-preserving gauge transf...
Definition: UpdateGauge.hpp:36
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
Cce::Tags::GaugeD
The spin-weight 0 angular Jacobian factor.
Definition: Tags.hpp:142
Gsl.hpp
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
Cce::Tags::GaugeC
The spin-weight 2 angular Jacobian factor.
Definition: Tags.hpp:137
TMPL.hpp
Cce::Tags::CauchyCartesianCoords
Definition: Tags.hpp:163