ComputeBoundaryTerms.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <ostream>
7 
9 #include "NumericalAlgorithms/DiscontinuousGalerkin/Formulation.hpp"
11 #include "Utilities/Gsl.hpp"
12 #include "Utilities/TMPL.hpp"
13 
14 namespace evolution::dg::subcell {
15 template <typename... CorrectionTags, typename BoundaryCorrection,
16  typename... PackageFieldTags>
17 void compute_boundary_terms(
18  const gsl::not_null<Variables<tmpl::list<CorrectionTags...>>*>
19  boundary_corrections_on_face,
20  const BoundaryCorrection& boundary_correction,
21  const Variables<tmpl::list<PackageFieldTags...>>& upper_packaged_data,
22  const Variables<tmpl::list<PackageFieldTags...>>&
23  lower_packaged_data) noexcept {
24  ASSERT(
25  upper_packaged_data.number_of_grid_points() ==
26  lower_packaged_data.number_of_grid_points(),
27  "The number of grid points must be the same for the upper packaged data ("
28  << upper_packaged_data.number_of_grid_points()
29  << ") and the lower packaged data ("
30  << lower_packaged_data.number_of_grid_points() << ')');
31  ASSERT(upper_packaged_data.number_of_grid_points() ==
32  boundary_corrections_on_face->number_of_grid_points(),
33  "The number of grid points must be the same for the packaged data ("
34  << upper_packaged_data.number_of_grid_points()
35  << ") and the boundary corrections on the faces ("
36  << boundary_corrections_on_face->number_of_grid_points() << ')');
37  boundary_correction.dg_boundary_terms(
38  make_not_null(&get<CorrectionTags>(*boundary_corrections_on_face))...,
39  get<PackageFieldTags>(upper_packaged_data)...,
40  get<PackageFieldTags>(lower_packaged_data)...,
41  // FD schemes are basically weak form FV scheme
42  ::dg::Formulation::WeakInertial);
43 }
44 } // namespace evolution::dg::subcell
Assert.hpp
ASSERT
#define ASSERT(a, m)
Assert that an expression should be true.
Definition: Assert.hpp:49
Variables.hpp
evolution::dg::subcell
Implementation of a generic finite volume/conservative finite difference subcell limiter.
Definition: Actions.hpp:6
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
ostream
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13