SpECTRE Documentation Coverage Report
Current view: top level - Elliptic/Systems/BnsInitialData - FirstOrderSystem.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 8.3 % 12 1
Test Date: 2026-10-22 17:29:42
Legend: Lines:     hit not hit

            Line data    Source code
       1            0 : 
       2              : // Distributed under the MIT License.
       3              : // See LICENSE.txt for details.
       4              : 
       5              : #pragma once
       6              : 
       7              : #include <cstddef>
       8              : 
       9              : #include "DataStructures/DataBox/PrefixHelpers.hpp"
      10              : #include "DataStructures/DataBox/Prefixes.hpp"
      11              : #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp"
      12              : #include "Elliptic/Protocols/FirstOrderSystem.hpp"
      13              : #include "Elliptic/Systems/BnsInitialData/Equations.hpp"
      14              : #include "Elliptic/Systems/BnsInitialData/Tags.hpp"
      15              : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      16              : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
      17              : #include "Utilities/ProtocolHelpers.hpp"
      18              : #include "Utilities/TMPL.hpp"
      19              : 
      20              : namespace BnsInitialData {
      21              : 
      22              : /*!
      23              :  * \brief The Irrotational Bns equations From Baumgarte and Shapiro Chapter 15
      24              :  *  formulated as a set of coupled first-order PDEs.
      25              :  *
      26              :  * \details This system formulates the Irrotational Bns Hydrostatic Equilibrium
      27              :  * equations for the velocity potential \f$\Phi\f$. For a background matter
      28              :  * distribution (given by the specific enthalpy h) and a background metric
      29              :  * \f$\gamma_{ij}\f$. The velocity potential is defined by \f$D_i \Phi = h
      30              :  * u_i\f$ with \f$u_i\f$ (the spatial part of) the four velocity and where
      31              :  * \f$\Gamma^i_{jk}=\frac{1}{2}\gamma^{il}\left(\partial_j\gamma_{kl}
      32              :  * +\partial_k\gamma_{jl}-\partial_l\gamma_{jk}\right)\f$ are the Christoffel
      33              :  * symbols of the second kind of the background (spatial) metric
      34              :  * \f$\gamma_{ij}\f$. The
      35              :  * background metric \f$\gamma_{ij}\f$ and the Christoffel symbols derived from
      36              :  * it are assumed to be independent of the variables \f$\Phi\f$ and \f$u_i\f$,
      37              :  * i.e.
      38              :  * constant throughout an iterative elliptic solve.  Additionally a background
      39              :  * lapse (\f$\alpha\f$) and
      40              :  * shift (\f$\beta\f$) must be provided.  Finally, a "rotational killing
      41              :  * vector" \f$k^i\f$ (with magnitude
      42              :  * proportional to the angular velocity of the orbital motion) is provided.  The
      43              :  * rotational shift is defined as \f$B^i = \beta^i + k^i\f$ which is
      44              :  * heuristically the background
      45              :  * motion of the spacetime.
      46              :  *
      47              :  * The system can be formulated in terms of these fluxes and sources (see
      48              :  * `elliptic::protocols::FirstOrderSystem`):
      49              :  *
      50              :  *
      51              :  * \f{align*}
      52              :  * -\partial_i F^i + S = f
      53              :  * \f}
      54              :  *
      55              :  * \f{align*}
      56              :  * F^i &=  D^i \phi - \frac{B^j D_j \phi}{\alpha^2}B^i  \\
      57              :  * S &= -F^iD_i \left( \ln \frac{\alpha \rho}{h}\right) -\Gamma^i_{ij}F^j \\
      58              :  * f &= -D_i \left(\frac{C B^i}{\alpha^2}\right) -
      59              :  * \frac{C}{\alpha^2}B^iD_i\left(
      60              :  * \ln \frac{\alpha \rho}{h}\right)\\
      61              :  * \f}
      62              :  */
      63            1 : struct FirstOrderSystem
      64              :     : tt::ConformsTo<elliptic::protocols::FirstOrderSystem> {
      65              :  private:
      66            0 :   using velocity_potential = Tags::VelocityPotential<DataVector>;
      67              : 
      68              :  public:
      69            0 :   static constexpr size_t volume_dim = 3;
      70              : 
      71            0 :   using primal_fields = tmpl::list<velocity_potential>;
      72              : 
      73              :   // We just use the standard `Flux` prefix because the fluxes don't have
      74              :   // symmetries and we don't need to give them a particular meaning.
      75            0 :   using primal_fluxes = tmpl::list<
      76              :       ::Tags::Flux<velocity_potential, tmpl::size_t<3>, Frame::Inertial>>;
      77              : 
      78            0 :   using background_fields = tmpl::list<
      79              :       gr::Tags::InverseSpatialMetric<DataVector, 3>,
      80              :       gr::Tags::SpatialChristoffelSecondKindContracted<DataVector, 3>,
      81              :       gr::Tags::Lapse<DataVector>,
      82              :       ::Tags::deriv<gr::Tags::Lapse<DataVector>,
      83              :                     tmpl::integral_constant<size_t, 3>, Frame::Inertial>,
      84              :       gr::Tags::Shift<DataVector, 3>,
      85              :       ::Tags::deriv<gr::Tags::Shift<DataVector, 3>,
      86              :                     tmpl::integral_constant<size_t, 3>, Frame::Inertial>,
      87              :       Tags::RotationalShift<DataVector>,
      88              :       Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy<DataVector>,
      89              :       Tags::RotationalShiftStress<DataVector>>;
      90            0 :   using inv_metric_tag = gr::Tags::InverseSpatialMetric<DataVector, 3>;
      91              : 
      92            0 :   using fluxes_computer = Fluxes;
      93            0 :   using sources_computer = Sources;
      94              : 
      95            0 :   using boundary_conditions_base =
      96              :       elliptic::BoundaryConditions::BoundaryCondition<3>;
      97            0 :   using modify_boundary_data = void;
      98              : };
      99              : }  // namespace BnsInitialData
        

Generated by: LCOV version 2.0-1