SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler/Subcell - TciOnDgGrid.hpp Hit Total Coverage
Commit: 3528f39684ab2ee5d689cee48331779e729b0a07 Lines: 1 14 7.1 %
Date: 2024-02-27 07:22:14
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 <cstddef>
       7             : #include <tuple>
       8             : 
       9             : #include "DataStructures/Tensor/TypeAliases.hpp"
      10             : #include "DataStructures/VariablesTag.hpp"
      11             : #include "Domain/Tags.hpp"
      12             : #include "Evolution/DgSubcell/RdmpTciData.hpp"
      13             : #include "Evolution/DgSubcell/Tags/DataForRdmpTci.hpp"
      14             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      15             : #include "Evolution/DgSubcell/Tags/SubcellOptions.hpp"
      16             : #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
      17             : #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp"
      18             : #include "PointwiseFunctions/Hydro/Tags.hpp"
      19             : #include "Utilities/TMPL.hpp"
      20             : 
      21             : /// \cond
      22             : class DataVector;
      23             : namespace EquationsOfState {
      24             : template <bool IsRelativistic, size_t ThermodynamicDim>
      25             : class EquationOfState;
      26             : }  // namespace EquationsOfState
      27             : template <size_t Dim>
      28             : class Mesh;
      29             : namespace gsl {
      30             : template <typename T>
      31             : class not_null;
      32             : }  // namespace gsl
      33             : template <typename T>
      34             : class Variables;
      35             : /// \endcond
      36             : 
      37             : namespace NewtonianEuler::subcell {
      38             : /*!
      39             :  * \brief Troubled-cell indicator applied to the DG solution.
      40             :  *
      41             :  * Computes the primitive variables on the DG grid, mutating them in the
      42             :  * DataBox. Then,
      43             :  * - apply RDMP TCI to the mass and energy density
      44             :  * - if the minimum density or pressure are below \f$10^{-18}\f$ (the arbitrary
      45             :  *   threshold used to signal "negative" density and pressure), marks the
      46             :  *   element as troubled and returns
      47             :  * - runs the Persson TCI on the mass and energy density. The reason for
      48             :  *   applying the Persson TCI to both the mass and energy density is to flag
      49             :  *   cells at contact discontinuities.
      50             :  */
      51             : template <size_t Dim>
      52           1 : class TciOnDgGrid {
      53             :  private:
      54           0 :   using MassDensityCons = NewtonianEuler::Tags::MassDensityCons;
      55           0 :   using EnergyDensity = NewtonianEuler::Tags::EnergyDensity;
      56           0 :   using MomentumDensity = NewtonianEuler::Tags::MomentumDensity<Dim>;
      57             : 
      58           0 :   using MassDensity = NewtonianEuler::Tags::MassDensity<DataVector>;
      59           0 :   using Velocity = NewtonianEuler::Tags::Velocity<DataVector, Dim>;
      60           0 :   using SpecificInternalEnergy =
      61             :       NewtonianEuler::Tags::SpecificInternalEnergy<DataVector>;
      62           0 :   using Pressure = NewtonianEuler::Tags::Pressure<DataVector>;
      63             : 
      64           0 :   static constexpr double min_density_allowed = 1.0e-18;
      65           0 :   static constexpr double min_pressure_allowed = 1.0e-18;
      66             : 
      67             :  public:
      68           0 :   using return_tags = tmpl::list<::Tags::Variables<
      69             :       tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>>;
      70           0 :   using argument_tags =
      71             :       tmpl::list<::Tags::Variables<tmpl::list<MassDensityCons, MomentumDensity,
      72             :                                               EnergyDensity>>,
      73             :                  hydro::Tags::EquationOfStateBase, domain::Tags::Mesh<Dim>,
      74             :                  evolution::dg::subcell::Tags::Mesh<Dim>,
      75             :                  evolution::dg::subcell::Tags::DataForRdmpTci,
      76             :                  evolution::dg::subcell::Tags::SubcellOptions<Dim>>;
      77             : 
      78             :   template <size_t ThermodynamicDim>
      79           0 :   static std::tuple<bool, evolution::dg::subcell::RdmpTciData> apply(
      80             :       gsl::not_null<Variables<
      81             :           tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>*>
      82             :           dg_prim_vars,
      83             :       const Variables<
      84             :           tmpl::list<MassDensityCons, MomentumDensity, EnergyDensity>>& dg_vars,
      85             :       const EquationsOfState::EquationOfState<false, ThermodynamicDim>& eos,
      86             :       const Mesh<Dim>& dg_mesh, const Mesh<Dim>& subcell_mesh,
      87             :       const evolution::dg::subcell::RdmpTciData& past_rdmp_tci_data,
      88             :       const evolution::dg::subcell::SubcellOptions& subcell_options,
      89             :       double persson_exponent, bool element_stays_on_dg);
      90             : };
      91             : }  // namespace NewtonianEuler::subcell

Generated by: LCOV version 1.14