Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <utility> 8 : 9 : #include "DataStructures/DataVector.hpp" 10 : #include "Domain/Structure/Direction.hpp" 11 : #include "Domain/Structure/DirectionalId.hpp" 12 : #include "Domain/Structure/DirectionalIdMap.hpp" 13 : #include "Domain/Structure/ElementId.hpp" 14 : #include "Evolution/DgSubcell/GhostData.hpp" 15 : #include "Evolution/DgSubcell/RdmpTciData.hpp" 16 : #include "NumericalAlgorithms/Interpolation/IrregularInterpolant.hpp" 17 : #include "Utilities/Gsl.hpp" 18 : 19 : /// \cond 20 : template <size_t Dim> 21 : class Element; 22 : template <size_t Dim> 23 : class Mesh; 24 : /// \endcond 25 : 26 : namespace evolution::dg::subcell { 27 : /*! 28 : * \brief Check whether `neighbor_subcell_data` is FD or DG, and either insert 29 : * or copy into `ghost_data_ptr` the FD data (projecting if 30 : * `neighbor_subcell_data` is DG data). 31 : * 32 : * This is intended to be used during a rollback from DG to make sure neighbor 33 : * data is projected to the FD grid. 34 : */ 35 : template <bool InsertIntoMap, size_t Dim> 36 1 : void insert_or_update_neighbor_volume_data( 37 : gsl::not_null<DirectionalIdMap<Dim, GhostData>*> ghost_data_ptr, 38 : const DataVector& neighbor_subcell_data, 39 : const size_t number_of_rdmp_vars_in_buffer, 40 : const DirectionalId<Dim>& directional_element_id, 41 : const Mesh<Dim>& neighbor_mesh, const Element<Dim>& element, 42 : const Mesh<Dim>& subcell_mesh, size_t number_of_ghost_zones, 43 : const DirectionalIdMap<Dim, std::optional<intrp::Irregular<Dim>>>& 44 : Neighbor_dg_to_fd_interpolants); 45 : 46 : /*! 47 : * \brief Check whether the neighbor sent is DG volume or FD ghost data, and 48 : * orient project DG volume data if necessary. 49 : * 50 : * This is intended to be used by the `ReceiveDataForReconstruction` action. 51 : */ 52 : template <size_t Dim> 53 1 : void insert_neighbor_rdmp_and_volume_data( 54 : gsl::not_null<RdmpTciData*> rdmp_tci_data_ptr, 55 : gsl::not_null<DirectionalIdMap<Dim, GhostData>*> ghost_data_ptr, 56 : const DataVector& received_neighbor_subcell_data, 57 : size_t number_of_rdmp_vars, 58 : const DirectionalId<Dim>& directional_element_id, 59 : const Mesh<Dim>& neighbor_mesh, const Element<Dim>& element, 60 : const Mesh<Dim>& subcell_mesh, size_t number_of_ghost_zones, 61 : const DirectionalIdMap<Dim, std::optional<intrp::Irregular<Dim>>>& 62 : neighbor_dg_to_fd_interpolants); 63 : } // namespace evolution::dg::subcell