10 #include "DataStructures/DataBox/PrefixHelpers.hpp"
14 #include "NumericalAlgorithms/DiscontinuousGalerkin/BoundarySchemes/FirstOrder/BoundaryData.hpp"
16 #include "NumericalAlgorithms/DiscontinuousGalerkin/MortarHelpers.hpp"
17 #include "NumericalAlgorithms/DiscontinuousGalerkin/NumericalFluxes/NumericalFluxHelpers.hpp"
18 #include "NumericalAlgorithms/DiscontinuousGalerkin/Protocols.hpp"
20 #include "NumericalAlgorithms/Spectral/Projection.hpp"
22 #include "Utilities/ProtocolHelpers.hpp"
28 namespace FirstOrderScheme {
45 template <
size_t FaceDim,
typename NumericalFluxType,
typename AllFieldsTags,
46 typename AllExtraDataTags,
47 Requires<tt::conforms_to_v<NumericalFluxType,
54 const NumericalFluxType& numerical_flux_computer,
56 const size_t extent_perpendicular_to_boundary,
59 using variables_tags =
typename NumericalFluxType::variables_tags;
62 Variables<db::wrap_tags_in<::Tags::NormalDotNumericalFlux, variables_tags>>
63 normal_dot_numerical_fluxes{
mortar_mesh.number_of_grid_points()};
64 dg::NumericalFluxes::normal_dot_numerical_fluxes(
65 make_not_null(&normal_dot_numerical_fluxes), numerical_flux_computer,
66 local_boundary_data, remote_boundary_data);
69 tmpl::for_each<variables_tags>([&normal_dot_numerical_fluxes,
70 &local_boundary_data](
71 const auto tag_v) noexcept {
72 using tag = tmpl::type_from<decltype(tag_v)>;
73 auto& numerical_flux =
74 get<::Tags::NormalDotNumericalFlux<tag>>(normal_dot_numerical_fluxes);
75 const auto& local_flux =
76 get<::Tags::NormalDotFlux<tag>>(local_boundary_data.field_data);
77 for (
size_t i = 0; i < numerical_flux.size(); ++i) {
78 numerical_flux[i] -= local_flux[i];
83 auto projected_fluxes =
87 : std::move(normal_dot_numerical_fluxes);
91 return lift_flux(std::move(projected_fluxes),
92 extent_perpendicular_to_boundary, magnitude_of_face_normal);
bool needs_projection(const Mesh< Dim > &mesh1, const Mesh< Dim > &mesh2, const std::array< ChildSize, Dim > &child_sizes) noexcept
Determine whether data needs to be projected between a child mesh and its parent mesh....
void lift_flux(const gsl::not_null< Variables< tmpl::list< BoundaryCorrectionTags... >> * > boundary_correction_terms, const size_t extent_perpendicular_to_boundary, Scalar< DataVector > magnitude_of_face_normal) noexcept
Lifts the flux contribution from an interface to the volume.
Definition: LiftFlux.hpp:42
Defines the interface for DG numerical fluxes.
Definition: Protocols.hpp:90
Functionality related to discontinuous Galerkin schemes.
Definition: ComputeNonconservativeBoundaryFluxes.hpp:23
Distinguishes between field data, which can be projected to a mortar, and extra data,...
Definition: SimpleBoundaryData.hpp:32
Variables< Tags > project_from_mortar(const Variables< Tags > &vars, const Mesh< Dim > &face_mesh, const Mesh< Dim > &mortar_mesh, const MortarSize< Dim > &mortar_size) noexcept
Definition: MortarHelpers.hpp:85
Holds the number of grid points, basis, and quadrature in each direction of the computational grid.
Definition: Mesh.hpp:48
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Mesh< Dim > mortar_mesh(const Mesh< Dim > &face_mesh1, const Mesh< Dim > &face_mesh2) noexcept
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
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t
Definition: Requires.hpp:67
Variables< typename NumericalFluxType::variables_tags > boundary_flux(const dg::SimpleBoundaryData< AllFieldsTags, AllExtraDataTags > &local_boundary_data, const dg::SimpleBoundaryData< AllFieldsTags, AllExtraDataTags > &remote_boundary_data, const NumericalFluxType &numerical_flux_computer, const Scalar< DataVector > &magnitude_of_face_normal, const size_t extent_perpendicular_to_boundary, const Mesh< FaceDim > &face_mesh, const Mesh< FaceDim > &mortar_mesh, const MortarSize< FaceDim > &mortar_size) noexcept
Compute the boundary flux contribution and lift it to the volume.
Definition: BoundaryFlux.hpp:49
MortarSize< Dim - 1 > mortar_size(const ElementId< Dim > &self, const ElementId< Dim > &neighbor, size_t dimension, const OrientationMap< Dim > &orientation) noexcept