SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/ForceFree - ElectricCurrentDensity.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 21.4 % 14 3
Test Date: 2026-10-22 17:29:42
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/DataBox.hpp"
       7              : #include "DataStructures/DataBox/Prefixes.hpp"
       8              : #include "DataStructures/DataBox/Tag.hpp"
       9              : #include "DataStructures/Tensor/TypeAliases.hpp"
      10              : #include "Evolution/Systems/ForceFree/Tags.hpp"
      11              : #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
      12              : #include "Utilities/TMPL.hpp"
      13              : 
      14              : /// \cond
      15              : class DataVector;
      16              : namespace gsl {
      17              : template <typename T>
      18              : class not_null;
      19              : }  // namespace gsl
      20              : /// \endcond
      21              : 
      22              : namespace ForceFree {
      23              : 
      24              : /*!
      25              :  * \brief Computes the non-stiff part \f$\tilde{J}^i_\mathrm{drift}\f$ of the
      26              :  * generalized electric current density \f$\tilde{J}^i\f$.
      27              :  *
      28              :  * \f{align}
      29              :  *  \tilde{J}^i_\mathrm{drift}
      30              :  *    = \alpha \sqrt{\gamma} q \frac{\epsilon^{ijk}_{(3)}E_jB_k}{B_lB^l}
      31              :  * \f}
      32              :  *
      33              :  * where \f$\alpha\f$ is lapse, \f$\gamma\f$ is the determinant of the spatial
      34              :  * metric, \f$q\f$ is charge density, \f$\epsilon^{ijk}_{(3)}\f$ is the spatial
      35              :  * Levi-Civita tensor, \f$E^i\f$ is the electric field, and \f$B^i\f$ is the
      36              :  * magnetic field.
      37              :  *
      38              :  */
      39            1 : struct ComputeDriftTildeJ {
      40            0 :   using argument_tags =
      41              :       tmpl::list<Tags::TildeQ, Tags::TildeE, Tags::TildeB,
      42              :                  Tags::ParallelConductivity, gr::Tags::Lapse<DataVector>,
      43              :                  gr::Tags::SqrtDetSpatialMetric<DataVector>,
      44              :                  gr::Tags::SpatialMetric<DataVector, 3>>;
      45            0 :   using return_type = tnsr::I<DataVector, 3>;
      46              : 
      47            0 :   static void apply(
      48              :       gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> drift_tilde_j,
      49              :       const Scalar<DataVector>& tilde_q,
      50              :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_e,
      51              :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
      52              :       double parallel_conductivity, const Scalar<DataVector>& lapse,
      53              :       const Scalar<DataVector>& sqrt_det_spatial_metric,
      54              :       const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric);
      55              : };
      56              : 
      57              : /*!
      58              :  * \brief Computes the stiff part \f$\tilde{J}^i_\mathrm{parallel}\f$ of the
      59              :  * generalized electric current density \f$\tilde{J}^i\f$.
      60              :  *
      61              :  * \f{align*}
      62              :  *  \tilde{J}^i_\mathrm{parallel}
      63              :  *    & = \alpha \sqrt{\gamma} \eta \left[
      64              :  *        \frac{(E_lB^l)B^i}{B^2} + \frac{\mathcal{R}(E^2-B^2)}{B^2} E^i
      65              :  *      \right]
      66              :  * \f}
      67              :  *
      68              :  * where \f$\alpha\f$ is lapse, \f$\gamma\f$ is the determinant of the spatial
      69              :  * metric, \f$E^i\f$ is the electric field, \f$B^i\f$ is the magnetic field,
      70              :  * \f$\eta\f$ is the parallel conductivity, and \f$\mathcal{R}(x) = \max
      71              :  * (x,0)\f$ is the rectifier function.
      72              :  *
      73              :  */
      74            1 : struct ComputeParallelTildeJ {
      75            0 :   using argument_tags =
      76              :       tmpl::list<Tags::TildeQ, Tags::TildeE, Tags::TildeB,
      77              :                  Tags::ParallelConductivity, gr::Tags::Lapse<DataVector>,
      78              :                  gr::Tags::SqrtDetSpatialMetric<DataVector>,
      79              :                  gr::Tags::SpatialMetric<DataVector, 3>>;
      80            0 :   using return_type = tnsr::I<DataVector, 3>;
      81              : 
      82            0 :   static void apply(
      83              :       gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> parallel_tilde_j,
      84              :       const Scalar<DataVector>& tilde_q,
      85              :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_e,
      86              :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
      87              :       double parallel_conductivity, const Scalar<DataVector>& lapse,
      88              :       const Scalar<DataVector>& sqrt_det_spatial_metric,
      89              :       const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric);
      90              : };
      91              : 
      92              : namespace Tags {
      93              : /*!
      94              :  * \brief Computes the densitized electric current density \f$\tilde{J}^i\f$.
      95              :  *
      96              :  * \f{align}
      97              :  *  \tilde{J}^i = \tilde{J}^i_\mathrm{drift} + \tilde{J}^i_\mathrm{parallel}
      98              :  *   = \alpha \left[
      99              :  *      \tilde{q} \frac{\epsilon^{ijk}_{(3)}\tilde{E}_j \tilde{B}_k}
     100              :  *                     {\tilde{B}_l \tilde{B}^l}
     101              :  *      + \eta \left\{
     102              :  *        \frac{(\tilde{E}_l\tilde{B}^l)\tilde{B}^i}{\tilde{B}^2}
     103              :  *      + \frac{\mathcal{R}(\tilde{E}^2-\tilde{B}^2)}{\tilde{B}^2} \tilde{E}^i
     104              :  *      \right\}
     105              :  * \right]
     106              :  * \f}
     107              :  *
     108              :  * See ComputeDriftTildeJ and ComputeParallelTildeJ for the details of each
     109              :  * terms.
     110              :  *
     111              :  */
     112            1 : struct ComputeTildeJ : TildeJ, db::ComputeTag {
     113            0 :   using argument_tags =
     114              :       tmpl::list<Tags::TildeQ, Tags::TildeE, Tags::TildeB,
     115              :                  Tags::ParallelConductivity, gr::Tags::Lapse<DataVector>,
     116              :                  gr::Tags::SqrtDetSpatialMetric<DataVector>,
     117              :                  gr::Tags::SpatialMetric<DataVector, 3>>;
     118            0 :   using return_type = tnsr::I<DataVector, 3>;
     119            0 :   using base = TildeJ;
     120              : 
     121            0 :   static void function(
     122              :       gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> tilde_j,
     123              :       const Scalar<DataVector>& tilde_q,
     124              :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_e,
     125              :       const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
     126              :       double parallel_conductivity, const Scalar<DataVector>& lapse,
     127              :       const Scalar<DataVector>& sqrt_det_spatial_metric,
     128              :       const tnsr::ii<DataVector, 3, Frame::Inertial>& spatial_metric);
     129              : };
     130              : }  // namespace Tags
     131              : 
     132              : }  // namespace ForceFree
        

Generated by: LCOV version 2.0-1