SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/NewtonianEuler/Sources - LaneEmdenGravitationalField.hpp Hit Total Coverage
Commit: 2db722c93a8e9b106e406b439b79c8e05c2057fb Lines: 1 12 8.3 %
Date: 2021-03-03 22:01:00
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"  // IWYU pragma: keep
       9             : #include "Evolution/Systems/NewtonianEuler/TagsDeclarations.hpp"  // IWYU pragma: keep
      10             : #include "Utilities/TMPL.hpp"
      11             : 
      12             : /// \cond
      13             : class DataVector;
      14             : 
      15             : namespace NewtonianEuler {
      16             : namespace Solutions {
      17             : struct LaneEmdenStar;
      18             : }  // namespace Solutions
      19             : }  // namespace NewtonianEuler
      20             : 
      21             : namespace PUP {
      22             : class er;
      23             : }  // namespace PUP
      24             : 
      25             : namespace Tags {
      26             : template <typename SolutionType>
      27             : struct AnalyticSolution;
      28             : }  // namespace Tags
      29             : 
      30             : namespace domain {
      31             : namespace Tags {
      32             : template <size_t Dim, typename Frame>
      33             : struct Coordinates;
      34             : }  // namespace Tags
      35             : }  // namespace domain
      36             : 
      37             : namespace gsl {
      38             : template <typename T>
      39             : class not_null;
      40             : }  // namespace gsl
      41             : /// \endcond
      42             : 
      43             : // IWYU pragma: no_include "Evolution/Systems/NewtonianEuler/Tags.hpp"
      44             : 
      45             : // IWYU pragma: no_forward_declare Tensor
      46             : 
      47             : namespace NewtonianEuler {
      48             : namespace Sources {
      49             : 
      50             : /*!
      51             :  * \brief Source giving the acceleration due to gravity in the spherical,
      52             :  * Newtonian Lane-Emden star solution.
      53             :  *
      54             :  * The gravitational field \f$g^i\f$ enters the NewtonianEuler system as source
      55             :  * terms for the conserved momentum and energy:
      56             :  *
      57             :  * \f{align*}
      58             :  * \partial_t S^i + \partial_j F^{j}(S^i) &= S(S^i) = \rho g^i
      59             :  * \partial_t e + \partial_j F^{j}(e) &= S(e) = S_i g^i,
      60             :  * \f}
      61             :  *
      62             :  * where \f$S^i\f$ is the conserved momentum density, \f$e\f$ is the conserved
      63             :  * energy, \f$F^{j}(u)\f$ is the flux of the conserved quantity \f$u\f$, and
      64             :  * \f$\rho\f$ is the fluid mass density.
      65             :  *
      66             :  * \note This source is specialized to the Lane-Emden solution because it
      67             :  * queries a LaneEmdenStar analytic solution for the gravitational field that
      68             :  * generates the fluid acceleration. This source does *not* integrate the fluid
      69             :  * density to compute a self-consistent gravitational field (i.e., as if one
      70             :  * were solving a coupled Euler + Poisson system).
      71             :  */
      72           1 : struct LaneEmdenGravitationalField {
      73           0 :   LaneEmdenGravitationalField() noexcept = default;
      74           0 :   LaneEmdenGravitationalField(const LaneEmdenGravitationalField& /*rhs*/) =
      75             :       default;
      76           0 :   LaneEmdenGravitationalField& operator=(
      77             :       const LaneEmdenGravitationalField& /*rhs*/) = default;
      78           0 :   LaneEmdenGravitationalField(LaneEmdenGravitationalField&& /*rhs*/) noexcept =
      79             :       default;
      80           0 :   LaneEmdenGravitationalField& operator=(
      81             :       LaneEmdenGravitationalField&& /*rhs*/) noexcept = default;
      82           0 :   ~LaneEmdenGravitationalField() = default;
      83             : 
      84             :   // clang-tidy: google-runtime-references
      85           0 :   void pup(PUP::er& /*p*/) noexcept {}  // NOLINT
      86             : 
      87           0 :   using sourced_variables =
      88             :       tmpl::list<Tags::MomentumDensity<3>, Tags::EnergyDensity>;
      89             : 
      90           0 :   using argument_tags = tmpl::list<
      91             :       Tags::MassDensityCons, Tags::MomentumDensity<3>,
      92             :       ::Tags::AnalyticSolution<NewtonianEuler::Solutions::LaneEmdenStar>,
      93             :       domain::Tags::Coordinates<3, Frame::Inertial>>;
      94             : 
      95           0 :   static void apply(
      96             :       gsl::not_null<tnsr::I<DataVector, 3>*> source_momentum_density,
      97             :       gsl::not_null<Scalar<DataVector>*> source_energy_density,
      98             :       const Scalar<DataVector>& mass_density_cons,
      99             :       const tnsr::I<DataVector, 3>& momentum_density,
     100             :       const NewtonianEuler::Solutions::LaneEmdenStar& star,
     101             :       const tnsr::I<DataVector, 3>& x) noexcept;
     102             : };
     103             : 
     104             : }  // namespace Sources
     105             : }  // namespace NewtonianEuler

Generated by: LCOV version 1.14