SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/GeneralRelativity/Surfaces - AreaElement.hpp Hit Total Coverage
Commit: 965048f86d23c819715b3af1ca3f880c8145d4bb Lines: 4 6 66.7 %
Date: 2024-05-16 17:00:40
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/Tensor/TypeAliases.hpp"
       7             : #include "NumericalAlgorithms/SphericalHarmonics/TagsTypeAliases.hpp"
       8             : 
       9             : /// \cond
      10             : class DataVector;
      11             : namespace gsl {
      12             : template <typename>
      13             : struct not_null;
      14             : }  // namespace gsl
      15             : /// \endcond
      16             : 
      17           0 : namespace gr::surfaces {
      18             : /// @{
      19             : /*!
      20             :  * \ingroup SurfacesGroup
      21             :  * \brief Area element of a 2D `Strahlkorper`.
      22             :  *
      23             :  * \details Implements Eq. (D.13), using Eqs. (D.4) and (D.5),
      24             :  * of \cite Baumgarte1996hh. Specifically, computes
      25             :  * \f$\sqrt{(\Theta^i\Theta_i)(\Phi^j\Phi_j)-(\Theta^i\Phi_i)^2}\f$,
      26             :  * \f$\Theta^i=\left(n^i(n_j-s_j) r J^j_\theta + r J^i_\theta\right)\f$,
      27             :  * \f$\Phi^i=\left(n^i(n_j-s_j)r J^j_\phi + r J^i_\phi\right)\f$,
      28             :  * and \f$\Theta^i\f$ and \f$\Phi^i\f$ are lowered by the
      29             :  * 3D spatial metric \f$g_{ij}\f$. Here \f$J^i_\alpha\f$, \f$s_j\f$,
      30             :  * \f$r\f$, and \f$n^i=n_i\f$ correspond to the input arguments
      31             :  * `jacobian`, `normal_one_form`, `radius`, and `r_hat`, respectively;
      32             :  * these input arguments depend only on the Strahlkorper, not on the
      33             :  * metric, and can be computed from a Strahlkorper using ComputeItems
      34             :  * in `ylm::Tags`. Note that this does not include the factor
      35             :  * of \f$\sin\theta\f$, i.e., this returns \f$r^2\f$ for a spherical
      36             :  * `Strahlkorper` in flat space.
      37             :  * This choice makes the area element returned here compatible with
      38             :  * `definite_integral` defined in `YlmSpherePack.hpp`.
      39             :  */
      40             : template <typename Frame>
      41           1 : void area_element(gsl::not_null<Scalar<DataVector>*> result,
      42             :                   const tnsr::ii<DataVector, 3, Frame>& spatial_metric,
      43             :                   const ylm::Tags::aliases::Jacobian<Frame>& jacobian,
      44             :                   const tnsr::i<DataVector, 3, Frame>& normal_one_form,
      45             :                   const Scalar<DataVector>& radius,
      46             :                   const tnsr::i<DataVector, 3, Frame>& r_hat);
      47             : 
      48             : template <typename Frame>
      49           1 : Scalar<DataVector> area_element(
      50             :     const tnsr::ii<DataVector, 3, Frame>& spatial_metric,
      51             :     const ylm::Tags::aliases::Jacobian<Frame>& jacobian,
      52             :     const tnsr::i<DataVector, 3, Frame>& normal_one_form,
      53             :     const Scalar<DataVector>& radius,
      54             :     const tnsr::i<DataVector, 3, Frame>& r_hat);
      55             : /// @}
      56             : 
      57             : /// @{
      58             : /*!
      59             :  * \ingroup SurfacesGroup
      60             :  * \brief Euclidean area element of a 2D `Strahlkorper`.
      61             :  *
      62             :  * This is useful for computing a flat-space integral over an
      63             :  * arbitrarily-shaped `Strahlkorper`.
      64             :  *
      65             :  * \details Implements Eq. (D.13), using Eqs. (D.4) and (D.5),
      66             :  * of \cite Baumgarte1996hh. Specifically, computes
      67             :  * \f$\sqrt{(\Theta^i\Theta_i)(\Phi^j\Phi_j)-(\Theta^i\Phi_i)^2}\f$,
      68             :  * \f$\Theta^i=\left(n^i(n_j-s_j) r J^j_\theta + r J^i_\theta\right)\f$,
      69             :  * \f$\Phi^i=\left(n^i(n_j-s_j)r J^j_\phi + r J^i_\phi\right)\f$,
      70             :  * and \f$\Theta^i\f$ and \f$\Phi^i\f$ are lowered by the
      71             :  * Euclidean spatial metric. Here \f$J^i_\alpha\f$, \f$s_j\f$,
      72             :  * \f$r\f$, and \f$n^i=n_i\f$ correspond to the input arguments
      73             :  * `jacobian`, `normal_one_form`, `radius`, and `r_hat`, respectively;
      74             :  * these input arguments depend only on the Strahlkorper, not on the
      75             :  * metric, and can be computed from a Strahlkorper using ComputeItems
      76             :  * in `ylm::Tags`. Note that this does not include the factor
      77             :  * of \f$\sin\theta\f$, i.e., this returns \f$r^2\f$ for a spherical
      78             :  * `Strahlkorper`.
      79             :  * This choice makes the area element returned here compatible with
      80             :  * `definite_integral` defined in `YlmSpherePack.hpp`.
      81             :  */
      82             : template <typename Frame>
      83           1 : void euclidean_area_element(
      84             :     gsl::not_null<Scalar<DataVector>*> result,
      85             :     const ylm::Tags::aliases::Jacobian<Frame>& jacobian,
      86             :     const tnsr::i<DataVector, 3, Frame>& normal_one_form,
      87             :     const Scalar<DataVector>& radius,
      88             :     const tnsr::i<DataVector, 3, Frame>& r_hat);
      89             : 
      90             : template <typename Frame>
      91           1 : Scalar<DataVector> euclidean_area_element(
      92             :     const ylm::Tags::aliases::Jacobian<Frame>& jacobian,
      93             :     const tnsr::i<DataVector, 3, Frame>& normal_one_form,
      94             :     const Scalar<DataVector>& radius,
      95             :     const tnsr::i<DataVector, 3, Frame>& r_hat);
      96             : /// @}
      97             : }  // namespace gr::surfaces

Generated by: LCOV version 1.14