13 #include "DataStructures/DataBox/PrefixHelpers.hpp"
15 #include "DataStructures/Tensor/EagerMath/Magnitude.hpp"
16 #include "Domain/InterfaceComputeTags.hpp"
17 #include "Domain/Structure/CreateInitialMesh.hpp"
21 #include "Domain/Structure/OrientationMap.hpp"
23 #include "Domain/TagsCharacteresticSpeeds.hpp"
24 #include "Domain/TagsTimeDependent.hpp"
25 #include "NumericalAlgorithms/DiscontinuousGalerkin/MortarHelpers.hpp"
26 #include "NumericalAlgorithms/DiscontinuousGalerkin/NormalDotFlux.hpp"
27 #include "NumericalAlgorithms/DiscontinuousGalerkin/Tags.hpp"
29 #include "ParallelAlgorithms/Initialization/MutateAssign.hpp"
38 template <
typename Metavariables>
43 namespace Initialization {
69 template <
typename Metavariables>
71 static constexpr
size_t dim = Metavariables::system::volume_dim;
72 using boundary_scheme =
typename Metavariables::boundary_scheme;
73 using normal_dot_fluxes_tag =
75 typename boundary_scheme::variables_tag>;
77 template <
typename Tag>
81 template <
typename Tag>
86 template <
typename Tag>
91 template <
typename LocalSystem,
bool IsInFluxConservativeForm =
92 LocalSystem::is_in_flux_conservative_form>
99 template <
typename Tag>
104 template <
typename Tag>
108 template <
typename Tag>
113 typename LocalSystem::char_speeds_compute_tag, dim>;
126 template <
typename TagsList>
127 static void initialize(
129 const auto& internal_directions =
130 db::get<domain::Tags::InternalDirections<dim>>(*box);
132 const auto& boundary_directions =
133 db::get<domain::Tags::BoundaryDirectionsInterior<dim>>(*box);
136 normal_dot_fluxes_interface{};
137 for (
const auto& direction : internal_directions) {
138 const auto& interface_num_points =
141 .number_of_grid_points();
142 normal_dot_fluxes_interface[direction].initialize(interface_num_points,
147 normal_dot_fluxes_boundary_exterior{},
148 normal_dot_fluxes_boundary_interior{};
149 for (
const auto& direction : boundary_directions) {
150 const auto& boundary_num_points =
153 .number_of_grid_points();
154 normal_dot_fluxes_boundary_exterior[direction].initialize(
155 boundary_num_points, 0.);
156 normal_dot_fluxes_boundary_interior[direction].initialize(
157 boundary_num_points, 0.);
159 Initialization::mutate_assign<simple_tags>(
160 box, std::move(normal_dot_fluxes_interface),
161 std::move(normal_dot_fluxes_boundary_interior),
162 std::move(normal_dot_fluxes_boundary_exterior));
166 template <
typename LocalSystem>
167 struct Impl<LocalSystem, true> {
170 template <
typename Tag>
175 template <
typename Tag>
179 template <
typename Tag>
184 typename LocalSystem::char_speeds_compute_tag, dim>;
190 typename LocalSystem::variables_tag,
200 typename LocalSystem::variables_tag,
210 typename LocalSystem::variables_tag,
218 template <
typename TagsList>
219 static auto initialize(
223 using initialization_tags =
224 tmpl::list<domain::Tags::InitialExtents<Metavariables::volume_dim>>;
227 typename Impl<typename Metavariables::system>::simple_tags;
230 typename Impl<typename Metavariables::system>::compute_tags;
232 template <
typename DbTagsList,
typename... InboxTags,
typename ArrayIndex,
233 typename ActionList,
typename ParallelComponent>
234 static auto apply(db::DataBox<DbTagsList>& box,
237 const ArrayIndex& , ActionList ,
238 const ParallelComponent*
const ) noexcept {
240 return std::make_tuple(std::move(box));