SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/ForceFree - Fluxes.hpp Hit Total Coverage
Commit: d0fc80462417e83e5cddfa1b9901bb4a9b6af4d6 Lines: 1 5 20.0 %
Date: 2024-03-29 00:33:31
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 "DataStructures/DataBox/Prefixes.hpp"
       7             : #include "DataStructures/Tensor/TypeAliases.hpp"
       8             : #include "Evolution/Systems/ForceFree/Tags.hpp"
       9             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      10             : #include "Utilities/TMPL.hpp"
      11             : 
      12             : /// \cond
      13             : class DataVector;
      14             : namespace gsl {
      15             : template <typename T>
      16             : class not_null;
      17             : }  // namespace gsl
      18             : /// \endcond
      19             : 
      20             : namespace ForceFree {
      21             : 
      22             : namespace detail {
      23             : void fluxes_impl(
      24             :     gsl::not_null<tnsr::IJ<DataVector, 3, Frame::Inertial>*> tilde_e_flux,
      25             :     gsl::not_null<tnsr::IJ<DataVector, 3, Frame::Inertial>*> tilde_b_flux,
      26             :     gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_psi_flux,
      27             :     gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_phi_flux,
      28             :     gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_q_flux,
      29             : 
      30             :     // Temporaries
      31             :     const tnsr::i<DataVector, 3, Frame::Inertial>&
      32             :         lapse_times_electric_field_one_form,
      33             :     const tnsr::i<DataVector, 3, Frame::Inertial>&
      34             :         lapse_times_magnetic_field_one_form,
      35             : 
      36             :     // extra args
      37             :     const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_e,
      38             :     const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
      39             :     const Scalar<DataVector>& tilde_psi, const Scalar<DataVector>& tilde_phi,
      40             :     const Scalar<DataVector>& tilde_q,
      41             :     const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_j,
      42             :     const Scalar<DataVector>& lapse,
      43             :     const tnsr::I<DataVector, 3, Frame::Inertial>& shift,
      44             :     const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric);
      45             : }  // namespace detail
      46             : 
      47             : /*!
      48             :  * \brief Compute the fluxes of the GRFFE system with divergence cleaning.
      49             :  *
      50             :  * \f{align*}
      51             :  *  F^j(\tilde{E}^i) & = -\beta^j\tilde{E}^i + \alpha (\gamma^{ij}\tilde{\psi}
      52             :  *      - \epsilon^{ijk}_{(3)}\tilde{B}_k) \\
      53             :  *  F^j(\tilde{B}^i) & = -\beta^j\tilde{B}^i + \alpha (\gamma^{ij}\tilde{\phi}
      54             :  *      + \epsilon^{ijk}_{(3)}\tilde{E}_k) \\
      55             :  *  F^j(\tilde{\psi}) & = -\beta^j \tilde{\psi} + \alpha \tilde{E}^j \\
      56             :  *  F^j(\tilde{\phi}) & = -\beta^j \tilde{\phi} + \alpha \tilde{B}^j \\
      57             :  *  F^j(\tilde{q}) & = \alpha \sqrt{\gamma}J^j - \beta^j \tilde{q}
      58             :  * \f}
      59             :  *
      60             :  * where the conserved variables \f$\tilde{E}^i, \tilde{B}^i, \tilde{\psi},
      61             :  * \tilde{\phi}, \tilde{q}\f$ are densitized electric field, magnetic field,
      62             :  * electric divergence cleaning field, magnetic divergence cleaning field, and
      63             :  * electric charge density. \f$J^i\f$ is the spatial electric current density.
      64             :  *
      65             :  * \f$\epsilon_{(3)}^{ijk}\f$ is the spatial Levi-Civita tensor defined as
      66             :  *
      67             :  * \f{align*}
      68             :  *  \epsilon_{(3)}^{ijk} \equiv n_\mu \epsilon^{\mu ijk}
      69             :  *   = -\frac{1}{\sqrt{-g}} n_\mu [\mu ijk] = \frac{1}{\sqrt{\gamma}} [ijk]
      70             :  * \f}
      71             :  *
      72             :  * where $\epsilon^{\mu\nu\rho\sigma}$ is the Levi-Civita tensor, \f$g\f$ is the
      73             :  * determinant of spacetime metric, \f$\gamma\f$ is the determinant of spatial
      74             :  * metric, \f$n^\mu\f$ is the normal to spatial hypersurface. Also,
      75             :  * \f$[abcd]\f$ and \f$[ijk]\f$ are the usual antisymmetric _symbols_ (which
      76             :  * only have the value \f$\pm 1\f$) with 4 and 3 indices, respectively, with the
      77             :  * sign \f$[0123] = [123] = +1\f$. Note that
      78             :  *
      79             :  * \f{align*}
      80             :  *  \epsilon_{\mu\nu\rho\sigma} = \sqrt{-g} \, [\mu\nu\rho\sigma]
      81             :  *  , \quad \text{and} \quad
      82             :  *  \epsilon^{\mu\nu\rho\sigma} = -\frac{1}{\sqrt{-g}} [\mu\nu\rho\sigma]
      83             :  * \f}
      84             :  *
      85             :  */
      86           1 : struct Fluxes {
      87           0 :   using return_tags =
      88             :       tmpl::list<::Tags::Flux<Tags::TildeE, tmpl::size_t<3>, Frame::Inertial>,
      89             :                  ::Tags::Flux<Tags::TildeB, tmpl::size_t<3>, Frame::Inertial>,
      90             :                  ::Tags::Flux<Tags::TildePsi, tmpl::size_t<3>, Frame::Inertial>,
      91             :                  ::Tags::Flux<Tags::TildePhi, tmpl::size_t<3>, Frame::Inertial>,
      92             :                  ::Tags::Flux<Tags::TildeQ, tmpl::size_t<3>, Frame::Inertial>>;
      93             : 
      94           0 :   using argument_tags =
      95             :       tmpl::list<Tags::TildeE, Tags::TildeB, Tags::TildePsi, Tags::TildePhi,
      96             :                  Tags::TildeQ, Tags::TildeJ, gr::Tags::Lapse<DataVector>,
      97             :                  gr::Tags::Shift<DataVector, 3>,
      98             :                  gr::Tags::SqrtDetSpatialMetric<DataVector>,
      99             :                  gr::Tags::SpatialMetric<DataVector, 3>,
     100             :                  gr::Tags::InverseSpatialMetric<DataVector, 3>>;
     101             : 
     102           0 :   static void apply(
     103             :       gsl::not_null<tnsr::IJ<DataVector, 3, Frame::Inertial>*> tilde_e_flux,
     104             :       gsl::not_null<tnsr::IJ<DataVector, 3, Frame::Inertial>*> tilde_b_flux,
     105             :       gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_psi_flux,
     106             :       gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_phi_flux,
     107             :       gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_q_flux,
     108             :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_e,
     109             :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
     110             :       const Scalar<DataVector>& tilde_psi, const Scalar<DataVector>& tilde_phi,
     111             :       const Scalar<DataVector>& tilde_q,
     112             :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_j,
     113             :       const Scalar<DataVector>& lapse,
     114             :       const tnsr::I<DataVector, 3, Frame::Inertial>& shift,
     115             :       const Scalar<DataVector>& sqrt_det_spatial_metric,
     116             :       const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric,
     117             :       const tnsr::II<DataVector, 3, Frame::Inertial>& inv_spatial_metric);
     118             : };
     119             : }  // namespace ForceFree

Generated by: LCOV version 1.14