SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler/Subcell - PrimitiveGhostData.hpp Hit Total Coverage
Commit: 3f09028930c0450a2fb61ee918b22882f5d03d2b Lines: 2 21 9.5 %
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/VariablesTag.hpp"
       9             : #include "Domain/Tags.hpp"
      10             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      11             : #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
      12             : #include "Utilities/TMPL.hpp"
      13             : 
      14             : /// \cond
      15             : template <size_t Dim>
      16             : class Mesh;
      17             : template <typename TagsList>
      18             : class Variables;
      19             : /// \endcond
      20             : 
      21             : namespace NewtonianEuler::subcell {
      22             : /*!
      23             :  * \brief Computes the mass density, velocity, and pressure on the subcells so
      24             :  * they can be sent to the neighbors for their reconstructions.
      25             :  *
      26             :  * The computation just copies the data from the primitive variables tag to a
      27             :  * new Variables (the copy is subcell grid to subcell grid). In the future we
      28             :  * will likely want to elide this copy but that requires support from the
      29             :  * actions.
      30             :  *
      31             :  * This mutator is passed to
      32             :  * `evolution::dg::subcell::Actions::SendDataForReconstruction`.
      33             :  */
      34             : template <size_t Dim>
      35           1 : class PrimitiveGhostDataOnSubcells {
      36             :  private:
      37           0 :   using MassDensity = NewtonianEuler::Tags::MassDensity<DataVector>;
      38           0 :   using Velocity = NewtonianEuler::Tags::Velocity<DataVector, Dim>;
      39           0 :   using SpecificInternalEnergy =
      40             :       NewtonianEuler::Tags::SpecificInternalEnergy<DataVector>;
      41           0 :   using Pressure = NewtonianEuler::Tags::Pressure<DataVector>;
      42             : 
      43           0 :   using prim_tags =
      44             :       tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>;
      45           0 :   using prims_to_reconstruct_tags = tmpl::list<MassDensity, Velocity, Pressure>;
      46             : 
      47             :  public:
      48           0 :   using return_tags = tmpl::list<>;
      49           0 :   using argument_tags = tmpl::list<::Tags::Variables<prim_tags>>;
      50             : 
      51           0 :   static Variables<prims_to_reconstruct_tags> apply(
      52             :       const Variables<prim_tags>& prims);
      53             : };
      54             : 
      55             : /*!
      56             :  * \brief Projects the mass density, velocity, and pressure to the subcells so
      57             :  * they can be sent to the neighbors for their reconstructions.
      58             :  *
      59             :  * Computes the data on the subcells that other generic code will slice before
      60             :  * sending it to the neighbors. That is, a `ghost_zone_size * y_points *
      61             :  * z_points` is sent to the `x`-direction neighbors.
      62             :  *
      63             :  * The computation just copies the data from the primitive variables tag to a
      64             :  * new Variables, then projects that Variables to the subcells. In the future
      65             :  * we will likely want to elide this copy but that requires support from the
      66             :  * actions.
      67             :  *
      68             :  * This mutator is what `Metavars::SubcellOptions::GhostDataToSlice` must be set
      69             :  * to.
      70             :  *
      71             :  * \note This projects the primitive variables rather than computing them on the
      72             :  * subcells. This introduces truncation level errors, but from tests so far this
      73             :  * seems to be fine and is what is done with local time stepping ADER-DG.
      74             :  */
      75             : template <size_t Dim>
      76           1 : class PrimitiveGhostDataToSlice {
      77             :  private:
      78           0 :   using MassDensity = NewtonianEuler::Tags::MassDensity<DataVector>;
      79           0 :   using Velocity = NewtonianEuler::Tags::Velocity<DataVector, Dim>;
      80           0 :   using SpecificInternalEnergy =
      81             :       NewtonianEuler::Tags::SpecificInternalEnergy<DataVector>;
      82           0 :   using Pressure = NewtonianEuler::Tags::Pressure<DataVector>;
      83             : 
      84           0 :   using prim_tags =
      85             :       tmpl::list<MassDensity, Velocity, SpecificInternalEnergy, Pressure>;
      86           0 :   using prims_to_reconstruct_tags = tmpl::list<MassDensity, Velocity, Pressure>;
      87             : 
      88             :  public:
      89           0 :   using return_tags = tmpl::list<>;
      90           0 :   using argument_tags =
      91             :       tmpl::list<::Tags::Variables<prim_tags>, domain::Tags::Mesh<Dim>,
      92             :                  evolution::dg::subcell::Tags::Mesh<Dim>>;
      93             : 
      94           0 :   static Variables<prims_to_reconstruct_tags> apply(
      95             :       const Variables<prim_tags>& prims, const Mesh<Dim>& dg_mesh,
      96             :       const Mesh<Dim>& subcell_mesh);
      97             : };
      98             : }  // namespace NewtonianEuler::subcell

Generated by: LCOV version 1.14