Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <array> 7 : #include <boost/functional/hash.hpp> 8 : #include <cstddef> 9 : #include <utility> 10 : 11 : #include "DataStructures/FixedHashMap.hpp" 12 : #include "Domain/Structure/MaxNumberOfNeighbors.hpp" 13 : #include "Evolution/Systems/ScalarAdvection/Tags.hpp" 14 : #include "Utilities/TMPL.hpp" 15 : 16 : /// \cond 17 : class DataVector; 18 : template <size_t Dim> 19 : class Direction; 20 : template <size_t Dim> 21 : class Element; 22 : template <size_t Dim> 23 : class ElementId; 24 : template <size_t Dim> 25 : class Mesh; 26 : template <typename TagsList> 27 : class Variables; 28 : namespace gsl { 29 : template <typename> 30 : class not_null; 31 : } // namespace gsl 32 : namespace evolution::dg::subcell { 33 : class GhostData; 34 : } // namespace evolution::dg::subcell 35 : /// \endcond 36 : 37 : namespace ScalarAdvection::fd { 38 : /*! 39 : * \brief Reconstructs the scalar field \f$U\f$. All results are written into 40 : * `vars_on_lower_face` and `vars_on_upper_face`. 41 : */ 42 : template <size_t Dim, typename TagsList, typename Reconstructor> 43 1 : void reconstruct_work( 44 : gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_lower_face, 45 : gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_upper_face, 46 : const Reconstructor& reconstruct, 47 : const Variables<tmpl::list<Tags::U>> volume_vars, 48 : const Element<Dim>& element, 49 : const FixedHashMap<maximum_number_of_neighbors(Dim), 50 : std::pair<Direction<Dim>, ElementId<Dim>>, 51 : evolution::dg::subcell::GhostData, 52 : boost::hash<std::pair<Direction<Dim>, ElementId<Dim>>>>& 53 : ghost_data, 54 : const Mesh<Dim>& subcell_mesh, const size_t ghost_zone_size); 55 : 56 : /*! 57 : * \brief Reconstructs the scalar field \f$U\f$ for a given direction. All 58 : * results are written into `vars_on_face`. 59 : * 60 : * This is used on DG elements to reconstruct \f$U\f$ with their subcell 61 : * neighbors' solution (ghost data received) on the shared faces. 62 : */ 63 : template <size_t Dim, typename TagsList, typename ReconstructLower, 64 : typename ReconstructUpper> 65 1 : void reconstruct_fd_neighbor_work( 66 : gsl::not_null<Variables<TagsList>*> vars_on_face, 67 : const ReconstructLower& reconstruct_lower_neighbor, 68 : const ReconstructUpper& reconstruct_upper_neighbor, 69 : const Variables<tmpl::list<Tags::U>>& subcell_volume_vars, 70 : const Element<Dim>& element, 71 : const FixedHashMap<maximum_number_of_neighbors(Dim), 72 : std::pair<Direction<Dim>, ElementId<Dim>>, 73 : evolution::dg::subcell::GhostData, 74 : boost::hash<std::pair<Direction<Dim>, ElementId<Dim>>>>& 75 : ghost_data, 76 : const Mesh<Dim>& subcell_mesh, 77 : const Direction<Dim>& direction_to_reconstruct, 78 : const size_t ghost_zone_size); 79 : } // namespace ScalarAdvection::fd