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

Generated by: LCOV version 1.14