Initialize.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
9 #include "DataStructures/Tensor/EagerMath/Norms.hpp"
11 #include "ErrorHandling/Assert.hpp"
12 #include "Evolution/Initialization/DiscontinuousGalerkin.hpp"
13 #include "Evolution/Initialization/Evolution.hpp"
14 #include "Evolution/Systems/ScalarWave/Constraints.hpp"
18 #include "ParallelAlgorithms/Initialization/MergeIntoDataBox.hpp"
19 
20 namespace ScalarWave {
21 namespace Actions {
22 /// \ingroup InitializationGroup
23 /// \brief Initialize items related to constraints of the ScalarWave system
24 ///
25 /// We add both constraints and the constraint damping parameter to the
26 /// evolution databox.
27 ///
28 /// DataBox changes:
29 /// - Adds:
30 /// * `ScalarWave::Tags::ConstraintGamma2`
31 /// * `ScalarWave::Tags::OneIndexConstraint<Dim>`
32 /// * `ScalarWave::Tags::TwoIndexConstraint<Dim>`
33 /// * `::Tags::PointwiseL2Norm<ScalarWave::Tags::OneIndexConstraint<Dim>>`
34 /// * `::Tags::PointwiseL2Norm<ScalarWave::Tags::TwoIndexConstraint<Dim>>`
35 /// - Removes: nothing
36 /// - Modifies: nothing
37 ///
38 template <size_t Dim>
40  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
41  typename ArrayIndex, typename ActionList,
42  typename ParallelComponent>
43  static auto apply(db::DataBox<DbTagsList>& box,
44  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
46  const ArrayIndex& /*array_index*/,
47  const ActionList /*meta*/,
48  const ParallelComponent* const /*meta*/) noexcept {
49  const auto& mesh = db::get<domain::Tags::Mesh<Dim>>(box);
50  Scalar<DataVector> gamma_2{mesh.number_of_grid_points(), 0.};
51  using compute_tags =
58 
59  return std::make_tuple(
63  compute_tags>(std::move(box), std::move(gamma_2)));
64  }
65 };
66 } // namespace Actions
67 } // namespace ScalarWave
Parallel::ConstGlobalCache
Definition: ElementReceiveInterpPoints.hpp:16
DataBoxTag.hpp
System.hpp
Tags.hpp
db::AddComputeTags
tmpl::flatten< tmpl::list< Tags... > > AddComputeTags
List of Compute Item Tags to add to the DataBox.
Definition: DataBox.hpp:1171
ScalarWave::Tags::TwoIndexConstraint
Tag for the two-index constraint of the ScalarWave system.
Definition: Tags.hpp:59
DataBox.hpp
Assert.hpp
tuples::TaggedTuple
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Variables.hpp
ScalarWave::Actions::InitializeConstraints
Initialize items related to constraints of the ScalarWave system.
Definition: Initialize.hpp:39
db::AddSimpleTags
tmpl::flatten< tmpl::list< Tags... > > AddSimpleTags
List of Tags to add to the DataBox.
Definition: DataBox.hpp:1150
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
ScalarWave::Tags::OneIndexConstraint
Tag for the one-index constraint of the ScalarWave system.
Definition: Tags.hpp:49
ScalarWave::Tags::TwoIndexConstraintCompute
Compute item to get the two-index constraint for the scalar-wave evolution system.
Definition: Constraints.hpp:94
ScalarWave
Items related to evolving the scalar wave equation.
Definition: Characteristics.cpp:16
Initialization::merge_into_databox
auto merge_into_databox(db::DataBox< DbTagsList > &&box, Args &&... args) noexcept
Add tags that are not yet in the DataBox.
Definition: MergeIntoDataBox.hpp:133
Prefixes.hpp
db::DataBox
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
Tags::PointwiseL2NormCompute
Definition: Norms.hpp:126
ConstGlobalCache.hpp