WeylElectric.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
10 
11 #include "Utilities/Gsl.hpp"
12 
13 namespace gr {
14 
15 /*!
16  * \ingroup GeneralRelativityGroup
17  * \brief Computes the electric part of the Weyl tensor in vacuum.
18  *
19  * \details Computes the electric part of the Weyl tensor in vacuum \f$E_{ij}\f$
20  * as: \f$ E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\f$ where \f$R_{ij}\f$ is
21  * the spatial Ricci tensor, \f$K_{ij}\f$ is the extrinsic curvature, and
22  * \f$K\f$ is the trace of \f$K_{ij}\f$. An additional definition is \f$E_{ij} =
23  * n^a n^b C_{a i b j}\f$, where \f$n\f$ is the unit-normal to the hypersurface
24  * and \f$C\f$ is the Weyl tensor consistent with the conventions
25  * in \cite Boyle2019kee.
26  * \note This needs additional terms for computations in a non-vacuum.
27  */
28 template <size_t SpatialDim, typename Frame, typename DataType>
29 tnsr::ii<DataType, SpatialDim, Frame> weyl_electric(
30  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_ricci,
31  const tnsr::ii<DataType, SpatialDim, Frame>& extrinsic_curvature,
32  const tnsr::II<DataType, SpatialDim, Frame>&
33  inverse_spatial_metric) noexcept;
34 
35 template <size_t SpatialDim, typename Frame, typename DataType>
36 void weyl_electric(
37  gsl::not_null<tnsr::ii<DataType, SpatialDim, Frame>*>
38  weyl_electric_part,
39  const tnsr::ii<DataType, SpatialDim, Frame>& spatial_ricci,
40  const tnsr::ii<DataType, SpatialDim, Frame>& extrinsic_curvature,
41  const tnsr::II<DataType, SpatialDim, Frame>&
42  inverse_spatial_metric) noexcept;
43 
44 namespace Tags {
45 /// Compute item for the electric part of the weyl tensor in vacuum
46 /// Computed from the RicciTensor, ExtrinsicCurvature, and InverseSpatialMetric
47 ///
48 /// Can be retrieved using gr::Tags::WeylElectric
49 template <size_t SpatialDim, typename Frame, typename DataType>
50 struct WeylElectricCompute : WeylElectric<SpatialDim, Frame, DataType>,
52  static constexpr tnsr::ii<DataType, SpatialDim, Frame> (*function)(
53  const tnsr::ii<DataType, SpatialDim, Frame>&,
54  const tnsr::ii<DataType, SpatialDim, Frame>&,
55  const tnsr::II<DataType, SpatialDim, Frame>&) =
56  &weyl_electric<SpatialDim, Frame, DataType>;
57  using argument_tags = tmpl::list<
61 };
62 } // namespace Tags
63 } // namespace gr
tnsr::ii< DataType, SpatialDim, Frame > weyl_electric(const tnsr::ii< DataType, SpatialDim, Frame > &spatial_ricci, const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
Computes the electric part of the Weyl tensor in vacuum.
Definition: WeylElectric.cpp:15
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:154
Inverse of the spatial metric.
Definition: Tags.hpp:36
Holds functions related to general relativity.
Definition: KerrHorizon.cpp:14
Computes the electric part of the Weyl tensor in vacuum as: where is the spatial Ricci tensor...
Definition: Tags.hpp:186
tnsr::ii< DataType, SpatialDim, Frame > extrinsic_curvature(const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric) noexcept
Computes extrinsic curvature from metric and derivatives.
Definition: ComputeSpacetimeQuantities.cpp:218
Definition: DataBoxTag.hpp:29
Defines a list of useful type aliases for tensors.
Defines functions and classes from the GSL.
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12
Compute item for the electric part of the weyl tensor in vacuum Computed from the RicciTensor...
Definition: WeylElectric.hpp:50
Definition: Tags.hpp:148