InitializeFirstHypersurface.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/Initialize/InitializeJ.hpp"
12 #include "Evolution/Systems/Cce/OptionTags.hpp"
13 #include "Evolution/Systems/Cce/ScriPlusValues.hpp"
14 #include "Parallel/GlobalCache.hpp"
15 #include "Utilities/Gsl.hpp"
16 #include "Utilities/TMPL.hpp"
17 
18 namespace Cce {
19 namespace Actions {
20 
21 /*!
22  * \ingroup ActionsGroup
23  * \brief Given initial boundary data for \f$J\f$ and \f$\partial_r J\f$,
24  * computes the initial hypersurface quantities \f$J\f$ and gauge values.
25  *
26  * \details This action is to be called after boundary data has been received,
27  * but before the time-stepping evolution loop. So, it should be either late in
28  * an initialization phase or early (before a `Actions::Goto` loop or similar)
29  * in the `Evolve` phase.
30  *
31  * Internally, this dispatches to the call function of
32  * `Tags::InitializeJ`, which designates a hypersurface initial data generator
33  * chosen by input file options, `InitializeGauge`, and
34  * `InitializeScriPlusValue<Tags::InertialRetardedTime>` to perform the
35  * computations. Refer to the documentation for those mutators for mathematical
36  * details.
37  */
39  using const_global_cache_tags =
40  tmpl::list<Tags::LMax, Tags::NumberOfRadialPoints, Tags::InitializeJ>;
41 
42  template <typename DbTags, typename... InboxTags, typename Metavariables,
43  typename ArrayIndex, typename ActionList,
44  typename ParallelComponent>
45  static std::tuple<db::DataBox<DbTags>&&> apply(
47  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
48  const Parallel::GlobalCache<Metavariables>& /*cache*/,
49  const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
50  const ParallelComponent* const /*meta*/) noexcept {
51  db::mutate_apply<InitializeJ::InitializeJ::mutate_tags,
52  InitializeJ::InitializeJ::argument_tags>(
53  db::get<Tags::InitializeJ>(box), make_not_null(&box));
54  db::mutate_apply<InitializeScriPlusValue<Tags::InertialRetardedTime>>(
55  make_not_null(&box),
56  db::get<::Tags::TimeStepId>(box).substep_time().value());
57  return {std::move(box)};
58  }
59 };
60 } // namespace Actions
61 } // namespace Cce
utility
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:16
GlobalCache.hpp
tuple
DataBox.hpp
Cce::Actions::InitializeFirstHypersurface
Given initial boundary data for and , computes the initial hypersurface quantities and gauge values...
Definition: InitializeFirstHypersurface.hpp:38
db::mutate_apply
constexpr auto mutate_apply(F &&f, const gsl::not_null< DataBox< BoxTags > * > box, Args &&... args) noexcept(DataBox_detail::check_mutate_apply_mutate_tags(BoxTags{}, MutateTags{}) and DataBox_detail::check_mutate_apply_argument_tags(BoxTags{}, ArgumentTags{}) and noexcept(DataBox_detail::mutate_apply(f, box, MutateTags{}, ArgumentTags{}, std::forward< Args >(args)...)))
Apply the invokable f mutating items MutateTags and taking as additional arguments ArgumentTags and a...
Definition: DataBox.hpp:1640
cstddef
tuples::TaggedTuple
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
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
db::DataBox
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
TMPL.hpp