Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <ostream> 7 : 8 : #include "DataStructures/DataBox/Access.hpp" 9 : #include "DataStructures/Variables.hpp" 10 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Formulation.hpp" 11 : #include "Utilities/ErrorHandling/Assert.hpp" 12 : #include "Utilities/Gsl.hpp" 13 : #include "Utilities/TMPL.hpp" 14 : 15 : namespace evolution::dg::subcell { 16 : template <typename... CorrectionTags, typename BoundaryCorrection, 17 : typename... PackageFieldTags, typename... BoundaryTermsVolumeTags> 18 0 : void compute_boundary_terms( 19 : const gsl::not_null<Variables<tmpl::list<CorrectionTags...>>*> 20 : boundary_corrections_on_face, 21 : const BoundaryCorrection& boundary_correction, 22 : const Variables<tmpl::list<PackageFieldTags...>>& upper_packaged_data, 23 : const Variables<tmpl::list<PackageFieldTags...>>& lower_packaged_data, 24 : const db::Access& box, tmpl::list<BoundaryTermsVolumeTags...> /*meta*/) { 25 : ASSERT( 26 : upper_packaged_data.number_of_grid_points() == 27 : lower_packaged_data.number_of_grid_points(), 28 : "The number of grid points must be the same for the upper packaged data (" 29 : << upper_packaged_data.number_of_grid_points() 30 : << ") and the lower packaged data (" 31 : << lower_packaged_data.number_of_grid_points() << ')'); 32 : ASSERT(upper_packaged_data.number_of_grid_points() == 33 : boundary_corrections_on_face->number_of_grid_points(), 34 : "The number of grid points must be the same for the packaged data (" 35 : << upper_packaged_data.number_of_grid_points() 36 : << ") and the boundary corrections on the faces (" 37 : << boundary_corrections_on_face->number_of_grid_points() << ')'); 38 : boundary_correction.dg_boundary_terms( 39 : make_not_null(&get<CorrectionTags>(*boundary_corrections_on_face))..., 40 : get<PackageFieldTags>(upper_packaged_data)..., 41 : get<PackageFieldTags>(lower_packaged_data)..., 42 : // FD schemes are basically weak form FV scheme 43 : ::dg::Formulation::WeakInertial, 44 : db::get<BoundaryTermsVolumeTags>(box)...); 45 : } 46 : } // namespace evolution::dg::subcell