SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler/Subcell - TciOnFdGrid.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/Inactive.hpp"
      15             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      16             : #include "Evolution/DgSubcell/Tags/SubcellOptions.hpp"
      17             : #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
      18             : #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp"
      19             : #include "PointwiseFunctions/Hydro/Tags.hpp"
      20             : #include "Utilities/TMPL.hpp"
      21             : 
      22             : /// \cond
      23             : class DataVector;
      24             : template <size_t Dim>
      25             : class Mesh;
      26             : namespace gsl {
      27             : template <typename T>
      28             : class not_null;
      29             : }  // namespace gsl
      30             : template <typename TagsList>
      31             : class Variables;
      32             : /// \endcond
      33             : 
      34             : namespace NewtonianEuler::subcell {
      35             : /*!
      36             :  * \brief Troubled-cell indicator applied to the finite difference subcell
      37             :  * solution to check if the corresponding DG solution is admissible.
      38             :  *
      39             :  * Computes the primitive variables on the DG and subcell grids, mutating the
      40             :  * subcell/active primitive variables in the DataBox. Then,
      41             :  * - apply RDMP TCI to the mass and energy density
      42             :  * - if the minimum density or pressure on either the DG or subcell mesh are
      43             :  *   below \f$10^{-18}\f$, marks the element as troubled and returns. We check
      44             :  *   both the FD and DG grids since when a discontinuity is inside the element
      45             :  *   oscillations in the DG solution can result in negative values that aren't
      46             :  *   present in the FD solution.
      47             :  * - runs the Persson TCI on the mass and energy density on the DG grid. The
      48             :  *   reason for applying the Persson TCI to both the mass and energy density is
      49             :  *   to flag cells at contact discontinuities. The Persson TCI only works with
      50             :  *   spectral-type methods and is a direct check of whether or not the DG
      51             :  *   solution is a good representation of the underlying data.
      52             :  *
      53             :  * Please note that the TCI is run after the subcell solution has been
      54             :  * reconstructed to the DG grid, and so `Inactive<Tag>` is the updated DG
      55             :  * solution.
      56             :  */
      57             : template <size_t Dim>
      58           1 : class TciOnFdGrid {
      59             :  private:
      60           0 :   using MassDensityCons = NewtonianEuler::Tags::MassDensityCons;
      61           0 :   using EnergyDensity = NewtonianEuler::Tags::EnergyDensity;
      62           0 :   using MomentumDensity = NewtonianEuler::Tags::MomentumDensity<Dim>;
      63             : 
      64           0 :   using MassDensity = NewtonianEuler::Tags::MassDensity<DataVector>;
      65           0 :   using Velocity = NewtonianEuler::Tags::Velocity<DataVector, Dim>;
      66           0 :   using SpecificInternalEnergy =
      67             :       NewtonianEuler::Tags::SpecificInternalEnergy<DataVector>;
      68           0 :   using Pressure = NewtonianEuler::Tags::Pressure<DataVector>;
      69             : 
      70           0 :   static constexpr double min_density_allowed = 1.0e-18;
      71           0 :   static constexpr double min_pressure_allowed = 1.0e-18;
      72             : 
      73             :  public:
      74           0 :   using return_tags = tmpl::list<::Tags::Variables<
      75             :       tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>>;
      76           0 :   using argument_tags =
      77             :       tmpl::list<::Tags::Variables<tmpl::list<MassDensityCons, MomentumDensity,
      78             :                                               EnergyDensity>>,
      79             :                  hydro::Tags::EquationOfStateBase, domain::Tags::Mesh<Dim>,
      80             :                  evolution::dg::subcell::Tags::Mesh<Dim>,
      81             :                  evolution::dg::subcell::Tags::DataForRdmpTci,
      82             :                  evolution::dg::subcell::Tags::SubcellOptions<Dim>>;
      83             : 
      84             :   template <size_t ThermodynamicDim>
      85           0 :   static std::tuple<bool, evolution::dg::subcell::RdmpTciData> apply(
      86             :       gsl::not_null<Variables<
      87             :           tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>*>
      88             :           subcell_grid_prim_vars,
      89             :       const Variables<tmpl::list<MassDensityCons, MomentumDensity,
      90             :                                  EnergyDensity>>& subcell_vars,
      91             :       const EquationsOfState::EquationOfState<false, ThermodynamicDim>& eos,
      92             :       const Mesh<Dim>& dg_mesh, const Mesh<Dim>& subcell_mesh,
      93             :       const evolution::dg::subcell::RdmpTciData& past_rdmp_tci_data,
      94             :       const evolution::dg::subcell::SubcellOptions& subcell_options,
      95             :       double persson_exponentconst, bool need_rdmp_data_only);
      96             : };
      97             : }  // namespace NewtonianEuler::subcell

Generated by: LCOV version 1.14