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 <optional> 8 : #include <tuple> 9 : #include <utility> 10 : 11 : #include "DataStructures/DataBox/Access.hpp" 12 : #include "DataStructures/DataVector.hpp" 13 : #include "Domain/Structure/DirectionalIdMap.hpp" 14 : #include "NumericalAlgorithms/Spectral/Mesh.hpp" 15 : #include "Time/TimeStepId.hpp" 16 : #include "Utilities/Gsl.hpp" 17 : 18 : namespace evolution::dg::subcell { 19 : /*! 20 : * \brief Invoked in directions where the neighbor is doing subcell, this 21 : * function computes the neighbor data on the mortar via reconstruction on 22 : * nearest neighbor subcells. 23 : * 24 : * 25 : * The data needed for reconstruction is copied over into 26 : * `subcell::Tags::GhostDataForReconstruction`. 27 : * Additionally, the max/min of the evolved variables from neighboring elements 28 : * that is used for the relaxed discrete maximum principle troubled-cell 29 : * indicator is combined with the data from the local element and stored in 30 : * `subcell::Tags::DataForRdmpTci`. We handle the RDMP 31 : * data now because it is sent in the same buffer as the data for 32 : * reconstruction. 33 : * 34 : * A list of all the directions that are doing subcell is created and then 35 : * passed to the mutator 36 : * `Metavariables::SubcellOptions::DgComputeSubcellNeighborPackagedData::apply`, 37 : * which must return a 38 : * 39 : * \code 40 : * DirectionalIdMap<volume_dim, DataVector> 41 : * \endcode 42 : * 43 : * which holds the reconstructed `dg_packaged_data` on the face (stored in the 44 : * `DataVector`) for the boundary correction. A 45 : * `std::vector<DirectionalId<volume_dim>>` 46 : * holding the list of mortars that need to be reconstructed to is passed in as 47 : * the last argument to 48 : * `Metavariables::SubcellOptions::DgComputeSubcellNeighborPackagedData::apply`. 49 : */ 50 : template <size_t VolumeDim, typename DgComputeSubcellNeighborPackagedData> 51 1 : void neighbor_reconstructed_face_solution( 52 : gsl::not_null<db::Access*> box, 53 : gsl::not_null<std::pair< 54 : const TimeStepId, 55 : DirectionalIdMap< 56 : VolumeDim, 57 : std::tuple<Mesh<VolumeDim>, Mesh<VolumeDim - 1>, 58 : std::optional<DataVector>, std::optional<DataVector>, 59 : ::TimeStepId, int>>>*> 60 : received_temporal_id_and_data); 61 : } // namespace evolution::dg::subcell