SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/GrMhd/ValenciaDivClean/Subcell - TciOnDgGrid.hpp Hit Total Coverage
Commit: b5ffa4904430ccef0b226f73dcd25c74cb5188f6 Lines: 1 5 20.0 %
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/Systems/GrMhd/ValenciaDivClean/Subcell/TciOptions.hpp"
      12             : #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp"
      13             : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.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 TagsList>
      30             : class Variables;
      31             : /// \endcond
      32             : 
      33             : namespace grmhd::ValenciaDivClean::subcell {
      34             : /*!
      35             :  * \brief The troubled-cell indicator run on the DG grid to check if the
      36             :  * solution is admissible.
      37             :  *
      38             :  * We denote variables at the candidate solution's time level by a superscript
      39             :  * \f$n+1\f$ and at the time level where the solution is known to be admissible
      40             :  * by a superscript \f$n\f$.
      41             :  *
      42             :  * The following checks are done in the order they are listed:
      43             :  *
      44             :  * - if \f$\min(\tilde{D}^{n+1}/\sqrt{\gamma^{n}})\f$ is less than
      45             :  *   `tci_options.minimum_rest_mass_density_times_lorentz_factor` then we have a
      46             :  *   negative (or extremely small) density and the cell is troubled. Note that
      47             :  *   if this `tci_option` is approximately equal to or larger than the
      48             :  *   `atmosphere_density`, the atmosphere will be flagged as troubled.
      49             :  * - if \f$\max(\tilde{D}^{n+1}/(\sqrt{\gamma^n}W^n))\f$ and \f$\max(\rho^n)\f$
      50             :  *   are less than `tci_options.atmosphere_density` then the entire DG element
      51             :  *   is in atmosphere and it is _not_ troubled.
      52             :  * - if
      53             :  *   \f$(\tilde{B}^{n+1})^2>2\sqrt{\gamma^n}(1-\epsilon_B)\tilde{\tau}^{n+1}\f$
      54             :  *   at any grid point, then the cell is troubled
      55             :  * - attempt a primitive recovery using the `RecoveryScheme` from the template
      56             :  *   parameter. The cell is marked as troubled if the primitive recovery fails
      57             :  *   at any grid point.
      58             :  * - if \f$\max(\rho^{n+1})\f$ is below `tci_options.atmosphere_density` then
      59             :  *   the cell is in atmosphere and not marked as troubled. Note that the
      60             :  *   magnetic field is still freely evolved.
      61             :  * - apply the Persson TCI to \f$\tilde{D}^{n+1}\f$ and \f$\tilde{\tau}^{n+1}\f$
      62             :  *
      63             :  * If the cell is not flagged as troubled then the primitives are computed at
      64             :  * time level `n+1`.
      65             :  */
      66             : template <typename RecoveryScheme>
      67           1 : class TciOnDgGrid {
      68             :  public:
      69           0 :   using return_tags =
      70             :       tmpl::list<::Tags::Variables<hydro::grmhd_tags<DataVector>>>;
      71           0 :   using argument_tags =
      72             :       tmpl::list<grmhd::ValenciaDivClean::Tags::TildeD,
      73             :                  grmhd::ValenciaDivClean::Tags::TildeTau,
      74             :                  grmhd::ValenciaDivClean::Tags::TildeS<>,
      75             :                  grmhd::ValenciaDivClean::Tags::TildeB<>,
      76             :                  grmhd::ValenciaDivClean::Tags::TildePhi,
      77             :                  gr::Tags::SpatialMetric<3>, gr::Tags::InverseSpatialMetric<3>,
      78             :                  gr::Tags::SqrtDetSpatialMetric<>,
      79             :                  hydro::Tags::EquationOfStateBase, domain::Tags::Mesh<3>,
      80             :                  Tags::TciOptions>;
      81             : 
      82             :   template <size_t ThermodynamicDim>
      83           0 :   static bool apply(
      84             :       gsl::not_null<Variables<hydro::grmhd_tags<DataVector>>*> dg_prim_vars,
      85             :       const Scalar<DataVector>& tilde_d, const Scalar<DataVector>& tilde_tau,
      86             :       const tnsr::i<DataVector, 3, Frame::Inertial>& tilde_s,
      87             :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
      88             :       const Scalar<DataVector>& tilde_phi,
      89             :       const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric,
      90             :       const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric,
      91             :       const Scalar<DataVector>& sqrt_det_spatial_metric,
      92             :       const EquationsOfState::EquationOfState<true, ThermodynamicDim>& eos,
      93             :       const Mesh<3>& dg_mesh, const TciOptions& tci_options,
      94             :       double persson_exponent) noexcept;
      95             : };
      96             : }  // namespace grmhd::ValenciaDivClean::subcell

Generated by: LCOV version 1.14