SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/GrMhd/ValenciaDivClean/Subcell - ResizeAndComputePrimitives.hpp Hit Total Coverage
Commit: 3f09028930c0450a2fb61ee918b22882f5d03d2b Lines: 1 5 20.0 %
Date: 2021-10-22 20:52:16
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/ActiveGrid.hpp"
      12             : #include "Evolution/DgSubcell/Tags/ActiveGrid.hpp"
      13             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      14             : #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp"
      15             : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
      16             : #include "PointwiseFunctions/Hydro/Tags.hpp"
      17             : #include "Utilities/TMPL.hpp"
      18             : 
      19             : /// \cond
      20             : class DataVector;
      21             : namespace EquationsOfState {
      22             : template <bool IsRelativistic, size_t ThermodynamicDim>
      23             : class EquationOfState;
      24             : }  // namespace EquationsOfState
      25             : template <size_t Dim>
      26             : class Mesh;
      27             : namespace gsl {
      28             : template <typename T>
      29             : class not_null;
      30             : }  // namespace gsl
      31             : template <typename TagsList>
      32             : class Variables;
      33             : /// \endcond
      34             : 
      35             : namespace grmhd::ValenciaDivClean::subcell {
      36             : /*!
      37             :  * \brief Mutator that, if the active mesh is subcell, resizes the primitive
      38             :  * variables to have the size of the subcell and then computes the primitive
      39             :  * variables.
      40             :  *
      41             :  * In the DG-subcell `step_actions` list this will normally be called using the
      42             :  * `::Actions::MutateApply` action in the following way in the action list:
      43             :  * - `TciAndSwitchToDg<TciOnFdGrid>`
      44             :  * - `Actions::MutateApply<grmhd::ValenciaDivClean::subcell::SwapGrTags>`
      45             :  * - `Actions::MutateApply<ResizeAndComputePrims<primitive_recovery_schemes>>`
      46             :  * Note that the GR tags are swapped before this action is called.
      47             :  *
      48             :  * If the active grid is DG (we are switching from subcell back to DG) then this
      49             :  * mutator computes the primitive variables on the active grid. We reconstruct
      50             :  * the pressure to the DG grid to give a high-order initial guess for the
      51             :  * primitive recovery. A possible future optimization would be to avoid this
      52             :  * reconstruction when all recovery schemes don't need an initial guess.
      53             :  * Finally, we perform the primitive recovery on the DG grid.
      54             :  */
      55             : template <typename OrderedListOfRecoverySchemes>
      56           1 : struct ResizeAndComputePrims {
      57           0 :   using return_tags =
      58             :       tmpl::list<::Tags::Variables<hydro::grmhd_tags<DataVector>>>;
      59           0 :   using argument_tags =
      60             :       tmpl::list<evolution::dg::subcell::Tags::ActiveGrid,
      61             :                  domain::Tags::Mesh<3>, evolution::dg::subcell::Tags::Mesh<3>,
      62             :                  grmhd::ValenciaDivClean::Tags::TildeD,
      63             :                  grmhd::ValenciaDivClean::Tags::TildeTau,
      64             :                  grmhd::ValenciaDivClean::Tags::TildeS<>,
      65             :                  grmhd::ValenciaDivClean::Tags::TildeB<>,
      66             :                  grmhd::ValenciaDivClean::Tags::TildePhi,
      67             :                  gr::Tags::SpatialMetric<3>, gr::Tags::InverseSpatialMetric<3>,
      68             :                  gr::Tags::SqrtDetSpatialMetric<>,
      69             :                  hydro::Tags::EquationOfStateBase>;
      70             : 
      71             :   template <size_t ThermodynamicDim>
      72           0 :   static void apply(
      73             :       gsl::not_null<Variables<hydro::grmhd_tags<DataVector>>*> prim_vars,
      74             :       evolution::dg::subcell::ActiveGrid active_grid, const Mesh<3>& dg_mesh,
      75             :       const Mesh<3>& subcell_mesh, const Scalar<DataVector>& tilde_d,
      76             :       const Scalar<DataVector>& tilde_tau,
      77             :       const tnsr::i<DataVector, 3, Frame::Inertial>& tilde_s,
      78             :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
      79             :       const Scalar<DataVector>& tilde_phi,
      80             :       const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric,
      81             :       const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric,
      82             :       const Scalar<DataVector>& sqrt_det_spatial_metric,
      83             :       const EquationsOfState::EquationOfState<true, ThermodynamicDim>& eos);
      84             : };
      85             : }  // namespace grmhd::ValenciaDivClean::subcell

Generated by: LCOV version 1.14