SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler/Subcell - ResizeAndComputePrimitives.hpp Hit Total Coverage
Commit: b5ffa4904430ccef0b226f73dcd25c74cb5188f6 Lines: 1 9 11.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/ActiveGrid.hpp"
      12             : #include "Evolution/DgSubcell/Tags/ActiveGrid.hpp"
      13             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      14             : #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
      15             : #include "PointwiseFunctions/Hydro/Tags.hpp"
      16             : #include "Utilities/TMPL.hpp"
      17             : 
      18             : /// \cond
      19             : class DataVector;
      20             : namespace EquationsOfState {
      21             : template <bool IsRelativistic, size_t ThermodynamicDim>
      22             : class EquationOfState;
      23             : }  // namespace EquationsOfState
      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 Mutator that resizes the primitive variables to have the size of the
      37             :  * active mesh and then computes the primitive variables on the active mesh.
      38             :  *
      39             :  * In the DG-subcell `step_actions` list this will normally be called using the
      40             :  * `::Actions::MutateApply` action right after the
      41             :  * `evolution::dg::subcell::Actions::TciAndSwitchToDg` action. We only need to
      42             :  * compute the primitives if we switched to the DG grid because otherwise we
      43             :  * computed the primitives during the FD TCI. After the primitive variables tag
      44             :  * is resized for the DG grid, the primitives are computed directly on the DG
      45             :  * grid from the reconstructed conserved variables, not via a reconstruction
      46             :  * operation applied to the primitives.
      47             :  */
      48             : template <size_t Dim>
      49           1 : struct ResizeAndComputePrims {
      50             :  private:
      51           0 :   using MassDensity = NewtonianEuler::Tags::MassDensity<DataVector>;
      52           0 :   using Velocity = NewtonianEuler::Tags::Velocity<DataVector, Dim>;
      53           0 :   using SpecificInternalEnergy =
      54             :       NewtonianEuler::Tags::SpecificInternalEnergy<DataVector>;
      55           0 :   using Pressure = NewtonianEuler::Tags::Pressure<DataVector>;
      56             : 
      57             :  public:
      58           0 :   using return_tags = tmpl::list<::Tags::Variables<
      59             :       tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>>;
      60           0 :   using argument_tags =
      61             :       tmpl::list<evolution::dg::subcell::Tags::ActiveGrid,
      62             :                  domain::Tags::Mesh<Dim>,
      63             :                  evolution::dg::subcell::Tags::Mesh<Dim>, Tags::MassDensityCons,
      64             :                  Tags::MomentumDensity<Dim>, Tags::EnergyDensity,
      65             :                  hydro::Tags::EquationOfStateBase>;
      66             : 
      67             :   template <size_t ThermodynamicDim>
      68           0 :   static void apply(
      69             :       gsl::not_null<Variables<
      70             :           tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>>*>
      71             :           prim_vars,
      72             :       evolution::dg::subcell::ActiveGrid active_grid, const Mesh<Dim>& dg_mesh,
      73             :       const Mesh<Dim>& subcell_mesh,
      74             :       const Scalar<DataVector>& mass_density_cons,
      75             :       const tnsr::I<DataVector, Dim>& momentum_density,
      76             :       const Scalar<DataVector>& energy_density,
      77             :       const EquationsOfState::EquationOfState<false, ThermodynamicDim>&
      78             :           equation_of_state) noexcept;
      79             : };
      80             : }  // namespace NewtonianEuler::subcell

Generated by: LCOV version 1.14