SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler/FiniteDifference - MonotisedCentral.hpp Hit Total Coverage
Commit: e93d8312de4f331d36b5aa00ea83a894e26dfcb7 Lines: 2 31 6.5 %
Date: 2021-09-24 22:40:29
Legend: Lines: hit not hit

          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 <cstddef>
       8             : #include <utility>
       9             : 
      10             : #include "DataStructures/DataBox/PrefixHelpers.hpp"
      11             : #include "DataStructures/DataBox/Prefixes.hpp"
      12             : #include "DataStructures/FixedHashMap.hpp"
      13             : #include "DataStructures/Tensor/TypeAliases.hpp"
      14             : #include "DataStructures/VariablesTag.hpp"
      15             : #include "Domain/Structure/MaxNumberOfNeighbors.hpp"
      16             : #include "Domain/Tags.hpp"
      17             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      18             : #include "Evolution/DgSubcell/Tags/NeighborData.hpp"
      19             : #include "Evolution/Systems/NewtonianEuler/FiniteDifference/Reconstructor.hpp"
      20             : #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
      21             : #include "Options/Options.hpp"
      22             : #include "PointwiseFunctions/Hydro/Tags.hpp"
      23             : #include "Utilities/TMPL.hpp"
      24             : 
      25             : /// \cond
      26             : template <size_t Dim>
      27             : class Direction;
      28             : template <size_t Dim>
      29             : class Element;
      30             : template <size_t Dim>
      31             : class ElementId;
      32             : namespace EquationsOfState {
      33             : template <bool IsRelativistic, size_t ThermodynamicDim>
      34             : class EquationOfState;
      35             : }  // namespace EquationsOfState
      36             : namespace evolution::dg::subcell {
      37             : struct NeighborData;
      38             : }  // namespace evolution::dg::subcell
      39             : namespace gsl {
      40             : template <typename T>
      41             : class not_null;
      42             : }  // namespace gsl
      43             : template <size_t Dim>
      44             : class Mesh;
      45             : template <typename TagsList>
      46             : class Variables;
      47             : /// \endcond
      48             : 
      49             : namespace NewtonianEuler::fd {
      50             : /*!
      51             :  * \brief Monotised central reconstruction. See
      52             :  * `::fd::reconstruction::monotised_central()` for details.
      53             :  */
      54             : template <size_t Dim>
      55           1 : class MonotisedCentralPrim : public Reconstructor<Dim> {
      56             :  private:
      57             :   // Conservative vars tags
      58           0 :   using MassDensityCons = Tags::MassDensityCons;
      59           0 :   using EnergyDensity = Tags::EnergyDensity;
      60           0 :   using MomentumDensity = Tags::MomentumDensity<Dim>;
      61             : 
      62             :   // Primitive vars tags
      63           0 :   using MassDensity = Tags::MassDensity<DataVector>;
      64           0 :   using Velocity = Tags::Velocity<DataVector, Dim>;
      65           0 :   using SpecificInternalEnergy = Tags::SpecificInternalEnergy<DataVector>;
      66           0 :   using Pressure = Tags::Pressure<DataVector>;
      67             : 
      68           0 :   using prims_tags =
      69             :       tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>;
      70           0 :   using cons_tags = tmpl::list<MassDensityCons, MomentumDensity, EnergyDensity>;
      71           0 :   using flux_tags = db::wrap_tags_in<::Tags::Flux, cons_tags, tmpl::size_t<Dim>,
      72             :                                      Frame::Inertial>;
      73           0 :   using prim_tags_for_reconstruction =
      74             :       tmpl::list<MassDensity, Velocity, Pressure>;
      75             : 
      76             :  public:
      77           0 :   using options = tmpl::list<>;
      78           0 :   static constexpr Options::String help{
      79             :       "Monotised central reconstruction scheme using primitive variables."};
      80             : 
      81           0 :   MonotisedCentralPrim() = default;
      82           0 :   MonotisedCentralPrim(MonotisedCentralPrim&&) noexcept = default;
      83           0 :   MonotisedCentralPrim& operator=(MonotisedCentralPrim&&) noexcept = default;
      84           0 :   MonotisedCentralPrim(const MonotisedCentralPrim&) = default;
      85           0 :   MonotisedCentralPrim& operator=(const MonotisedCentralPrim&) = default;
      86           0 :   ~MonotisedCentralPrim() override = default;
      87             : 
      88           0 :   explicit MonotisedCentralPrim(CkMigrateMessage* msg) noexcept;
      89             : 
      90           0 :   WRAPPED_PUPable_decl_base_template(Reconstructor<Dim>, MonotisedCentralPrim);
      91             : 
      92           0 :   auto get_clone() const noexcept
      93             :       -> std::unique_ptr<Reconstructor<Dim>> override;
      94             : 
      95           0 :   void pup(PUP::er& p) override;
      96             : 
      97           0 :   size_t ghost_zone_size() const noexcept override { return 2; }
      98             : 
      99           0 :   using reconstruction_argument_tags =
     100             :       tmpl::list<::Tags::Variables<prims_tags>,
     101             :                  hydro::Tags::EquationOfStateBase, domain::Tags::Element<Dim>,
     102             :                  evolution::dg::subcell::Tags::
     103             :                      NeighborDataForReconstructionAndRdmpTci<Dim>,
     104             :                  evolution::dg::subcell::Tags::Mesh<Dim>>;
     105             : 
     106             :   template <size_t ThermodynamicDim, typename TagsList>
     107           0 :   void reconstruct(
     108             :       gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_lower_face,
     109             :       gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_upper_face,
     110             :       const Variables<prims_tags>& volume_prims,
     111             :       const EquationsOfState::EquationOfState<false, ThermodynamicDim>& eos,
     112             :       const Element<Dim>& element,
     113             :       const FixedHashMap<
     114             :           maximum_number_of_neighbors(Dim) + 1,
     115             :           std::pair<Direction<Dim>, ElementId<Dim>>,
     116             :           evolution::dg::subcell::NeighborData,
     117             :           boost::hash<std::pair<Direction<Dim>, ElementId<Dim>>>>&
     118             :           neighbor_data,
     119             :       const Mesh<Dim>& subcell_mesh) const noexcept;
     120             : 
     121             :   /// Called by an element doing DG when the neighbor is doing subcell.
     122             :   ///
     123             :   /// This is used to reconstruct the fluxes on the mortar that the subcell
     124             :   /// neighbor would have sent had we instead used a two a two-communication
     125             :   /// subcell solver (first communication for reconstruction, second for
     126             :   /// fluxes).
     127             :   template <size_t ThermodynamicDim, typename TagsList>
     128           1 :   void reconstruct_fd_neighbor(
     129             :       gsl::not_null<Variables<TagsList>*> vars_on_face,
     130             :       const Variables<prims_tags>& subcell_volume_prims,
     131             :       const EquationsOfState::EquationOfState<false, ThermodynamicDim>& eos,
     132             :       const Element<Dim>& element,
     133             :       const FixedHashMap<
     134             :           maximum_number_of_neighbors(Dim) + 1,
     135             :           std::pair<Direction<Dim>, ElementId<Dim>>,
     136             :           evolution::dg::subcell::NeighborData,
     137             :           boost::hash<std::pair<Direction<Dim>, ElementId<Dim>>>>&
     138             :           neighbor_data,
     139             :       const Mesh<Dim>& subcell_mesh,
     140             :       const Direction<Dim> direction_to_reconstruct) const noexcept;
     141             : };
     142             : 
     143             : template <size_t Dim>
     144           0 : bool operator==(const MonotisedCentralPrim<Dim>& /*lhs*/,
     145             :                 const MonotisedCentralPrim<Dim>& /*rhs*/) noexcept {
     146             :   return true;
     147             : }
     148             : 
     149             : template <size_t Dim>
     150           0 : bool operator!=(const MonotisedCentralPrim<Dim>& lhs,
     151             :                 const MonotisedCentralPrim<Dim>& rhs) noexcept {
     152             :   return not(lhs == rhs);
     153             : }
     154             : }  // namespace NewtonianEuler::fd

Generated by: LCOV version 1.14