SpECTRE  v2024.02.05
General Relativity

Contains functions used in General Relativistic simulations. More...

Namespaces

namespace  gr
 Holds functions related to general relativity.
 

Functions

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ijj< DataType, SpatialDim, Frame > gh::covariant_deriv_of_extrinsic_curvature (const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal_vector, const tnsr::Ijj< DataType, SpatialDim, Frame > &spatial_christoffel_second_kind, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi)
 Computes the covariant derivative of extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spacetime_derivative_of_spacetime_metric (gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame > * > da_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the spacetime derivative of the spacetime metric, \(\partial_a g_{bc}\). More...
 
template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame (const gsl::not_null< tnsr::ii< DataType, VolumeDim, DestFrame > * > dest, const tnsr::ii< DataType, VolumeDim, SrcFrame > &src, const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &jacobian)
 
template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame (const tnsr::ii< DataType, VolumeDim, SrcFrame > &src, const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &jacobian) -> tnsr::ii< DataType, VolumeDim, DestFrame >
 
template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame (const gsl::not_null< Scalar< DataType > * > dest, const Scalar< DataType > &src, const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &jacobian, const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &inv_jacobian)
 Transforms a tensor to a different frame. More...
 
template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame (Scalar< DataType > src, const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &jacobian, const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &inv_jacobian) -> Scalar< DataType >
 Transforms a tensor to a different frame. More...
 
template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame (const gsl::not_null< tnsr::I< DataType, VolumeDim, DestFrame > * > dest, const tnsr::I< DataType, VolumeDim, SrcFrame > &src, const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &jacobian, const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &inv_jacobian)
 Transforms a tensor to a different frame. More...
 
template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame (const tnsr::I< DataType, VolumeDim, SrcFrame > &src, const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &jacobian, const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &inv_jacobian) -> tnsr::I< DataType, VolumeDim, DestFrame >
 Transforms a tensor to a different frame. More...
 
template<typename ResultTensor , typename InputTensor , typename DataType , size_t Dim, typename SourceFrame , typename TargetFrame >
void transform::first_index_to_different_frame (gsl::not_null< ResultTensor * > result, const InputTensor &input, const InverseJacobian< DataType, Dim, SourceFrame, TargetFrame > &inv_jacobian)
 
template<typename InputTensor , typename DataType , size_t Dim, typename SourceFrame , typename TargetFrame , typename ResultTensor = TensorMetafunctions::prepend_spatial_index< TensorMetafunctions::remove_first_index<InputTensor>, Dim, UpLo::Up, SourceFrame>>
ResultTensor transform::first_index_to_different_frame (const InputTensor &input, const InverseJacobian< DataType, Dim, SourceFrame, TargetFrame > &inv_jacobian)
 
template<typename DataType , typename Index0 , typename Index1 >
void raise_or_lower_first_index (gsl::not_null< Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< change_index_up_lo< Index0 >, Index1, Index1 > > * > result, const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &metric)
 Raises or lowers the first index of a rank 3 tensor which is symmetric in the last two indices. More...
 
template<typename DataType , typename Index0 , typename Index1 >
Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< change_index_up_lo< Index0 >, Index1, Index1 > > raise_or_lower_first_index (const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &metric)
 Raises or lowers the first index of a rank 3 tensor which is symmetric in the last two indices. More...
 
template<typename DataType , typename Index0 >
void raise_or_lower_index (gsl::not_null< Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index0 > > > * > result, const Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &metric)
 Raises or lowers the index of a rank 1 tensor. More...
 
template<typename DataType , typename Index0 >
Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index0 > > > raise_or_lower_index (const Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &metric)
 Raises or lowers the index of a rank 1 tensor. More...
 
template<typename DataType , typename Index0 , typename Index1 >
void trace_last_indices (gsl::not_null< Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > * > trace_of_tensor, const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index1 >, change_index_up_lo< Index1 > > > &metric)
 Computes trace of a rank 3 tensor, which is symmetric in its last two indices, tracing the symmetric indices. More...
 
template<typename DataType , typename Index0 , typename Index1 >
Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > trace_last_indices (const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index1 >, change_index_up_lo< Index1 > > > &metric)
 Computes trace of a rank 3 tensor, which is symmetric in its last two indices, tracing the symmetric indices. More...
 
template<typename DataType , typename Index0 >
void trace (gsl::not_null< Scalar< DataType > * > trace, const Tensor< DataType, Symmetry< 1, 1 >, index_list< Index0, Index0 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &metric)
 Computes trace of a rank-2 symmetric tensor. More...
 
template<typename DataType , typename Index0 >
Scalar< DataType > trace (const Tensor< DataType, Symmetry< 1, 1 >, index_list< Index0, Index0 > > &tensor, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &metric)
 Computes trace of a rank-2 symmetric tensor. More...
 
template<typename DataType , size_t Dim, typename Frame >
void Ccz4::divergence_lapse (const gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &conformal_factor_squared, const tnsr::II< DataType, Dim, Frame > &inverse_conformal_metric, const tnsr::ij< DataType, Dim, Frame > &grad_grad_lapse)
 Computes the divergence of the lapse. More...
 
template<typename DataType , size_t Dim, typename Frame >
Scalar< DataType > Ccz4::divergence_lapse (const Scalar< DataType > &conformal_factor_squared, const tnsr::II< DataType, Dim, Frame > &inverse_conformal_metric, const tnsr::ij< DataType, Dim, Frame > &grad_grad_lapse)
 Computes the divergence of the lapse. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::christoffel_first_kind (gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame, Index > * > christoffel, const tnsr::abb< DataType, SpatialDim, Frame, Index > &d_metric)
 Computes Christoffel symbol of the first kind from derivative of metric. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
tnsr::abb< DataType, SpatialDim, Frame, Indexgr::christoffel_first_kind (const tnsr::abb< DataType, SpatialDim, Frame, Index > &d_metric)
 Computes Christoffel symbol of the first kind from derivative of metric. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::christoffel_second_kind (const gsl::not_null< tnsr::Abb< DataType, SpatialDim, Frame, Index > * > christoffel, const tnsr::abb< DataType, SpatialDim, Frame, Index > &d_metric, const tnsr::AA< DataType, SpatialDim, Frame, Index > &inverse_metric)
 Computes Christoffel symbol of the second kind from derivative of metric and the inverse metric. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
auto gr::christoffel_second_kind (const tnsr::abb< DataType, SpatialDim, Frame, Index > &d_metric, const tnsr::AA< DataType, SpatialDim, Frame, Index > &inverse_metric) -> tnsr::Abb< DataType, SpatialDim, Frame, Index >
 Computes Christoffel symbol of the second kind from derivative of metric and the inverse metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::derivatives_of_spacetime_metric (gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame > * > spacetime_deriv_spacetime_metric, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_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)
 Computes spacetime derivative of spacetime metric from spatial metric, lapse, shift, and their space and time derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::abb< DataType, SpatialDim, Frame > gr::derivatives_of_spacetime_metric (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_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)
 Computes spacetime derivative of spacetime metric from spatial metric, lapse, shift, and their space and time derivatives. More...
 
template<typename DataType , size_t Dim, typename Frame >
void gr::deriv_inverse_spatial_metric (const gsl::not_null< tnsr::iJJ< DataType, Dim, Frame > * > result, const tnsr::II< DataType, Dim, Frame > &inverse_spatial_metric, const tnsr::ijj< DataType, Dim, Frame > &d_spatial_metric)
 Computes the spatial derivative of the inverse spatial metric from the inverse spatial metric and the spatial derivative of the spatial metric. More...
 
template<typename DataType , size_t Dim, typename Frame >
tnsr::iJJ< DataType, Dim, Frame > gr::deriv_inverse_spatial_metric (const tnsr::II< DataType, Dim, Frame > &inverse_spatial_metric, const tnsr::ijj< DataType, Dim, Frame > &d_spatial_metric)
 Computes the spatial derivative of the inverse spatial metric from the inverse spatial metric and the spatial derivative of the spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::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)
 Computes extrinsic curvature from metric and derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::extrinsic_curvature (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > ex_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)
 Computes extrinsic curvature from metric and derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::christoffel_second_kind (const gsl::not_null< tnsr::Ijj< DataType, SpatialDim, Frame > * > christoffel, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::II< DataType, SpatialDim, Frame > &inv_metric)
 Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
auto gh::christoffel_second_kind (const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::II< DataType, SpatialDim, Frame > &inv_metric) -> tnsr::Ijj< DataType, SpatialDim, Frame >
 Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::deriv_spatial_metric (gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > * > d_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ijj< DataType, SpatialDim, Frame > gh::deriv_spatial_metric (const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::extrinsic_curvature (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > ex_curv, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gh::extrinsic_curvature (const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::gauge_source (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > gauge_source_h, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const Scalar< DataType > &trace_extrinsic_curvature, const tnsr::i< DataType, SpatialDim, Frame > &trace_christoffel_last_indices)
 Computes generalized harmonic gauge source function. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::gauge_source (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const Scalar< DataType > &trace_extrinsic_curvature, const tnsr::i< DataType, SpatialDim, Frame > &trace_christoffel_last_indices)
 Computes generalized harmonic gauge source function. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::phi (gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * > phi, const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_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::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric)
 Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iaa< DataType, SpatialDim, Frame > gh::phi (const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_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::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric)
 Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::pi (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > pi, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( g_{ab} \). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gh::pi (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( g_{ab} \). More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
void gh::spatial_ricci_tensor (gsl::not_null< tnsr::ii< DataType, VolumeDim, Frame > * > ricci, const tnsr::iaa< DataType, VolumeDim, Frame > &phi, const tnsr::ijaa< DataType, VolumeDim, Frame > &deriv_phi, const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric)
 Compute spatial Ricci tensor using evolved variables and their first derivatives. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::ii< DataType, VolumeDim, Frame > gh::spatial_ricci_tensor (const tnsr::iaa< DataType, VolumeDim, Frame > &phi, const tnsr::ijaa< DataType, VolumeDim, Frame > &deriv_phi, const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric)
 Compute spatial Ricci tensor using evolved variables and their first derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::second_time_deriv_of_spacetime_metric (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > d2t2_spacetime_metric, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &dt_phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::aa< DataType, SpatialDim, Frame > &dt_pi)
 Computes the second time derivative of the spacetime metric from the generalized harmonic variables, lapse, shift, and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gh::second_time_deriv_of_spacetime_metric (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &dt_phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::aa< DataType, SpatialDim, Frame > &dt_pi)
 Computes the second time derivative of the spacetime metric from the generalized harmonic variables, lapse, shift, and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spacetime_deriv_of_det_spatial_metric (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > d4_det_spatial_metric, const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::spacetime_deriv_of_det_spatial_metric (const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spacetime_deriv_of_norm_of_shift (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > d4_norm_of_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes spacetime derivatives of the norm of the shift vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::spacetime_deriv_of_norm_of_shift (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes spacetime derivatives of the norm of the shift vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spatial_deriv_of_lapse (gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > * > deriv_lapse, const Scalar< DataType > &lapse, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of lapse ( \(\alpha\)) from the generalized harmonic variables and spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::i< DataType, SpatialDim, Frame > gh::spatial_deriv_of_lapse (const Scalar< DataType > &lapse, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of lapse ( \(\alpha\)) from the generalized harmonic variables and spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spatial_deriv_of_shift (gsl::not_null< tnsr::iJ< DataType, SpatialDim, Frame > * > deriv_shift, const Scalar< DataType > &lapse, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iJ< DataType, SpatialDim, Frame > gh::spatial_deriv_of_shift (const Scalar< DataType > &lapse, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_derivative_of_spacetime_metric (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > dt_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the time derivative of the spacetime metric from the generalized harmonic quantities \(\Pi_{a b}\), \(\Phi_{i a b}\), and the lapse \(\alpha\) and shift \(\beta^i\). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gh::time_derivative_of_spacetime_metric (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the time derivative of the spacetime metric from the generalized harmonic quantities \(\Pi_{a b}\), \(\Phi_{i a b}\), and the lapse \(\alpha\) and shift \(\beta^i\). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_lapse (gsl::not_null< Scalar< DataType > * > dt_lapse, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of lapse ( \(\alpha\)) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gh::time_deriv_of_lapse (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of lapse ( \(\alpha\)) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_lower_shift (gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > * > dt_lower_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::i< DataType, SpatialDim, Frame > gh::time_deriv_of_lower_shift (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_shift (gsl::not_null< tnsr::I< DataType, SpatialDim, Frame > * > dt_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::I< DataType, SpatialDim, Frame > gh::time_deriv_of_shift (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_spatial_metric (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > dt_spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gh::time_deriv_of_spatial_metric (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the spatial metric. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::a< DataType, VolumeDim, Frame > gr::interface_null_normal (const tnsr::a< DataType, VolumeDim, Frame > &spacetime_normal_one_form, const tnsr::i< DataType, VolumeDim, Frame > &interface_unit_normal_one_form, const double sign)
 Compute null normal one-form to the boundary of a closed region in a spatial slice of spacetime. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
void gr::interface_null_normal (gsl::not_null< tnsr::A< DataType, VolumeDim, Frame > * > null_vector, const tnsr::A< DataType, VolumeDim, Frame > &spacetime_normal_vector, const tnsr::I< DataType, VolumeDim, Frame > &interface_unit_normal_vector, const double sign)
 Compute null normal vector to the boundary of a closed region in a spatial slice of spacetime. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::inverse_spacetime_metric (gsl::not_null< tnsr::AA< DataType, SpatialDim, Frame > * > inverse_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Compute inverse spacetime metric from inverse spatial metric, lapse and shift. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::AA< DataType, SpatialDim, Frame > gr::inverse_spacetime_metric (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Compute inverse spacetime metric from inverse spatial metric, lapse and shift. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gr::lapse (const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric)
 Compute lapse from shift and spacetime metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::lapse (gsl::not_null< Scalar< DataType > * > lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric)
 Compute lapse from shift and spacetime metric. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::II< DataType, VolumeDim, Frame > gr::transverse_projection_operator (const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric, const tnsr::I< DataType, VolumeDim, Frame > &normal_vector)
 Compute projection operator onto an interface. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
void gr::transverse_projection_operator (gsl::not_null< tnsr::ii< DataType, VolumeDim, Frame > * > projection_tensor, const tnsr::ii< DataType, VolumeDim, Frame > &spatial_metric, const tnsr::i< DataType, VolumeDim, Frame > &normal_one_form)
 Compute projection operator onto an interface. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::aa< DataType, VolumeDim, Frame > gr::transverse_projection_operator (const tnsr::aa< DataType, VolumeDim, Frame > &spacetime_metric, const tnsr::a< DataType, VolumeDim, Frame > &spacetime_normal_one_form, const tnsr::i< DataType, VolumeDim, Frame > &interface_unit_normal_one_form)
 Compute spacetime projection operator onto an interface. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
void gr::transverse_projection_operator (gsl::not_null< tnsr::AA< DataType, VolumeDim, Frame > * > projection_tensor, const tnsr::AA< DataType, VolumeDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, VolumeDim, Frame > &spacetime_normal_vector, const tnsr::I< DataType, VolumeDim, Frame > &interface_unit_normal_vector)
 Compute spacetime projection operator onto an interface. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::Ab< DataType, VolumeDim, Frame > gr::transverse_projection_operator (const tnsr::A< DataType, VolumeDim, Frame > &spacetime_normal_vector, const tnsr::a< DataType, VolumeDim, Frame > &spacetime_normal_one_form, const tnsr::I< DataType, VolumeDim, Frame > &interface_unit_normal_vector, const tnsr::i< DataType, VolumeDim, Frame > &interface_unit_normal_one_form)
 Compute spacetime projection operator onto an interface. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
void gr::transverse_projection_operator (gsl::not_null< tnsr::Ab< DataType, VolumeDim, Frame > * > projection_tensor, const tnsr::A< DataType, VolumeDim, Frame > &spacetime_normal_vector, const tnsr::a< DataType, VolumeDim, Frame > &spacetime_normal_one_form, const tnsr::I< DataType, VolumeDim, Frame > &interface_unit_normal_vector, const tnsr::i< DataType, VolumeDim, Frame > &interface_unit_normal_one_form)
 Compute spacetime projection operator onto an interface. More...
 
template<typename Frame >
void gr::psi_4 (const gsl::not_null< Scalar< ComplexDataVector > * > psi_4_result, const tnsr::ii< DataVector, 3, Frame > &spatial_ricci, const tnsr::ii< DataVector, 3, Frame > &extrinsic_curvature, const tnsr::ijj< DataVector, 3, Frame > &cov_deriv_extrinsic_curvature, const tnsr::ii< DataVector, 3, Frame > &spatial_metric, const tnsr::II< DataVector, 3, Frame > &inverse_spatial_metric, const tnsr::I< DataVector, 3, Frame > &inertial_coords)
 Computes Newman Penrose quantity \(\Psi_4\) using the characteristic field U \(^{8+}\) and complex vector \(\bar{m}^i\). More...
 
template<typename Frame >
Scalar< ComplexDataVectorgr::psi_4 (const tnsr::ii< DataVector, 3, Frame > &spatial_ricci, const tnsr::ii< DataVector, 3, Frame > &extrinsic_curvature, const tnsr::ijj< DataVector, 3, Frame > &cov_deriv_extrinsic_curvature, const tnsr::ii< DataVector, 3, Frame > &spatial_metric, const tnsr::II< DataVector, 3, Frame > &inverse_spatial_metric, const tnsr::I< DataVector, 3, Frame > &inertial_coords)
 Computes Newman Penrose quantity \(\Psi_4\) using the characteristic field U \(^{8+}\) and complex vector \(\bar{m}^i\). More...
 
template<typename Frame >
void gr::psi_4_real (const gsl::not_null< Scalar< DataVector > * > psi_4_real_result, const tnsr::ii< DataVector, 3, Frame > &spatial_ricci, const tnsr::ii< DataVector, 3, Frame > &extrinsic_curvature, const tnsr::ijj< DataVector, 3, Frame > &cov_deriv_extrinsic_curvature, const tnsr::ii< DataVector, 3, Frame > &spatial_metric, const tnsr::II< DataVector, 3, Frame > &inverse_spatial_metric, const tnsr::I< DataVector, 3, Frame > &inertial_coords)
 Computes the real part of the Newman Penrose quantity \(\Psi_4\) using \(\Psi_4[Real] = -0.5*U^{8+}_{ij}*(x^ix^j - y^iy^j)\).
 
template<typename Frame >
Scalar< DataVectorgr::psi_4_real (const tnsr::ii< DataVector, 3, Frame > &spatial_ricci, const tnsr::ii< DataVector, 3, Frame > &extrinsic_curvature, const tnsr::ijj< DataVector, 3, Frame > &cov_deriv_extrinsic_curvature, const tnsr::ii< DataVector, 3, Frame > &spatial_metric, const tnsr::II< DataVector, 3, Frame > &inverse_spatial_metric, const tnsr::I< DataVector, 3, Frame > &inertial_coords)
 Computes the real part of the Newman Penrose quantity \(\Psi_4\) using \(\Psi_4[Real] = -0.5*U^{8+}_{ij}*(x^ix^j - y^iy^j)\).
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::ricci_tensor (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame, Index > * > result, const tnsr::Abb< DataType, SpatialDim, Frame, Index > &christoffel_2nd_kind, const tnsr::aBcc< DataType, SpatialDim, Frame, Index > &d_christoffel_2nd_kind)
 Computes Ricci tensor from the (spatial or spacetime) Christoffel symbol of the second kind and its derivative. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
tnsr::aa< DataType, SpatialDim, Frame, Indexgr::ricci_tensor (const tnsr::Abb< DataType, SpatialDim, Frame, Index > &christoffel_2nd_kind, const tnsr::aBcc< DataType, SpatialDim, Frame, Index > &d_christoffel_2nd_kind)
 Computes Ricci tensor from the (spatial or spacetime) Christoffel symbol of the second kind and its derivative. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::ricci_scalar (const gsl::not_null< Scalar< DataType > * > ricci_scalar_result, const tnsr::aa< DataType, SpatialDim, Frame, Index > &ricci_tensor, const tnsr::AA< DataType, SpatialDim, Frame, Index > &inverse_metric)
 Computes the Ricci Scalar from the (spatial or spacetime) Ricci Tensor and inverse metrics. More...
 
template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
Scalar< DataType > gr::ricci_scalar (const tnsr::aa< DataType, SpatialDim, Frame, Index > &ricci_tensor, const tnsr::AA< DataType, SpatialDim, Frame, Index > &inverse_metric)
 Computes the Ricci Scalar from the (spatial or spacetime) Ricci Tensor and inverse metrics. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::I< DataType, SpatialDim, Frame > gr::shift (const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Compute shift from spacetime metric and inverse spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::shift (gsl::not_null< tnsr::I< DataType, SpatialDim, Frame > * > shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Compute shift from spacetime metric and inverse spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::spacetime_deriv_of_goth_g (gsl::not_null< tnsr::aBB< DataType, SpatialDim, Frame > * > da_goth_g, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::abb< DataType, SpatialDim, Frame > &da_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::a< DataType, SpatialDim, Frame > &da_lapse, const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::a< DataType, SpatialDim, Frame > &da_det_spatial_metric)
 Computes spacetime derivative of \( \mathfrak{g}^{ab}\equiv (-g)^{1/2} g^{ab} \). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aBB< DataType, SpatialDim, Frame > gr::spacetime_deriv_of_goth_g (const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::abb< DataType, SpatialDim, Frame > &da_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::a< DataType, SpatialDim, Frame > &da_lapse, const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::a< DataType, SpatialDim, Frame > &da_det_spatial_metric)
 Computes spacetime derivative of \( \mathfrak{g}^{ab}\equiv (-g)^{1/2} g^{ab} \). More...
 
template<typename DataType , size_t Dim, typename Frame >
void gr::spacetime_metric (gsl::not_null< tnsr::aa< DataType, Dim, Frame > * > spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift, const tnsr::ii< DataType, Dim, Frame > &spatial_metric)
 Computes the spacetime metric from the spatial metric, lapse, and shift. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gr::spacetime_metric (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric)
 Computes the spacetime metric from the spatial metric, lapse, and shift. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::A< DataType, SpatialDim, Frame > gr::spacetime_normal_vector (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift)
 Computes spacetime normal vector from lapse and shift. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::spacetime_normal_vector (gsl::not_null< tnsr::A< DataType, SpatialDim, Frame > * > spacetime_normal_vector, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift)
 Computes spacetime normal vector from lapse and shift. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::spatial_metric (const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric)
 Compute spatial metric from spacetime metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::spatial_metric (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > spatial_metric, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric)
 Compute spatial metric from spacetime metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::time_derivative_of_spacetime_metric (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > dt_spacetime_metric, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric)
 Computes the time derivative of the spacetime metric from spatial metric, lapse, shift, and their time derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gr::time_derivative_of_spacetime_metric (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric)
 Computes the time derivative of the spacetime metric from spatial metric, lapse, shift, and their time derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::time_derivative_of_spatial_metric (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > dt_spatial_metric, 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::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature)
 Computes the time derivative of the spatial metric from extrinsic curvature, lapse, shift, and their time derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::time_derivative_of_spatial_metric (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::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature)
 Computes the time derivative of the spatial metric from extrinsic curvature, lapse, shift, and their time derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::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)
 Computes the electric part of the Weyl tensor in vacuum. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_electric (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > weyl_electric_part, 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)
 Computes the electric part of the Weyl tensor in vacuum. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gr::weyl_electric_scalar (const tnsr::ii< DataType, SpatialDim, Frame > &weyl_electric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_electric_scalar (gsl::not_null< Scalar< DataType > * > weyl_electric_scalar_result, const tnsr::ii< DataType, SpatialDim, Frame > &weyl_electric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\). More...
 
template<typename Frame , typename DataType >
tnsr::ii< DataType, 3, Frame > gr::weyl_magnetic (const tnsr::ijj< DataType, 3, Frame > &grad_extrinsic_curvature, const tnsr::ii< DataType, 3, Frame > &spatial_metric, const Scalar< DataType > &sqrt_det_spatial_metric)
 Computes the magnetic part of the Weyl tensor. More...
 
template<typename Frame , typename DataType >
void gr::weyl_magnetic (gsl::not_null< tnsr::ii< DataType, 3, Frame > * > weyl_magnetic_part, const tnsr::ijj< DataType, 3, Frame > &grad_extrinsic_curvature, const tnsr::ii< DataType, 3, Frame > &spatial_metric, const Scalar< DataType > &sqrt_det_spatial_metric)
 Computes the magnetic part of the Weyl tensor. More...
 
template<typename Frame , typename DataType >
Scalar< DataType > gr::weyl_magnetic_scalar (const tnsr::ii< DataType, 3, Frame > &weyl_magnetic, const tnsr::II< DataType, 3, Frame > &inverse_spatial_metric)
 Computes the scalar \(B_{ij} B^{ij}\) from the magnetic part of the Weyl tensor \(B_{ij}\). More...
 
template<typename Frame , typename DataType >
void gr::weyl_magnetic_scalar (gsl::not_null< Scalar< DataType > * > weyl_magnetic_scalar_result, const tnsr::ii< DataType, 3, Frame > &weyl_magnetic, const tnsr::II< DataType, 3, Frame > &inverse_spatial_metric)
 Computes the scalar \(B_{ij} B^{ij}\) from the magnetic part of the Weyl tensor \(B_{ij}\). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::weyl_propagating (const tnsr::ii< DataType, SpatialDim, Frame > &ricci, const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &cov_deriv_extrinsic_curvature, const tnsr::I< DataType, SpatialDim, Frame > &unit_interface_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &projection_IJ, const tnsr::ii< DataType, SpatialDim, Frame > &projection_ij, const tnsr::Ij< DataType, SpatialDim, Frame > &projection_Ij, const double sign)
 Computes the propagating modes of the Weyl tensor. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_propagating (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > weyl_prop_u8, const tnsr::ii< DataType, SpatialDim, Frame > &ricci, const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &cov_deriv_extrinsic_curvature, const tnsr::I< DataType, SpatialDim, Frame > &unit_interface_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &projection_IJ, const tnsr::ii< DataType, SpatialDim, Frame > &projection_ij, const tnsr::Ij< DataType, SpatialDim, Frame > &projection_Ij, const double sign)
 Computes the propagating modes of the Weyl tensor. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::weyl_type_D1 (const tnsr::ii< DataType, SpatialDim, Frame > &weyl_electric, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Computes a quantity measuring how far from type D spacetime is. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_type_D1 (const gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > weyl_type_D1, const tnsr::ii< DataType, SpatialDim, Frame > &weyl_electric, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Computes a quantity measuring how far from type D spacetime is. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_type_D1_scalar (const gsl::not_null< Scalar< DataType > * > weyl_type_D1_scalar_result, const tnsr::ii< DataType, SpatialDim, Frame > &weyl_type_D1, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Computes the scalar \(D_{ij} D^{ij}\) , a measure of a spacetime's devitation from type D. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gr::weyl_type_D1_scalar (const tnsr::ii< DataType, SpatialDim, Frame > &weyl_type_D1, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric)
 Computes the scalar \(D_{ij} D^{ij}\) , a measure of a spacetime's devitation from type D. More...
 

Detailed Description

Contains functions used in General Relativistic simulations.

Function Documentation

◆ christoffel_first_kind() [1/2]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
tnsr::abb< DataType, SpatialDim, Frame, Index > gr::christoffel_first_kind ( const tnsr::abb< DataType, SpatialDim, Frame, Index > &  d_metric)

Computes Christoffel symbol of the first kind from derivative of metric.

Details

Computes Christoffel symbol \(\Gamma_{abc}\) as: \( \Gamma_{cab} = \frac{1}{2} ( \partial_a g_{bc} + \partial_b g_{ac} - \partial_c g_{ab}) \) where \(g_{bc}\) is either a spatial or spacetime metric

◆ christoffel_first_kind() [2/2]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::christoffel_first_kind ( gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame, Index > * >  christoffel,
const tnsr::abb< DataType, SpatialDim, Frame, Index > &  d_metric 
)

Computes Christoffel symbol of the first kind from derivative of metric.

Details

Computes Christoffel symbol \(\Gamma_{abc}\) as: \( \Gamma_{cab} = \frac{1}{2} ( \partial_a g_{bc} + \partial_b g_{ac} - \partial_c g_{ab}) \) where \(g_{bc}\) is either a spatial or spacetime metric

◆ christoffel_second_kind() [1/4]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::christoffel_second_kind ( const gsl::not_null< tnsr::Abb< DataType, SpatialDim, Frame, Index > * >  christoffel,
const tnsr::abb< DataType, SpatialDim, Frame, Index > &  d_metric,
const tnsr::AA< DataType, SpatialDim, Frame, Index > &  inverse_metric 
)

Computes Christoffel symbol of the second kind from derivative of metric and the inverse metric.

Details

Computes Christoffel symbol \(\Gamma^a_{bc}\) as: \( \Gamma^d_{ab} = \frac{1}{2} g^{cd} (\partial_a g_{bc} + \partial_b g_{ac} - \partial_c g_{ab}) \) where \(g_{bc}\) is either a spatial or spacetime metric.

Avoids the extra memory allocation that occurs by computing the Christoffel symbol of the first kind and then raising the index.

◆ christoffel_second_kind() [2/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::christoffel_second_kind ( const gsl::not_null< tnsr::Ijj< DataType, SpatialDim, Frame > * >  christoffel,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::II< DataType, SpatialDim, Frame > &  inv_metric 
)

Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric.

Details

If \( \Phi_{kab} \) is the generalized harmonic spatial derivative variable \( \Phi_{kab} = \partial_k g_{ab}\) and \(\gamma^{ij}\) is the inverse spatial metric, the Christoffel symbols are

\[ \Gamma^m_{ij} = \frac{1}{2}\gamma^{mk}(\Phi_{ijk}+\Phi_{jik}-\Phi_{kij}). \]

In the not_null version, no memory allocations are performed if the output tensor already has the correct size.

◆ christoffel_second_kind() [3/4]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
auto gr::christoffel_second_kind ( const tnsr::abb< DataType, SpatialDim, Frame, Index > &  d_metric,
const tnsr::AA< DataType, SpatialDim, Frame, Index > &  inverse_metric 
) -> tnsr::Abb< DataType, SpatialDim, Frame, Index >

Computes Christoffel symbol of the second kind from derivative of metric and the inverse metric.

Details

Computes Christoffel symbol \(\Gamma^a_{bc}\) as: \( \Gamma^d_{ab} = \frac{1}{2} g^{cd} (\partial_a g_{bc} + \partial_b g_{ac} - \partial_c g_{ab}) \) where \(g_{bc}\) is either a spatial or spacetime metric.

Avoids the extra memory allocation that occurs by computing the Christoffel symbol of the first kind and then raising the index.

◆ christoffel_second_kind() [4/4]

template<typename DataType , size_t SpatialDim, typename Frame >
auto gh::christoffel_second_kind ( const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::II< DataType, SpatialDim, Frame > &  inv_metric 
) -> tnsr::Ijj< DataType, SpatialDim, Frame >

Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric.

Details

If \( \Phi_{kab} \) is the generalized harmonic spatial derivative variable \( \Phi_{kab} = \partial_k g_{ab}\) and \(\gamma^{ij}\) is the inverse spatial metric, the Christoffel symbols are

\[ \Gamma^m_{ij} = \frac{1}{2}\gamma^{mk}(\Phi_{ijk}+\Phi_{jik}-\Phi_{kij}). \]

In the not_null version, no memory allocations are performed if the output tensor already has the correct size.

◆ covariant_deriv_of_extrinsic_curvature()

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ijj< DataType, SpatialDim, Frame > gh::covariant_deriv_of_extrinsic_curvature ( const tnsr::ii< DataType, SpatialDim, Frame > &  extrinsic_curvature,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal_vector,
const tnsr::Ijj< DataType, SpatialDim, Frame > &  spatial_christoffel_second_kind,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi 
)

Computes the covariant derivative of extrinsic curvature from generalized harmonic variables and the spacetime normal vector.

Details

If \( \Pi_{ab} \) and \( \Phi_{iab} \) are the generalized harmonic conjugate momentum and spatial derivative variables, and if \(n^a\) is the spacetime normal vector, then the extrinsic curvature can be written as

\begin{equation}\label{eq:kij} K_{ij} = \frac{1}{2} \Pi_{ij} + \Phi_{(ij)a} n^a, \end{equation}

and its covariant derivative as

\begin{equation}\label{eq:covkij} \nabla_k K_{ij} = \partial_k K_{ij} - \Gamma^l{}_{ik} K_{lj} - \Gamma^l{}_{jk} K_{li}, \end{equation}

where \(\Gamma^k{}_{ij}\) are Christoffel symbols of the second kind. The partial derivatives of extrinsic curvature can be computed as

\begin{equation}\label{eq:pdkij} \partial_k K_{ij} = \frac{1}{2}\left(\partial_k \Pi_{ij} + \left(\partial_k \Phi_{ija} + \partial_k \Phi_{jia}\right) n^a + \left(\Phi_{ija} + \Phi_{jia}\right) \partial_k n^a \right), \end{equation}

where we have access to all terms except the spatial derivatives of the spacetime unit normal vector \(\partial_k n^a\). Given that \(n^a=(1/\alpha, -\beta^i /\alpha)\), the temporal portion of \(\partial_k n^a\) can be computed as:

\begin{align} \partial_k n^0 =& -\frac{1}{\alpha^2} \partial_k \alpha, \nonumber \\ =& -\frac{1}{\alpha^2} (-\alpha/2) n^a \Phi_{kab} n^b, \nonumber \\ =& \frac{1}{2\alpha} n^a \Phi_{kab} n^b, \nonumber \\ =& \frac{1}{2} n^0 n^a \Phi_{kab} n^b, \nonumber \\ =& -\left(g^{0a} + \frac{1}{2}n^0 n^a\right) \Phi_{kab} n^b, \end{align}

where we use the expression for \(\partial_k \alpha\) from spatial_deriv_of_lapse; while the spatial portion of the same can be computed as:

\begin{align} \partial_k n^i =& -\partial_k (\beta^i/\alpha) = -\frac{1}{\alpha}\partial_k \beta^i + \frac{\beta^i}{\alpha^2}\partial_k \alpha ,\nonumber \\ =& -\frac{1}{2}\frac{\beta^i}{\alpha} n^a\Phi_{kab}n^b -\left(g^{ia} + n^i n^a\right) \Phi_{kab} n^b, \nonumber\\ =& -\left(g^{ia} + \frac{1}{2}n^i n^a\right) \Phi_{kab}n^b, \end{align}

where we use the expression for \(\partial_k \beta^i\) from spatial_deriv_of_shift. Combining the last two equations, we find that

\begin{equation} \partial_k n^a = -\left(g^{ab} + \frac{1}{2}n^a n^b\right)\Phi_{kbc}n^c, \end{equation}

and using Eq.( \(\ref{eq:covkij}\)) and Eq.( \(\ref{eq:pdkij}\)) with this, we can compute the covariant derivative of the extrinsic curvature as:

\begin{equation} \nabla_k K_{ij} = \frac{1}{2}\left(\partial_k \Pi_{ij} + \left(\partial_k \Phi_{ija} + \partial_k \Phi_{jia}\right) n^a - \left(\Phi_{ija} + \Phi_{jia}\right) \left(g^{ab} + \frac{1}{2}n^a n^b\right) \Phi_{kbc}n^c \right) - \Gamma^l{}_{ik} K_{lj} - \Gamma^l{}_{jk} K_{li} \end{equation}

.

◆ deriv_inverse_spatial_metric() [1/2]

template<typename DataType , size_t Dim, typename Frame >
void gr::deriv_inverse_spatial_metric ( const gsl::not_null< tnsr::iJJ< DataType, Dim, Frame > * >  result,
const tnsr::II< DataType, Dim, Frame > &  inverse_spatial_metric,
const tnsr::ijj< DataType, Dim, Frame > &  d_spatial_metric 
)

Computes the spatial derivative of the inverse spatial metric from the inverse spatial metric and the spatial derivative of the spatial metric.

Details

Computes the derivative as:

\begin{align} \partial_k \gamma^{ij} &= -\gamma^{in} \gamma^{mj} \partial_k \gamma_{nm} \end{align}

where \(\gamma^{ij}\) and \(\partial_k \gamma_{ij}\) are the inverse spatial metric and spatial derivative of the spatial metric, respectively.

◆ deriv_inverse_spatial_metric() [2/2]

template<typename DataType , size_t Dim, typename Frame >
tnsr::iJJ< DataType, Dim, Frame > gr::deriv_inverse_spatial_metric ( const tnsr::II< DataType, Dim, Frame > &  inverse_spatial_metric,
const tnsr::ijj< DataType, Dim, Frame > &  d_spatial_metric 
)

Computes the spatial derivative of the inverse spatial metric from the inverse spatial metric and the spatial derivative of the spatial metric.

Details

Computes the derivative as:

\begin{align} \partial_k \gamma^{ij} &= -\gamma^{in} \gamma^{mj} \partial_k \gamma_{nm} \end{align}

where \(\gamma^{ij}\) and \(\partial_k \gamma_{ij}\) are the inverse spatial metric and spatial derivative of the spatial metric, respectively.

◆ deriv_spatial_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ijj< DataType, SpatialDim, Frame > gh::deriv_spatial_metric ( const tnsr::iaa< DataType, SpatialDim, Frame > &  phi)

Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable.

Details

If \( \Phi_{kab} \) is the generalized harmonic spatial derivative variable, then the derivatives of the spatial metric are

\[ \partial_k \gamma_{ij} = \Phi_{kij} \]

This quantity is needed for computing spatial Christoffel symbols.

◆ deriv_spatial_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::deriv_spatial_metric ( gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > * >  d_spatial_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable.

Details

If \( \Phi_{kab} \) is the generalized harmonic spatial derivative variable, then the derivatives of the spatial metric are

\[ \partial_k \gamma_{ij} = \Phi_{kij} \]

This quantity is needed for computing spatial Christoffel symbols.

◆ derivatives_of_spacetime_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::abb< DataType, SpatialDim, Frame > gr::derivatives_of_spacetime_metric ( const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::i< DataType, SpatialDim, Frame > &  deriv_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_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 
)

Computes spacetime derivative of spacetime metric from spatial metric, lapse, shift, and their space and time derivatives.

Details

Computes the derivatives as:

\begin{align} \partial_\mu g_{tt} &= - 2 \alpha \partial_\mu \alpha + 2 \gamma_{mn} \beta^m \partial_\mu \beta^n + \beta^m \beta^n \partial_\mu \gamma_{mn} \\ \partial_\mu g_{ti} &= \gamma_{mi} \partial_\mu \beta^m + \beta^m \partial_\mu \gamma_{mi} \\ \partial_\mu g_{ij} &= \partial_\mu \gamma_{ij} \end{align}

where \( \alpha, \beta^i, \gamma_{ij} \) are the lapse, shift, and spatial metric respectively.

◆ derivatives_of_spacetime_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::derivatives_of_spacetime_metric ( gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame > * >  spacetime_deriv_spacetime_metric,
const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::i< DataType, SpatialDim, Frame > &  deriv_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_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 
)

Computes spacetime derivative of spacetime metric from spatial metric, lapse, shift, and their space and time derivatives.

Details

Computes the derivatives as:

\begin{align} \partial_\mu g_{tt} &= - 2 \alpha \partial_\mu \alpha + 2 \gamma_{mn} \beta^m \partial_\mu \beta^n + \beta^m \beta^n \partial_\mu \gamma_{mn} \\ \partial_\mu g_{ti} &= \gamma_{mi} \partial_\mu \beta^m + \beta^m \partial_\mu \gamma_{mi} \\ \partial_\mu g_{ij} &= \partial_\mu \gamma_{ij} \end{align}

where \( \alpha, \beta^i, \gamma_{ij} \) are the lapse, shift, and spatial metric respectively.

◆ divergence_lapse() [1/2]

template<typename DataType , size_t Dim, typename Frame >
void Ccz4::divergence_lapse ( const gsl::not_null< Scalar< DataType > * >  result,
const Scalar< DataType > &  conformal_factor_squared,
const tnsr::II< DataType, Dim, Frame > &  inverse_conformal_metric,
const tnsr::ij< DataType, Dim, Frame > &  grad_grad_lapse 
)

Computes the divergence of the lapse.

Details

Computes the divergence as:

\begin{align} \nabla^i \nabla_i \alpha &= \phi^2 \tilde{\gamma}^{ij} (\nabla_i \nabla_j \alpha) \end{align}

where \(\phi\), \(\tilde{\gamma}^{ij}\), and \(\nabla_i \nabla_j \alpha\) are the conformal factor, inverse conformal spatial metric, and the gradient of the gradient of the lapse defined by Ccz4::Tags::ConformalFactor, Ccz4::Tags::InverseConformalMetric, and Ccz4::Tags::GradGradLapse, respectively.

◆ divergence_lapse() [2/2]

template<typename DataType , size_t Dim, typename Frame >
Scalar< DataType > Ccz4::divergence_lapse ( const Scalar< DataType > &  conformal_factor_squared,
const tnsr::II< DataType, Dim, Frame > &  inverse_conformal_metric,
const tnsr::ij< DataType, Dim, Frame > &  grad_grad_lapse 
)

Computes the divergence of the lapse.

Details

Computes the divergence as:

\begin{align} \nabla^i \nabla_i \alpha &= \phi^2 \tilde{\gamma}^{ij} (\nabla_i \nabla_j \alpha) \end{align}

where \(\phi\), \(\tilde{\gamma}^{ij}\), and \(\nabla_i \nabla_j \alpha\) are the conformal factor, inverse conformal spatial metric, and the gradient of the gradient of the lapse defined by Ccz4::Tags::ConformalFactor, Ccz4::Tags::InverseConformalMetric, and Ccz4::Tags::GradGradLapse, respectively.

◆ extrinsic_curvature() [1/4]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::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 
)

Computes extrinsic curvature from metric and derivatives.

Details

Uses the ADM evolution equation for the spatial metric,

\[ K_{ij} = \frac{1}{2 \alpha} \left ( -\partial_0 \gamma_{ij} + \beta^k \partial_k \gamma_{ij} + \gamma_{ki} \partial_j \beta^k + \gamma_{kj} \partial_i \beta^k \right ) \]

where \(K_{ij}\) is the extrinsic curvature, \(\alpha\) is the lapse, \(\beta^i\) is the shift, and \(\gamma_{ij}\) is the spatial metric. In terms of the Lie derivative of the spatial metric with respect to a unit timelike vector \(n^a\) normal to the spatial slice, this corresponds to the sign convention

\[ K_{ab} = - \frac{1}{2} \mathcal{L}_{\mathbf{n}} \gamma_{ab} \]

where \(\gamma_{ab}\) is the spatial metric. See Eq. (2.53) in [13].

◆ extrinsic_curvature() [2/4]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gh::extrinsic_curvature ( const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector.

Details

If \( \Pi_{ab} \) and \( \Phi_{iab} \) are the generalized harmonic conjugate momentum and spatial derivative variables, and if \(n^a\) is the spacetime normal vector, then the extrinsic curvature is computed as

\begin{align} K_{ij} &= \frac{1}{2} \Pi_{ij} + \Phi_{(ij)a} n^a \end{align}

◆ extrinsic_curvature() [3/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::extrinsic_curvature ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  ex_curv,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector.

Details

If \( \Pi_{ab} \) and \( \Phi_{iab} \) are the generalized harmonic conjugate momentum and spatial derivative variables, and if \(n^a\) is the spacetime normal vector, then the extrinsic curvature is computed as

\begin{align} K_{ij} &= \frac{1}{2} \Pi_{ij} + \Phi_{(ij)a} n^a \end{align}

◆ extrinsic_curvature() [4/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::extrinsic_curvature ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  ex_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 
)

Computes extrinsic curvature from metric and derivatives.

Details

Uses the ADM evolution equation for the spatial metric,

\[ K_{ij} = \frac{1}{2 \alpha} \left ( -\partial_0 \gamma_{ij} + \beta^k \partial_k \gamma_{ij} + \gamma_{ki} \partial_j \beta^k + \gamma_{kj} \partial_i \beta^k \right ) \]

where \(K_{ij}\) is the extrinsic curvature, \(\alpha\) is the lapse, \(\beta^i\) is the shift, and \(\gamma_{ij}\) is the spatial metric. In terms of the Lie derivative of the spatial metric with respect to a unit timelike vector \(n^a\) normal to the spatial slice, this corresponds to the sign convention

\[ K_{ab} = - \frac{1}{2} \mathcal{L}_{\mathbf{n}} \gamma_{ab} \]

where \(\gamma_{ab}\) is the spatial metric. See Eq. (2.53) in [13].

◆ first_index_to_different_frame() [1/2]

template<typename InputTensor , typename DataType , size_t Dim, typename SourceFrame , typename TargetFrame , typename ResultTensor = TensorMetafunctions::prepend_spatial_index< TensorMetafunctions::remove_first_index<InputTensor>, Dim, UpLo::Up, SourceFrame>>
ResultTensor transform::first_index_to_different_frame ( const InputTensor &  input,
const InverseJacobian< DataType, Dim, SourceFrame, TargetFrame > &  inv_jacobian 
)

Transforms only the first index to different frame.

Examples for transforming some tensors

Flux vector to logical coordinates

A common example is taking the divergence of a flux vector \(F^i\), where the index \(i\) is in inertial coordinates \(x^i\) and the divergence is taken in logical coordinates \(\xi^\hat{i}\). So to transform the flux vector to logical coordinates before taking the divergence we do this:

\begin{align} F^\hat{i} &= F^i \frac{\partial x^\hat{i}}{\partial x^i} \end{align}

Here, \(\frac{\partial x^\hat{i}}{\partial x^i}\) is the inverse Jacobian (see definitions in TypeAliases.hpp).

Currently, this function is tested for any tensor with a first upper spatial index. It can be extended/generalized to other tensor types if needed.

◆ first_index_to_different_frame() [2/2]

template<typename ResultTensor , typename InputTensor , typename DataType , size_t Dim, typename SourceFrame , typename TargetFrame >
void transform::first_index_to_different_frame ( gsl::not_null< ResultTensor * >  result,
const InputTensor &  input,
const InverseJacobian< DataType, Dim, SourceFrame, TargetFrame > &  inv_jacobian 
)

Transforms only the first index to different frame.

Examples for transforming some tensors

Flux vector to logical coordinates

A common example is taking the divergence of a flux vector \(F^i\), where the index \(i\) is in inertial coordinates \(x^i\) and the divergence is taken in logical coordinates \(\xi^\hat{i}\). So to transform the flux vector to logical coordinates before taking the divergence we do this:

\begin{align} F^\hat{i} &= F^i \frac{\partial x^\hat{i}}{\partial x^i} \end{align}

Here, \(\frac{\partial x^\hat{i}}{\partial x^i}\) is the inverse Jacobian (see definitions in TypeAliases.hpp).

Currently, this function is tested for any tensor with a first upper spatial index. It can be extended/generalized to other tensor types if needed.

◆ gauge_source() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::gauge_source ( const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::i< DataType, SpatialDim, Frame > &  deriv_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::iJ< DataType, SpatialDim, Frame > &  deriv_shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const Scalar< DataType > &  trace_extrinsic_curvature,
const tnsr::i< DataType, SpatialDim, Frame > &  trace_christoffel_last_indices 
)

Computes generalized harmonic gauge source function.

Details

If \(\alpha, \beta^i, \gamma_{ij}, \Gamma_{ijk}, K\) are the lapse, shift, spatial metric, spatial Christoffel symbols, and trace of the extrinsic curvature, then we compute

\begin{align} H_l &= \alpha^{-2} \gamma_{il}(\partial_t \beta^i - \beta^k \partial_k \beta^i) + \alpha^{-1} \partial_l \alpha - \gamma^{km}\Gamma_{lkm} \\ H_0 &= -\alpha^{-1} \partial_t \alpha + \alpha^{-1} \beta^k\partial_k \alpha + \beta^k H_k - \alpha K \end{align}

See Eqs. 8 and 9 of [115]

◆ gauge_source() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::gauge_source ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  gauge_source_h,
const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::i< DataType, SpatialDim, Frame > &  deriv_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::iJ< DataType, SpatialDim, Frame > &  deriv_shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const Scalar< DataType > &  trace_extrinsic_curvature,
const tnsr::i< DataType, SpatialDim, Frame > &  trace_christoffel_last_indices 
)

Computes generalized harmonic gauge source function.

Details

If \(\alpha, \beta^i, \gamma_{ij}, \Gamma_{ijk}, K\) are the lapse, shift, spatial metric, spatial Christoffel symbols, and trace of the extrinsic curvature, then we compute

\begin{align} H_l &= \alpha^{-2} \gamma_{il}(\partial_t \beta^i - \beta^k \partial_k \beta^i) + \alpha^{-1} \partial_l \alpha - \gamma^{km}\Gamma_{lkm} \\ H_0 &= -\alpha^{-1} \partial_t \alpha + \alpha^{-1} \beta^k\partial_k \alpha + \beta^k H_k - \alpha K \end{align}

See Eqs. 8 and 9 of [115]

◆ interface_null_normal() [1/2]

template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::a< DataType, VolumeDim, Frame > gr::interface_null_normal ( const tnsr::a< DataType, VolumeDim, Frame > &  spacetime_normal_one_form,
const tnsr::i< DataType, VolumeDim, Frame > &  interface_unit_normal_one_form,
const double  sign 
)

Compute null normal one-form to the boundary of a closed region in a spatial slice of spacetime.

Details

Consider an \(n-1\)-dimensional boundary \(S\) of a closed region in an \(n\)-dimensional spatial hypersurface \(\Sigma\). Let \(s^a\) be the unit spacelike vector orthogonal to \(S\) in \(\Sigma\), and \(n^a\) be the timelike unit vector orthogonal to \(\Sigma\). This function returns the null one-form that is outgoing/incoming on \(S\):

\begin{align*} k_a = \frac{1}{\sqrt{2}}\left(n_a \pm s_a\right). \end{align*}

◆ interface_null_normal() [2/2]

template<typename DataType , size_t VolumeDim, typename Frame >
void gr::interface_null_normal ( gsl::not_null< tnsr::A< DataType, VolumeDim, Frame > * >  null_vector,
const tnsr::A< DataType, VolumeDim, Frame > &  spacetime_normal_vector,
const tnsr::I< DataType, VolumeDim, Frame > &  interface_unit_normal_vector,
const double  sign 
)

Compute null normal vector to the boundary of a closed region in a spatial slice of spacetime.

Details

Consider an \(n-1\)-dimensional boundary \(S\) of a closed region in an \(n\)-dimensional spatial hypersurface \(\Sigma\). Let \(s^a\) be the unit spacelike vector orthogonal to \(S\) in \(\Sigma\), and \(n^a\) be the timelike unit vector orthogonal to \(\Sigma\). This function returns the null vector that is outgoing/ingoing on \(S\):

\begin{align*} k^a = \frac{1}{\sqrt{2}}\left(n^a \pm s^a\right). \end{align*}

◆ inverse_spacetime_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::AA< DataType, SpatialDim, Frame > gr::inverse_spacetime_metric ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Compute inverse spacetime metric from inverse spatial metric, lapse and shift.

Details

The inverse spacetime metric \( g^{ab} \) is calculated as

\begin{align} g^{tt} &= - 1/\alpha^2 \\ g^{ti} &= \beta^i / \alpha^2 \\ g^{ij} &= \gamma^{ij} - \beta^i \beta^j / \alpha^2 \end{align}

where \( \alpha, \beta^i\) and \( \gamma^{ij}\) are the lapse, shift and inverse spatial metric respectively

◆ inverse_spacetime_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::inverse_spacetime_metric ( gsl::not_null< tnsr::AA< DataType, SpatialDim, Frame > * >  inverse_spacetime_metric,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Compute inverse spacetime metric from inverse spatial metric, lapse and shift.

Details

The inverse spacetime metric \( g^{ab} \) is calculated as

\begin{align} g^{tt} &= - 1/\alpha^2 \\ g^{ti} &= \beta^i / \alpha^2 \\ g^{ij} &= \gamma^{ij} - \beta^i \beta^j / \alpha^2 \end{align}

where \( \alpha, \beta^i\) and \( \gamma^{ij}\) are the lapse, shift and inverse spatial metric respectively

◆ lapse() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gr::lapse ( const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric 
)

Compute lapse from shift and spacetime metric.

Details

Computes

\begin{align} \alpha &= \sqrt{\beta^i g_{it}-g_{tt}} \end{align}

where \( \alpha \), \( \beta^i\), and \(g_{ab}\) are the lapse, shift, and spacetime metric. This can be derived, e.g., from Eqs. 2.121–2.122 of Baumgarte & Shapiro.

◆ lapse() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::lapse ( gsl::not_null< Scalar< DataType > * >  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric 
)

Compute lapse from shift and spacetime metric.

Details

Computes

\begin{align} \alpha &= \sqrt{\beta^i g_{it}-g_{tt}} \end{align}

where \( \alpha \), \( \beta^i\), and \(g_{ab}\) are the lapse, shift, and spacetime metric. This can be derived, e.g., from Eqs. 2.121–2.122 of Baumgarte & Shapiro.

◆ phi() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iaa< DataType, SpatialDim, Frame > gh::phi ( const Scalar< DataType > &  lapse,
const tnsr::i< DataType, SpatialDim, Frame > &  deriv_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::ijj< DataType, SpatialDim, Frame > &  deriv_spatial_metric 
)

Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations.

Details

If \( \alpha, \beta^i\) and \( \gamma_{ij} \) are the lapse, shift and spatial metric respectively, then \(\Phi_{iab} \) is computed as

\begin{align} \Phi_{ktt} &= - 2 \alpha \partial_k \alpha + 2 \gamma_{mn} \beta^m \partial_k \beta^n + \beta^m \beta^n \partial_k \gamma_{mn} \\ \Phi_{kti} &= \gamma_{mi} \partial_k \beta^m + \beta^m \partial_k \gamma_{mi} \\ \Phi_{kij} &= \partial_k \gamma_{ij} \end{align}

◆ phi() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::phi ( gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * >  phi,
const Scalar< DataType > &  lapse,
const tnsr::i< DataType, SpatialDim, Frame > &  deriv_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::ijj< DataType, SpatialDim, Frame > &  deriv_spatial_metric 
)

Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations.

Details

If \( \alpha, \beta^i\) and \( \gamma_{ij} \) are the lapse, shift and spatial metric respectively, then \(\Phi_{iab} \) is computed as

\begin{align} \Phi_{ktt} &= - 2 \alpha \partial_k \alpha + 2 \gamma_{mn} \beta^m \partial_k \beta^n + \beta^m \beta^n \partial_k \gamma_{mn} \\ \Phi_{kti} &= \gamma_{mi} \partial_k \beta^m + \beta^m \partial_k \gamma_{mi} \\ \Phi_{kij} &= \partial_k \gamma_{ij} \end{align}

◆ pi() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gh::pi ( const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  dt_spatial_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( g_{ab} \).

Details

If \( \alpha, \beta^i\) are the lapse and shift respectively, and \( \Phi_{iab} = \partial_i g_{ab} \) then \(\Pi_{\mu\nu} = -\frac{1}{\alpha} ( \partial_t g_{\mu\nu} - \beta^m \Phi_{m\mu\nu}) \) where \( \partial_t g_{ab} \) is computed as

\begin{align} \partial_t g_{tt} &= - 2 \alpha \partial_t \alpha + 2 \gamma_{mn} \beta^m \partial_t \beta^n + \beta^m \beta^n \partial_t \gamma_{mn} \\ \partial_t g_{ti} &= \gamma_{mi} \partial_t \beta^m + \beta^m \partial_t \gamma_{mi} \\ \partial_t g_{ij} &= \partial_t \gamma_{ij} \end{align}

◆ pi() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::pi ( gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * >  pi,
const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  dt_spatial_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( g_{ab} \).

Details

If \( \alpha, \beta^i\) are the lapse and shift respectively, and \( \Phi_{iab} = \partial_i g_{ab} \) then \(\Pi_{\mu\nu} = -\frac{1}{\alpha} ( \partial_t g_{\mu\nu} - \beta^m \Phi_{m\mu\nu}) \) where \( \partial_t g_{ab} \) is computed as

\begin{align} \partial_t g_{tt} &= - 2 \alpha \partial_t \alpha + 2 \gamma_{mn} \beta^m \partial_t \beta^n + \beta^m \beta^n \partial_t \gamma_{mn} \\ \partial_t g_{ti} &= \gamma_{mi} \partial_t \beta^m + \beta^m \partial_t \gamma_{mi} \\ \partial_t g_{ij} &= \partial_t \gamma_{ij} \end{align}

◆ psi_4() [1/2]

template<typename Frame >
void gr::psi_4 ( const gsl::not_null< Scalar< ComplexDataVector > * >  psi_4_result,
const tnsr::ii< DataVector, 3, Frame > &  spatial_ricci,
const tnsr::ii< DataVector, 3, Frame > &  extrinsic_curvature,
const tnsr::ijj< DataVector, 3, Frame > &  cov_deriv_extrinsic_curvature,
const tnsr::ii< DataVector, 3, Frame > &  spatial_metric,
const tnsr::II< DataVector, 3, Frame > &  inverse_spatial_metric,
const tnsr::I< DataVector, 3, Frame > &  inertial_coords 
)

Computes Newman Penrose quantity \(\Psi_4\) using the characteristic field U \(^{8+}\) and complex vector \(\bar{m}^i\).

Details

Computes \(\Psi_4\) as: \(\Psi_4 = U^{8+}_{ij}\bar{m}^i\bar{m}^j\) with the characteristic field \(U^{8+} = (P^{(a}_i P^{b)}_j - \frac{1}{2}P_{ij}P^{ab}) (E_{ab} - \epsilon_a^{cd}n_dB_{cb}\)) and \(\bar{m}^i\) = \(\frac{(x^i + iy^i)}{\sqrt{2}}\). \(x^i\) and \(y^i\) are normalized unit vectors in the frame Frame.

◆ psi_4() [2/2]

template<typename Frame >
Scalar< ComplexDataVector > gr::psi_4 ( const tnsr::ii< DataVector, 3, Frame > &  spatial_ricci,
const tnsr::ii< DataVector, 3, Frame > &  extrinsic_curvature,
const tnsr::ijj< DataVector, 3, Frame > &  cov_deriv_extrinsic_curvature,
const tnsr::ii< DataVector, 3, Frame > &  spatial_metric,
const tnsr::II< DataVector, 3, Frame > &  inverse_spatial_metric,
const tnsr::I< DataVector, 3, Frame > &  inertial_coords 
)

Computes Newman Penrose quantity \(\Psi_4\) using the characteristic field U \(^{8+}\) and complex vector \(\bar{m}^i\).

Details

Computes \(\Psi_4\) as: \(\Psi_4 = U^{8+}_{ij}\bar{m}^i\bar{m}^j\) with the characteristic field \(U^{8+} = (P^{(a}_i P^{b)}_j - \frac{1}{2}P_{ij}P^{ab}) (E_{ab} - \epsilon_a^{cd}n_dB_{cb}\)) and \(\bar{m}^i\) = \(\frac{(x^i + iy^i)}{\sqrt{2}}\). \(x^i\) and \(y^i\) are normalized unit vectors in the frame Frame.

◆ raise_or_lower_first_index() [1/2]

template<typename DataType , typename Index0 , typename Index1 >
Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< change_index_up_lo< Index0 >, Index1, Index1 > > raise_or_lower_first_index ( const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &  metric 
)

Raises or lowers the first index of a rank 3 tensor which is symmetric in the last two indices.

Details

If \(T_{abc}\) is a tensor with \(T_{abc} = T_{acb}\) and the indices \(a,b,c,...\) can represent either spatial or spacetime indices, then the tensor \( T^a_{bc} = g^{ad} T_{abc} \) is computed, where \( g^{ab}\) is the inverse metric, which is either a spatial or spacetime metric. If a tensor \( S^a_{bc} \) is passed as an argument than the corresponding tensor \( S_{abc} \) is calculated with respect to the metric \(g_{ab}\). You may have to add a new instantiation of this template if you need a new use case.

◆ raise_or_lower_first_index() [2/2]

template<typename DataType , typename Index0 , typename Index1 >
void raise_or_lower_first_index ( gsl::not_null< Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< change_index_up_lo< Index0 >, Index1, Index1 > > * >  result,
const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &  metric 
)

Raises or lowers the first index of a rank 3 tensor which is symmetric in the last two indices.

Details

If \(T_{abc}\) is a tensor with \(T_{abc} = T_{acb}\) and the indices \(a,b,c,...\) can represent either spatial or spacetime indices, then the tensor \( T^a_{bc} = g^{ad} T_{abc} \) is computed, where \( g^{ab}\) is the inverse metric, which is either a spatial or spacetime metric. If a tensor \( S^a_{bc} \) is passed as an argument than the corresponding tensor \( S_{abc} \) is calculated with respect to the metric \(g_{ab}\). You may have to add a new instantiation of this template if you need a new use case.

◆ raise_or_lower_index() [1/2]

template<typename DataType , typename Index0 >
Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index0 > > > raise_or_lower_index ( const Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &  metric 
)

Raises or lowers the index of a rank 1 tensor.

Details

If \(T_{a}\) is a tensor and the index \(a\) can represent either a spatial or spacetime index, then the tensor \( T^a = g^{ad} T_{d} \) is computed, where \( g^{ab}\) is the inverse metric, which is either a spatial or spacetime metric. If a tensor \( S^a \) is passed as an argument than the corresponding tensor \( S_{a} \) is calculated with respect to the metric \(g_{ab}\).

◆ raise_or_lower_index() [2/2]

template<typename DataType , typename Index0 >
void raise_or_lower_index ( gsl::not_null< Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index0 > > > * >  result,
const Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &  metric 
)

Raises or lowers the index of a rank 1 tensor.

Details

If \(T_{a}\) is a tensor and the index \(a\) can represent either a spatial or spacetime index, then the tensor \( T^a = g^{ad} T_{d} \) is computed, where \( g^{ab}\) is the inverse metric, which is either a spatial or spacetime metric. If a tensor \( S^a \) is passed as an argument than the corresponding tensor \( S_{a} \) is calculated with respect to the metric \(g_{ab}\).

◆ ricci_scalar() [1/2]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::ricci_scalar ( const gsl::not_null< Scalar< DataType > * >  ricci_scalar_result,
const tnsr::aa< DataType, SpatialDim, Frame, Index > &  ricci_tensor,
const tnsr::AA< DataType, SpatialDim, Frame, Index > &  inverse_metric 
)

Computes the Ricci Scalar from the (spatial or spacetime) Ricci Tensor and inverse metrics.

Details

Computes Ricci scalar using the inverse metric (spatial or spacetime) and Ricci tensor \(R = g^{ab}R_{ab}\)

◆ ricci_scalar() [2/2]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
Scalar< DataType > gr::ricci_scalar ( const tnsr::aa< DataType, SpatialDim, Frame, Index > &  ricci_tensor,
const tnsr::AA< DataType, SpatialDim, Frame, Index > &  inverse_metric 
)

Computes the Ricci Scalar from the (spatial or spacetime) Ricci Tensor and inverse metrics.

Details

Computes Ricci scalar using the inverse metric (spatial or spacetime) and Ricci tensor \(R = g^{ab}R_{ab}\)

◆ ricci_tensor() [1/2]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
tnsr::aa< DataType, SpatialDim, Frame, Index > gr::ricci_tensor ( const tnsr::Abb< DataType, SpatialDim, Frame, Index > &  christoffel_2nd_kind,
const tnsr::aBcc< DataType, SpatialDim, Frame, Index > &  d_christoffel_2nd_kind 
)

Computes Ricci tensor from the (spatial or spacetime) Christoffel symbol of the second kind and its derivative.

Details

Computes Ricci tensor \(R_{ab}\) as: \( R_{ab} = \partial_c \Gamma^{c}_{ab} - \partial_{(b} \Gamma^{c}_{a)c} + \Gamma^{d}_{ab}\Gamma^{c}_{cd} - \Gamma^{d}_{ac} \Gamma^{c}_{bd} \) where \(\Gamma^{a}_{bc}\) is the Christoffel symbol of the second kind.

◆ ricci_tensor() [2/2]

template<size_t SpatialDim, typename Frame , IndexType Index, typename DataType >
void gr::ricci_tensor ( gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame, Index > * >  result,
const tnsr::Abb< DataType, SpatialDim, Frame, Index > &  christoffel_2nd_kind,
const tnsr::aBcc< DataType, SpatialDim, Frame, Index > &  d_christoffel_2nd_kind 
)

Computes Ricci tensor from the (spatial or spacetime) Christoffel symbol of the second kind and its derivative.

Details

Computes Ricci tensor \(R_{ab}\) as: \( R_{ab} = \partial_c \Gamma^{c}_{ab} - \partial_{(b} \Gamma^{c}_{a)c} + \Gamma^{d}_{ab}\Gamma^{c}_{cd} - \Gamma^{d}_{ac} \Gamma^{c}_{bd} \) where \(\Gamma^{a}_{bc}\) is the Christoffel symbol of the second kind.

◆ second_time_deriv_of_spacetime_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gh::second_time_deriv_of_spacetime_metric ( const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  dt_phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::aa< DataType, SpatialDim, Frame > &  dt_pi 
)

Computes the second time derivative of the spacetime metric from the generalized harmonic variables, lapse, shift, and the spacetime unit normal 1-form.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \).

Using eq.(35) of [115] (with \(\gamma_1 = -1\)) the first time derivative of the spacetime metric may be expressed in terms of the above variables:

\[ \partial_0 g_{ab} = - \alpha \Pi_{ab} + \beta^k \Phi_{kab} \]

As such, its second time derivative is simply the following:

\[ \partial^2_0 g_{ab} = - (\partial_0 \alpha) \Pi_{ab} - \alpha \partial_0 \Pi_{ab} + (\partial_0 \beta^k) \Phi_{kab} + \beta^k \partial_0 \Phi_{kab} \]

◆ second_time_deriv_of_spacetime_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::second_time_deriv_of_spacetime_metric ( gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * >  d2t2_spacetime_metric,
const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  dt_phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::aa< DataType, SpatialDim, Frame > &  dt_pi 
)

Computes the second time derivative of the spacetime metric from the generalized harmonic variables, lapse, shift, and the spacetime unit normal 1-form.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \).

Using eq.(35) of [115] (with \(\gamma_1 = -1\)) the first time derivative of the spacetime metric may be expressed in terms of the above variables:

\[ \partial_0 g_{ab} = - \alpha \Pi_{ab} + \beta^k \Phi_{kab} \]

As such, its second time derivative is simply the following:

\[ \partial^2_0 g_{ab} = - (\partial_0 \alpha) \Pi_{ab} - \alpha \partial_0 \Pi_{ab} + (\partial_0 \beta^k) \Phi_{kab} + \beta^k \partial_0 \Phi_{kab} \]

◆ shift() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::I< DataType, SpatialDim, Frame > gr::shift ( const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Compute shift from spacetime metric and inverse spatial metric.

Details

Computes

\begin{align} \beta^i &= \gamma^{ij} g_{jt} \end{align}

where \( \beta^i\), \( \gamma^{ij}\), and \(g_{ab}\) are the shift, inverse spatial metric, and spacetime metric. This can be derived, e.g., from Eqs. 2.121–2.122 of Baumgarte & Shapiro.

◆ shift() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::shift ( gsl::not_null< tnsr::I< DataType, SpatialDim, Frame > * >  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Compute shift from spacetime metric and inverse spatial metric.

Details

Computes

\begin{align} \beta^i &= \gamma^{ij} g_{jt} \end{align}

where \( \beta^i\), \( \gamma^{ij}\), and \(g_{ab}\) are the shift, inverse spatial metric, and spacetime metric. This can be derived, e.g., from Eqs. 2.121–2.122 of Baumgarte & Shapiro.

◆ spacetime_deriv_of_det_spatial_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::spacetime_deriv_of_det_spatial_metric ( const Scalar< DataType > &  sqrt_det_spatial_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  dt_spatial_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative.

Details

Using the relation \( \partial_a \gamma = \gamma \gamma^{jk} \partial_a \gamma_{jk} \)

◆ spacetime_deriv_of_det_spatial_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spacetime_deriv_of_det_spatial_metric ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  d4_det_spatial_metric,
const Scalar< DataType > &  sqrt_det_spatial_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  dt_spatial_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative.

Details

Using the relation \( \partial_a \gamma = \gamma \gamma^{jk} \partial_a \gamma_{jk} \)

◆ spacetime_deriv_of_goth_g() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aBB< DataType, SpatialDim, Frame > gr::spacetime_deriv_of_goth_g ( const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::abb< DataType, SpatialDim, Frame > &  da_spacetime_metric,
const Scalar< DataType > &  lapse,
const tnsr::a< DataType, SpatialDim, Frame > &  da_lapse,
const Scalar< DataType > &  sqrt_det_spatial_metric,
const tnsr::a< DataType, SpatialDim, Frame > &  da_det_spatial_metric 
)

Computes spacetime derivative of \( \mathfrak{g}^{ab}\equiv (-g)^{1/2} g^{ab} \).

Details

Computes the spacetime derivative of \( \mathfrak{g}^{ab}\equiv (-g)^{1/2} g^{ab} \), defined in [127]. Using \( (-g)^{1/2} = \alpha (\gamma)^{1/2} \), where \( \alpha \) is the lapse and \( \gamma \) is the determinant of the spatial metric ([13]), the derivative of \( \mathfrak{g}^{ab} \) expands out to

\begin{align} \partial_c \mathfrak{g}^{ab} &= \left[\partial_c \alpha \gamma^{1/2} + \frac{1}{2} \alpha \partial_c \gamma \gamma^{-1/2} \right] g^{ab} - \alpha \gamma^{1/2} g^{ad} g^{be} \partial_c g_{de}. \end{align}

◆ spacetime_deriv_of_goth_g() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::spacetime_deriv_of_goth_g ( gsl::not_null< tnsr::aBB< DataType, SpatialDim, Frame > * >  da_goth_g,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::abb< DataType, SpatialDim, Frame > &  da_spacetime_metric,
const Scalar< DataType > &  lapse,
const tnsr::a< DataType, SpatialDim, Frame > &  da_lapse,
const Scalar< DataType > &  sqrt_det_spatial_metric,
const tnsr::a< DataType, SpatialDim, Frame > &  da_det_spatial_metric 
)

Computes spacetime derivative of \( \mathfrak{g}^{ab}\equiv (-g)^{1/2} g^{ab} \).

Details

Computes the spacetime derivative of \( \mathfrak{g}^{ab}\equiv (-g)^{1/2} g^{ab} \), defined in [127]. Using \( (-g)^{1/2} = \alpha (\gamma)^{1/2} \), where \( \alpha \) is the lapse and \( \gamma \) is the determinant of the spatial metric ([13]), the derivative of \( \mathfrak{g}^{ab} \) expands out to

\begin{align} \partial_c \mathfrak{g}^{ab} &= \left[\partial_c \alpha \gamma^{1/2} + \frac{1}{2} \alpha \partial_c \gamma \gamma^{-1/2} \right] g^{ab} - \alpha \gamma^{1/2} g^{ad} g^{be} \partial_c g_{de}. \end{align}

◆ spacetime_deriv_of_norm_of_shift() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::spacetime_deriv_of_norm_of_shift ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes spacetime derivatives of the norm of the shift vector.

Details

The same is computed as:

\begin{align*} \partial_a (\beta^i \beta_i) = (\beta_i \partial_0 \beta^i + \beta^i \partial_0 \beta_i, \beta_i \partial_j \beta^i + \beta^i \partial_j \beta_i) \end{align*}

◆ spacetime_deriv_of_norm_of_shift() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spacetime_deriv_of_norm_of_shift ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  d4_norm_of_shift,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes spacetime derivatives of the norm of the shift vector.

Details

The same is computed as:

\begin{align*} \partial_a (\beta^i \beta_i) = (\beta_i \partial_0 \beta^i + \beta^i \partial_0 \beta_i, \beta_i \partial_j \beta^i + \beta^i \partial_j \beta_i) \end{align*}

◆ spacetime_derivative_of_spacetime_metric()

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spacetime_derivative_of_spacetime_metric ( gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame > * >  da_spacetime_metric,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the spacetime derivative of the spacetime metric, \(\partial_a g_{bc}\).

\begin{align*} \partial_t g_{ab}&=-\alpha \Pi_{ab} + \beta^i \Phi_{iab} \\ \partial_i g_{ab}&=\Phi_{iab} \end{align*}

◆ spacetime_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gr::spacetime_metric ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric 
)

Computes the spacetime metric from the spatial metric, lapse, and shift.

Details

The spacetime metric \( g_{ab} \) is calculated as

\begin{align} g_{tt} &= - \alpha^2 + \beta^m \beta^n \gamma_{mn} \\ g_{ti} &= \gamma_{mi} \beta^m \\ g_{ij} &= \gamma_{ij} \end{align}

where \( \alpha, \beta^i\) and \( \gamma_{ij}\) are the lapse, shift and spatial metric respectively

◆ spacetime_metric() [2/2]

template<typename DataType , size_t Dim, typename Frame >
void gr::spacetime_metric ( gsl::not_null< tnsr::aa< DataType, Dim, Frame > * >  spacetime_metric,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, Dim, Frame > &  shift,
const tnsr::ii< DataType, Dim, Frame > &  spatial_metric 
)

Computes the spacetime metric from the spatial metric, lapse, and shift.

Details

The spacetime metric \( g_{ab} \) is calculated as

\begin{align} g_{tt} &= - \alpha^2 + \beta^m \beta^n \gamma_{mn} \\ g_{ti} &= \gamma_{mi} \beta^m \\ g_{ij} &= \gamma_{ij} \end{align}

where \( \alpha, \beta^i\) and \( \gamma_{ij}\) are the lapse, shift and spatial metric respectively

◆ spacetime_normal_vector() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::A< DataType, SpatialDim, Frame > gr::spacetime_normal_vector ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift 
)

Computes spacetime normal vector from lapse and shift.

Details

If \(\alpha, \beta^i\) are the lapse and shift respectively, then

\begin{align} n^t &= 1/\alpha \\ n^i &= -\frac{\beta^i}{\alpha} \end{align}

is computed.

◆ spacetime_normal_vector() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::spacetime_normal_vector ( gsl::not_null< tnsr::A< DataType, SpatialDim, Frame > * >  spacetime_normal_vector,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift 
)

Computes spacetime normal vector from lapse and shift.

Details

If \(\alpha, \beta^i\) are the lapse and shift respectively, then

\begin{align} n^t &= 1/\alpha \\ n^i &= -\frac{\beta^i}{\alpha} \end{align}

is computed.

◆ spatial_deriv_of_lapse() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::i< DataType, SpatialDim, Frame > gh::spatial_deriv_of_lapse ( const Scalar< DataType > &  lapse,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spatial derivatives of lapse ( \(\alpha\)) from the generalized harmonic variables and spacetime unit normal 1-form.

Details

If the generalized harmonic conjugate momentum and spatial derivative variables are \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \), the spatial derivatives of \(\alpha\) can be obtained from:

\begin{align*} n^a n^b \Phi_{iab} = -\frac{1}{2\alpha} [\partial_i (-\alpha^2 + \beta_j\beta^j)- 2 \beta^j \partial_i \beta_j + \beta^j \beta^k \partial_i \gamma_{jk}] = -\frac{2}{\alpha} \partial_i \alpha, \end{align*}

since

\[ \partial_i (\beta_j\beta^j) = 2\beta^j \partial_i \beta_j - \beta^j \beta^k \partial_i \gamma_{jk}. \]

\[ \Longrightarrow \partial_i \alpha = -(\alpha/2) n^a \Phi_{iab} n^b \]

◆ spatial_deriv_of_lapse() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spatial_deriv_of_lapse ( gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > * >  deriv_lapse,
const Scalar< DataType > &  lapse,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spatial derivatives of lapse ( \(\alpha\)) from the generalized harmonic variables and spacetime unit normal 1-form.

Details

If the generalized harmonic conjugate momentum and spatial derivative variables are \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \), the spatial derivatives of \(\alpha\) can be obtained from:

\begin{align*} n^a n^b \Phi_{iab} = -\frac{1}{2\alpha} [\partial_i (-\alpha^2 + \beta_j\beta^j)- 2 \beta^j \partial_i \beta_j + \beta^j \beta^k \partial_i \gamma_{jk}] = -\frac{2}{\alpha} \partial_i \alpha, \end{align*}

since

\[ \partial_i (\beta_j\beta^j) = 2\beta^j \partial_i \beta_j - \beta^j \beta^k \partial_i \gamma_{jk}. \]

\[ \Longrightarrow \partial_i \alpha = -(\alpha/2) n^a \Phi_{iab} n^b \]

◆ spatial_deriv_of_shift() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iJ< DataType, SpatialDim, Frame > gh::spatial_deriv_of_shift ( const Scalar< DataType > &  lapse,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables.

Details

Spatial derivatives of the shift vector \(\beta^i\) can be derived from the following steps:

\begin{align*} \partial_i \beta^j =& \gamma^{jl} \gamma_{kl} \partial_i \beta^k \\ =& \gamma^{jl} (\beta^k \partial_i \gamma_{lk} + \gamma_{kl}\partial_i \beta^k - \beta^k \partial_i \gamma_{kl}) \\ =& \gamma^{jl} (\partial_i \beta_l - \beta^k \partial_i \gamma_{lk}) (\because \gamma^{j0} = 0) \\ =& \gamma^{ja} (\partial_i g_{a0} - \beta^k \partial _i g_{ak}) \\ =& \alpha \gamma^{ja} n^b \partial_i g_{ab} \\ =& (\gamma^{ja} - n^j n^a) \alpha n^b \Phi_{iab} - 2 n^j \partial_i \alpha \\ =& g^{ja} \alpha n^b \Phi_{iab} - 2 n^j \partial_i \alpha \\ =& \alpha (g^{ja} + n^j n^a) n^b \Phi_{iab}. \end{align*}

where we used the equation from spatial_deriv_of_lapse() for \(\partial_i \alpha\).

◆ spatial_deriv_of_shift() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::spatial_deriv_of_shift ( gsl::not_null< tnsr::iJ< DataType, SpatialDim, Frame > * >  deriv_shift,
const Scalar< DataType > &  lapse,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables.

Details

Spatial derivatives of the shift vector \(\beta^i\) can be derived from the following steps:

\begin{align*} \partial_i \beta^j =& \gamma^{jl} \gamma_{kl} \partial_i \beta^k \\ =& \gamma^{jl} (\beta^k \partial_i \gamma_{lk} + \gamma_{kl}\partial_i \beta^k - \beta^k \partial_i \gamma_{kl}) \\ =& \gamma^{jl} (\partial_i \beta_l - \beta^k \partial_i \gamma_{lk}) (\because \gamma^{j0} = 0) \\ =& \gamma^{ja} (\partial_i g_{a0} - \beta^k \partial _i g_{ak}) \\ =& \alpha \gamma^{ja} n^b \partial_i g_{ab} \\ =& (\gamma^{ja} - n^j n^a) \alpha n^b \Phi_{iab} - 2 n^j \partial_i \alpha \\ =& g^{ja} \alpha n^b \Phi_{iab} - 2 n^j \partial_i \alpha \\ =& \alpha (g^{ja} + n^j n^a) n^b \Phi_{iab}. \end{align*}

where we used the equation from spatial_deriv_of_lapse() for \(\partial_i \alpha\).

◆ spatial_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::spatial_metric ( const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric)

Compute spatial metric from spacetime metric.

Details

Simply pull out the spatial components.

◆ spatial_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::spatial_metric ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  spatial_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric 
)

Compute spatial metric from spacetime metric.

Details

Simply pull out the spatial components.

◆ spatial_ricci_tensor() [1/2]

template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::ii< DataType, VolumeDim, Frame > gh::spatial_ricci_tensor ( const tnsr::iaa< DataType, VolumeDim, Frame > &  phi,
const tnsr::ijaa< DataType, VolumeDim, Frame > &  deriv_phi,
const tnsr::II< DataType, VolumeDim, Frame > &  inverse_spatial_metric 
)

Compute spatial Ricci tensor using evolved variables and their first derivatives.

Details

Lets write the Christoffel symbols of the first kind as

\begin{align} \Gamma_{kij} = \frac{1}{2}(\partial_i \gamma_{jk} + \partial_j \gamma_{ik} - \partial_k \gamma_{ij}) = (\Phi_{(ij)k} - \frac{1}{2}\Phi_{kij}) \end{align}

substituting \(\partial_k \gamma_{ij}\rightarrow{}\Phi_{kij}\) by subtracting out the three-index constraint \(C_{kij}=\partial_{k}\gamma_{ij}-\Phi_{kij}\) from every term. We also define contractions \(d_k=\frac{1}{2}\gamma^{ij}\Phi_{kij}\) and \(b_k=\frac{1}{2}\gamma^{ij}\Phi_{ijk}\). This allows us to rewrite the spatial Ricci tensor as:

\begin{align} R_{i j} =& \partial_k \Gamma^{k}_{ij} - \partial_i \Gamma^{k}_{kj} + \Gamma^{k}_{kl}\Gamma^{l}_{ij} - \Gamma^{l}_{ki}\Gamma^{k}_{lj},\\ =& \gamma^{kl}\left(\partial_{k}\Phi_{(ij)l} - \frac{1}{2}\partial_{k}\Phi_{lij}\right) - b^{l} (\Phi_{(ij)l} - \frac{1}{2}\Phi_{lij})\nonumber\\ & - \gamma^{kl}\left(\partial_{i}\Phi_{(kj)l} - \frac{1}{2}\partial_{i}\Phi_{lkj}\right) - \Phi_{i}{}^{kl}\left(\Phi_{(kj)l} - \frac{1}{2}\Phi_{lkj} \right)\nonumber\\ & + \gamma^{km}\left(\Phi_{(kl)m} - \frac{1}{2}\Phi_{mkl}\right) \gamma^{ln}\left(\Phi_{(ij)n} - \frac{1}{2}\Phi_{nij}\right) \nonumber\\ & - \gamma^{km}\left(\Phi_{(il)m} - \frac{1}{2}\Phi_{mil}\right) \gamma^{ln}\left(\Phi_{(jk)n} - \frac{1}{2}\Phi_{njk}\right). \end{align}

Gathering all terms with second derivatives:

\begin{align} R_{i j} =& \frac{1}{2} \gamma^{k l} \left(\partial_k\Phi_{ijl} + \partial_k\Phi_{jil} - \partial_k\Phi_{lij} + \partial_i\Phi_{lkj} - \partial_i\Phi_{kjl} - \partial_i\Phi_{jkl}\right) + \mathcal{O}(\Phi), \nonumber\\ =& \frac{1}{2} \gamma^{kl} \left(\partial_{(j}\Phi_{lki)} - \partial_{(j}\Phi_{i)kl} + \partial_k \Phi_{(ij)l} - \partial_l \Phi_{kij} \right) + \mathcal{O}(\Phi), \end{align}

where we use the four-index constraint \(C_{klij}=\partial_k\Phi_{lij}-\partial_l\Phi_{kij}=0\) to swap the first and second derivatives of the spatial metric, and symmetrize \(R_{ij} = R_{(ij)}\). Similarly gathering the remaining terms and using the four-index constraint we get:

\begin{align} R_{i j} =& - b^k\left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) -\frac{1}{2} \Phi_i{}^{kl} \left(\Phi_{jkl} + \Phi_{kjl} - \Phi_{lkj}\right)\nonumber\\ &+ \frac{1}{2} d^k \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) - \left(\Phi_{(il)}{}^k - \frac{1}{2} \Phi^k{}_{il}\right) \left(\Phi_{(kj)}{}^l - \frac{1}{2} \Phi^l{}_{kj}\right) + \mathcal{O}(\partial\Phi) \\ =& \frac{1}{2} \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) (d^k - 2 b^k) + \frac{1}{4} \Phi_{ik}{}^l \Phi_{jl}{}^k + \frac{1}{2} \left(\Phi^k{}_{il} \Phi_{kj}{}^l - \Phi^k{}_{li} \Phi^l{}_{kj}\right) + \mathcal{O}(\partial\Phi). \end{align}

Gathering everything together, we compute the spatial Ricci tensor as:

\begin{eqnarray} R_{i j} &=& \frac{1}{2} \gamma^{kl} \left(\partial_{(j|}\Phi_{lk|i)} - \partial_{(j}\Phi_{i)kl} + \partial_k \Phi_{(ij)l} - \partial_l \Phi_{kij}\right)\nonumber\\ &+& \frac{1}{2} \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) (d^k - 2 b^k) + \frac{1}{4} \Phi_{ik}{}^l \Phi_{jl}{}^k + \frac{1}{2} \left(\Phi^k{}_{il} \Phi_{kj}{}^l - \Phi^k{}_{li} \Phi^l{}_{kj}\right). \label{eq:rij} \end{eqnarray}

This follows from equations (2.13) - (2.20) of [98] .

Note that, in code, the mixed-index variables \(\Phi_{ij}{}^k\) and \(\Phi^i{}_{jk}\) in Eq.( \(\ref{eq:rij}\)) are computed with a factor of \(1/2\) and so the last 3 terms in the same equation that are quadratic in these terms occur multiplied by a factor of \(4\).

◆ spatial_ricci_tensor() [2/2]

template<typename DataType , size_t VolumeDim, typename Frame >
void gh::spatial_ricci_tensor ( gsl::not_null< tnsr::ii< DataType, VolumeDim, Frame > * >  ricci,
const tnsr::iaa< DataType, VolumeDim, Frame > &  phi,
const tnsr::ijaa< DataType, VolumeDim, Frame > &  deriv_phi,
const tnsr::II< DataType, VolumeDim, Frame > &  inverse_spatial_metric 
)

Compute spatial Ricci tensor using evolved variables and their first derivatives.

Details

Lets write the Christoffel symbols of the first kind as

\begin{align} \Gamma_{kij} = \frac{1}{2}(\partial_i \gamma_{jk} + \partial_j \gamma_{ik} - \partial_k \gamma_{ij}) = (\Phi_{(ij)k} - \frac{1}{2}\Phi_{kij}) \end{align}

substituting \(\partial_k \gamma_{ij}\rightarrow{}\Phi_{kij}\) by subtracting out the three-index constraint \(C_{kij}=\partial_{k}\gamma_{ij}-\Phi_{kij}\) from every term. We also define contractions \(d_k=\frac{1}{2}\gamma^{ij}\Phi_{kij}\) and \(b_k=\frac{1}{2}\gamma^{ij}\Phi_{ijk}\). This allows us to rewrite the spatial Ricci tensor as:

\begin{align} R_{i j} =& \partial_k \Gamma^{k}_{ij} - \partial_i \Gamma^{k}_{kj} + \Gamma^{k}_{kl}\Gamma^{l}_{ij} - \Gamma^{l}_{ki}\Gamma^{k}_{lj},\\ =& \gamma^{kl}\left(\partial_{k}\Phi_{(ij)l} - \frac{1}{2}\partial_{k}\Phi_{lij}\right) - b^{l} (\Phi_{(ij)l} - \frac{1}{2}\Phi_{lij})\nonumber\\ & - \gamma^{kl}\left(\partial_{i}\Phi_{(kj)l} - \frac{1}{2}\partial_{i}\Phi_{lkj}\right) - \Phi_{i}{}^{kl}\left(\Phi_{(kj)l} - \frac{1}{2}\Phi_{lkj} \right)\nonumber\\ & + \gamma^{km}\left(\Phi_{(kl)m} - \frac{1}{2}\Phi_{mkl}\right) \gamma^{ln}\left(\Phi_{(ij)n} - \frac{1}{2}\Phi_{nij}\right) \nonumber\\ & - \gamma^{km}\left(\Phi_{(il)m} - \frac{1}{2}\Phi_{mil}\right) \gamma^{ln}\left(\Phi_{(jk)n} - \frac{1}{2}\Phi_{njk}\right). \end{align}

Gathering all terms with second derivatives:

\begin{align} R_{i j} =& \frac{1}{2} \gamma^{k l} \left(\partial_k\Phi_{ijl} + \partial_k\Phi_{jil} - \partial_k\Phi_{lij} + \partial_i\Phi_{lkj} - \partial_i\Phi_{kjl} - \partial_i\Phi_{jkl}\right) + \mathcal{O}(\Phi), \nonumber\\ =& \frac{1}{2} \gamma^{kl} \left(\partial_{(j}\Phi_{lki)} - \partial_{(j}\Phi_{i)kl} + \partial_k \Phi_{(ij)l} - \partial_l \Phi_{kij} \right) + \mathcal{O}(\Phi), \end{align}

where we use the four-index constraint \(C_{klij}=\partial_k\Phi_{lij}-\partial_l\Phi_{kij}=0\) to swap the first and second derivatives of the spatial metric, and symmetrize \(R_{ij} = R_{(ij)}\). Similarly gathering the remaining terms and using the four-index constraint we get:

\begin{align} R_{i j} =& - b^k\left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) -\frac{1}{2} \Phi_i{}^{kl} \left(\Phi_{jkl} + \Phi_{kjl} - \Phi_{lkj}\right)\nonumber\\ &+ \frac{1}{2} d^k \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) - \left(\Phi_{(il)}{}^k - \frac{1}{2} \Phi^k{}_{il}\right) \left(\Phi_{(kj)}{}^l - \frac{1}{2} \Phi^l{}_{kj}\right) + \mathcal{O}(\partial\Phi) \\ =& \frac{1}{2} \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) (d^k - 2 b^k) + \frac{1}{4} \Phi_{ik}{}^l \Phi_{jl}{}^k + \frac{1}{2} \left(\Phi^k{}_{il} \Phi_{kj}{}^l - \Phi^k{}_{li} \Phi^l{}_{kj}\right) + \mathcal{O}(\partial\Phi). \end{align}

Gathering everything together, we compute the spatial Ricci tensor as:

\begin{eqnarray} R_{i j} &=& \frac{1}{2} \gamma^{kl} \left(\partial_{(j|}\Phi_{lk|i)} - \partial_{(j}\Phi_{i)kl} + \partial_k \Phi_{(ij)l} - \partial_l \Phi_{kij}\right)\nonumber\\ &+& \frac{1}{2} \left(\Phi_{ijk} + \Phi_{jik} - \Phi_{kij}\right) (d^k - 2 b^k) + \frac{1}{4} \Phi_{ik}{}^l \Phi_{jl}{}^k + \frac{1}{2} \left(\Phi^k{}_{il} \Phi_{kj}{}^l - \Phi^k{}_{li} \Phi^l{}_{kj}\right). \label{eq:rij} \end{eqnarray}

This follows from equations (2.13) - (2.20) of [98] .

Note that, in code, the mixed-index variables \(\Phi_{ij}{}^k\) and \(\Phi^i{}_{jk}\) in Eq.( \(\ref{eq:rij}\)) are computed with a factor of \(1/2\) and so the last 3 terms in the same equation that are quadratic in these terms occur multiplied by a factor of \(4\).

◆ time_deriv_of_lapse() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gh::time_deriv_of_lapse ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of lapse ( \(\alpha\)) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \), and the operator \(D := \partial_0 - \beta^k \partial_k \). The time derivative of \(\alpha\) is then:

\begin{align*} \frac{1}{2} \alpha^2 n^a n^b \Pi_{ab} - \frac{1}{2} \alpha \beta^i n^a n^b \Phi_{iab} =& \frac{1}{2} \alpha^2 n^a n^b n^c \partial_c g_{ab} - \frac{1}{2} \alpha \beta^i (-(2/\alpha) \partial_i \alpha) \\ =& \frac{1}{2} \alpha^2 [ \\ &-(1/\alpha^3) D[\gamma_{jk} \beta^j \beta^k - \alpha^2] \\ &- (\beta^j \beta^k / \alpha^3)D[\gamma_{jk}] \\ &+ 2 (\beta^j / \alpha^3) D[\gamma_{jk} \beta^k] \\ &+ (2 / \alpha^2)(\beta^i \partial_i \alpha)]] \\ =& \frac{1}{2\alpha} [-D[\gamma_{jk}\beta^j\beta^k - \alpha^2] - \beta^j\beta^k D[\gamma_{jk}] + 2\alpha \beta^k\partial_k \alpha + 2\beta^j D[\gamma_{jk}\beta^k]] \\ =& D[\alpha] + \beta^k\partial_k \alpha \\ =& \partial_0 \alpha \end{align*}

where the simplification done for \(\partial_i \alpha\) is used to substitute for the second term ( \(\frac{1}{2} \alpha \beta^i n^a n^b \Phi_{iab}\)).

Thus,

\[ \partial_0 \alpha = (\alpha/2)(\alpha n^a n^b \Pi_{ab} - \beta^i n^a n^b \Phi_{iab}) \]

◆ time_deriv_of_lapse() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_lapse ( gsl::not_null< Scalar< DataType > * >  dt_lapse,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of lapse ( \(\alpha\)) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \), and the operator \(D := \partial_0 - \beta^k \partial_k \). The time derivative of \(\alpha\) is then:

\begin{align*} \frac{1}{2} \alpha^2 n^a n^b \Pi_{ab} - \frac{1}{2} \alpha \beta^i n^a n^b \Phi_{iab} =& \frac{1}{2} \alpha^2 n^a n^b n^c \partial_c g_{ab} - \frac{1}{2} \alpha \beta^i (-(2/\alpha) \partial_i \alpha) \\ =& \frac{1}{2} \alpha^2 [ \\ &-(1/\alpha^3) D[\gamma_{jk} \beta^j \beta^k - \alpha^2] \\ &- (\beta^j \beta^k / \alpha^3)D[\gamma_{jk}] \\ &+ 2 (\beta^j / \alpha^3) D[\gamma_{jk} \beta^k] \\ &+ (2 / \alpha^2)(\beta^i \partial_i \alpha)]] \\ =& \frac{1}{2\alpha} [-D[\gamma_{jk}\beta^j\beta^k - \alpha^2] - \beta^j\beta^k D[\gamma_{jk}] + 2\alpha \beta^k\partial_k \alpha + 2\beta^j D[\gamma_{jk}\beta^k]] \\ =& D[\alpha] + \beta^k\partial_k \alpha \\ =& \partial_0 \alpha \end{align*}

where the simplification done for \(\partial_i \alpha\) is used to substitute for the second term ( \(\frac{1}{2} \alpha \beta^i n^a n^b \Phi_{iab}\)).

Thus,

\[ \partial_0 \alpha = (\alpha/2)(\alpha n^a n^b \Pi_{ab} - \beta^i n^a n^b \Phi_{iab}) \]

◆ time_deriv_of_lower_shift() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::i< DataType, SpatialDim, Frame > gh::time_deriv_of_lower_shift ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative.

Details

The time derivative of \( \beta_i \) is given by:

\begin{align*} \partial_0 \beta_i = \gamma_{ij} \partial_0 \beta^j + \beta^j \partial_0 \gamma_{ij} \end{align*}

where the first term is obtained from time_deriv_of_shift(), and the latter is a user input.

◆ time_deriv_of_lower_shift() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_lower_shift ( gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > * >  dt_lower_shift,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative.

Details

The time derivative of \( \beta_i \) is given by:

\begin{align*} \partial_0 \beta_i = \gamma_{ij} \partial_0 \beta^j + \beta^j \partial_0 \gamma_{ij} \end{align*}

where the first term is obtained from time_deriv_of_shift(), and the latter is a user input.

◆ time_deriv_of_shift() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::I< DataType, SpatialDim, Frame > gh::time_deriv_of_shift ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of the shift vector from the generalized harmonic and geometric variables.

Details

The time derivative of \( \beta^i \) can be derived from the following steps:

\begin{align*} \partial_0 \beta^i =& \gamma^{ik} \partial_0 (\gamma_{kj} \beta^j) - \beta^j \gamma^{ik} \partial_0 \gamma_{kj} \\ =& \alpha \gamma^{ik} n^b \partial_0 g_{kb} \\ =& \alpha \gamma^{ik} n^b (\partial_0 - \beta^j\partial_j) g_{kb} + \alpha \gamma^{ik} n^b \beta^j\partial_j g_{kb} \\ =& -\alpha^2 n^b\Pi_{kb} \gamma^{ik} + \alpha \beta^j n^b\Phi_{jkb} \gamma^{ik} \\ =& -\alpha \gamma^{ik} n^b (\alpha \Pi_{kb} - \beta^j \Phi_{jkb}) \\ \end{align*}

◆ time_deriv_of_shift() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_shift ( gsl::not_null< tnsr::I< DataType, SpatialDim, Frame > * >  dt_shift,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_unit_normal,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of the shift vector from the generalized harmonic and geometric variables.

Details

The time derivative of \( \beta^i \) can be derived from the following steps:

\begin{align*} \partial_0 \beta^i =& \gamma^{ik} \partial_0 (\gamma_{kj} \beta^j) - \beta^j \gamma^{ik} \partial_0 \gamma_{kj} \\ =& \alpha \gamma^{ik} n^b \partial_0 g_{kb} \\ =& \alpha \gamma^{ik} n^b (\partial_0 - \beta^j\partial_j) g_{kb} + \alpha \gamma^{ik} n^b \beta^j\partial_j g_{kb} \\ =& -\alpha^2 n^b\Pi_{kb} \gamma^{ik} + \alpha \beta^j n^b\Phi_{jkb} \gamma^{ik} \\ =& -\alpha \gamma^{ik} n^b (\alpha \Pi_{kb} - \beta^j \Phi_{jkb}) \\ \end{align*}

◆ time_deriv_of_spatial_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gh::time_deriv_of_spatial_metric ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of the spatial metric.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \). As \( n_i \equiv 0 \). The time derivative of the spatial metric is given by the time derivative of the spatial sector of the spacetime metric, i.e. \( \partial_0 \gamma_{ij} = \partial_0 g_{ij} \).

To compute the latter, we use the evolution equation for \( g_{ij} \), c.f. eq.(35) of [115] (with \(\gamma_1 = -1\)):

\[ \partial_0 g_{ab} = - \alpha \Pi_{ab} + \beta^k \Phi_{kab} \]

◆ time_deriv_of_spatial_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_deriv_of_spatial_metric ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  dt_spatial_metric,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi 
)

Computes time derivative of the spatial metric.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -n^c \partial_c g_{ab} \) and \(\Phi_{iab} = \partial_i g_{ab} \). As \( n_i \equiv 0 \). The time derivative of the spatial metric is given by the time derivative of the spatial sector of the spacetime metric, i.e. \( \partial_0 \gamma_{ij} = \partial_0 g_{ij} \).

To compute the latter, we use the evolution equation for \( g_{ij} \), c.f. eq.(35) of [115] (with \(\gamma_1 = -1\)):

\[ \partial_0 g_{ab} = - \alpha \Pi_{ab} + \beta^k \Phi_{kab} \]

◆ time_derivative_of_spacetime_metric() [1/4]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gr::time_derivative_of_spacetime_metric ( const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  dt_spatial_metric 
)

Computes the time derivative of the spacetime metric from spatial metric, lapse, shift, and their time derivatives.

Details

Computes the derivative as:

\begin{align} \partial_t g_{tt} &= - 2 \alpha \partial_t \alpha - 2 \gamma_{i j} \beta^i \partial_t \beta^j + \beta^i \beta^j \partial_t \gamma_{i j}\\ \partial_t g_{t i} &= \gamma_{j i} \partial_t \beta^j + \beta^j \partial_t \gamma_{j i}\\ \partial_t g_{i j} &= \partial_t \gamma_{i j}, \end{align}

where \(\alpha, \beta^i, \gamma_{ij}\) are the lapse, shift, and spatial metric respectively.

◆ time_derivative_of_spacetime_metric() [2/4]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > gh::time_derivative_of_spacetime_metric ( const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the time derivative of the spacetime metric from the generalized harmonic quantities \(\Pi_{a b}\), \(\Phi_{i a b}\), and the lapse \(\alpha\) and shift \(\beta^i\).

Details

Computes the derivative as:

\begin{align} \partial_t g_{a b} = \beta^i \Phi_{i a b} - \alpha \Pi_{a b}. \end{align}

◆ time_derivative_of_spacetime_metric() [3/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::time_derivative_of_spacetime_metric ( gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * >  dt_spacetime_metric,
const Scalar< DataType > &  lapse,
const Scalar< DataType > &  dt_lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::I< DataType, SpatialDim, Frame > &  dt_shift,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  dt_spatial_metric 
)

Computes the time derivative of the spacetime metric from spatial metric, lapse, shift, and their time derivatives.

Details

Computes the derivative as:

\begin{align} \partial_t g_{tt} &= - 2 \alpha \partial_t \alpha - 2 \gamma_{i j} \beta^i \partial_t \beta^j + \beta^i \beta^j \partial_t \gamma_{i j}\\ \partial_t g_{t i} &= \gamma_{j i} \partial_t \beta^j + \beta^j \partial_t \gamma_{j i}\\ \partial_t g_{i j} &= \partial_t \gamma_{i j}, \end{align}

where \(\alpha, \beta^i, \gamma_{ij}\) are the lapse, shift, and spatial metric respectively.

◆ time_derivative_of_spacetime_metric() [4/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::time_derivative_of_spacetime_metric ( gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * >  dt_spacetime_metric,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the time derivative of the spacetime metric from the generalized harmonic quantities \(\Pi_{a b}\), \(\Phi_{i a b}\), and the lapse \(\alpha\) and shift \(\beta^i\).

Details

Computes the derivative as:

\begin{align} \partial_t g_{a b} = \beta^i \Phi_{i a b} - \alpha \Pi_{a b}. \end{align}

◆ time_derivative_of_spatial_metric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::time_derivative_of_spatial_metric ( 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::ijj< DataType, SpatialDim, Frame > &  deriv_spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  extrinsic_curvature 
)

Computes the time derivative of the spatial metric from extrinsic curvature, lapse, shift, and their time derivatives.

Details

Computes the derivative as (see e.g. [13], Eq. (2.134)):

\begin{equation} \partial_t \gamma_{ij} = -2 \alpha K_{ij} + 2 \nabla_{(i} \beta_{j)} = -2 \alpha K_{ij} + \beta^k \partial_k \gamma_{ij} + \gamma_{ik} \partial_j \beta^k + \gamma_{jk} \partial_i \beta^k \end{equation}

where \(\alpha\) is the lapse, \(\beta^i\) is the shift, \(\gamma_{ij}\) is the spatial metric and \(K_{ij}\) is the extrinsic curvature.

◆ time_derivative_of_spatial_metric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::time_derivative_of_spatial_metric ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  dt_spatial_metric,
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::ijj< DataType, SpatialDim, Frame > &  deriv_spatial_metric,
const tnsr::ii< DataType, SpatialDim, Frame > &  extrinsic_curvature 
)

Computes the time derivative of the spatial metric from extrinsic curvature, lapse, shift, and their time derivatives.

Details

Computes the derivative as (see e.g. [13], Eq. (2.134)):

\begin{equation} \partial_t \gamma_{ij} = -2 \alpha K_{ij} + 2 \nabla_{(i} \beta_{j)} = -2 \alpha K_{ij} + \beta^k \partial_k \gamma_{ij} + \gamma_{ik} \partial_j \beta^k + \gamma_{jk} \partial_i \beta^k \end{equation}

where \(\alpha\) is the lapse, \(\beta^i\) is the shift, \(\gamma_{ij}\) is the spatial metric and \(K_{ij}\) is the extrinsic curvature.

◆ to_different_frame() [1/6]

template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame ( const gsl::not_null< Scalar< DataType > * >  dest,
const Scalar< DataType > &  src,
const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  jacobian,
const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  inv_jacobian 
)

Transforms a tensor to a different frame.

The tensor being transformed is always assumed to have density zero. In particular Scalar is assumed to be invariant under transformations.

Warning
The jacobian argument is the derivative of the source coordinates with respect to the destination coordinates.

◆ to_different_frame() [2/6]

template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame ( const gsl::not_null< tnsr::I< DataType, VolumeDim, DestFrame > * >  dest,
const tnsr::I< DataType, VolumeDim, SrcFrame > &  src,
const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  jacobian,
const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  inv_jacobian 
)

Transforms a tensor to a different frame.

The tensor being transformed is always assumed to have density zero. In particular Scalar is assumed to be invariant under transformations.

Warning
The jacobian argument is the derivative of the source coordinates with respect to the destination coordinates.

◆ to_different_frame() [3/6]

template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame ( const gsl::not_null< tnsr::ii< DataType, VolumeDim, DestFrame > * >  dest,
const tnsr::ii< DataType, VolumeDim, SrcFrame > &  src,
const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  jacobian 
)

Transforms tensor to different frame.

The formula for transforming \(T_{ij}\) is

\begin{align} T_{\bar{\imath}\bar{\jmath}} &= T_{ij} \frac{\partial x^i}{\partial x^{\bar{\imath}}} \frac{\partial x^j}{\partial x^{\bar{\jmath}}} \end{align}

where \(x^i\) are the source coordinates and \(x^{\bar{\imath}}\) are the destination coordinates.

Note that Jacobian<DestFrame,SrcFrame> is the same type as InverseJacobian<SrcFrame,DestFrame> and represents \(\partial x^i/\partial x^{\bar{\jmath}}\).

◆ to_different_frame() [4/6]

template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame ( const tnsr::I< DataType, VolumeDim, SrcFrame > &  src,
const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  jacobian,
const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  inv_jacobian 
) -> tnsr::I< DataType, VolumeDim, DestFrame >

Transforms a tensor to a different frame.

The tensor being transformed is always assumed to have density zero. In particular Scalar is assumed to be invariant under transformations.

Warning
The jacobian argument is the derivative of the source coordinates with respect to the destination coordinates.

◆ to_different_frame() [5/6]

template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame ( const tnsr::ii< DataType, VolumeDim, SrcFrame > &  src,
const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  jacobian 
) -> tnsr::ii< DataType, VolumeDim, DestFrame >

Transforms tensor to different frame.

The formula for transforming \(T_{ij}\) is

\begin{align} T_{\bar{\imath}\bar{\jmath}} &= T_{ij} \frac{\partial x^i}{\partial x^{\bar{\imath}}} \frac{\partial x^j}{\partial x^{\bar{\jmath}}} \end{align}

where \(x^i\) are the source coordinates and \(x^{\bar{\imath}}\) are the destination coordinates.

Note that Jacobian<DestFrame,SrcFrame> is the same type as InverseJacobian<SrcFrame,DestFrame> and represents \(\partial x^i/\partial x^{\bar{\jmath}}\).

◆ to_different_frame() [6/6]

template<typename DataType , size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame ( Scalar< DataType >  src,
const Jacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  jacobian,
const InverseJacobian< DataType, VolumeDim, DestFrame, SrcFrame > &  inv_jacobian 
) -> Scalar< DataType >

Transforms a tensor to a different frame.

The tensor being transformed is always assumed to have density zero. In particular Scalar is assumed to be invariant under transformations.

Warning
The jacobian argument is the derivative of the source coordinates with respect to the destination coordinates.

◆ trace() [1/2]

template<typename DataType , typename Index0 >
Scalar< DataType > trace ( const Tensor< DataType, Symmetry< 1, 1 >, index_list< Index0, Index0 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &  metric 
)

Computes trace of a rank-2 symmetric tensor.

Details

Computes \(g^{ab}T_{ab}\) or \(g_{ab}T^{ab}\) where \((a,b)\) can be spatial or spacetime indices.

◆ trace() [2/2]

template<typename DataType , typename Index0 >
void trace ( gsl::not_null< Scalar< DataType > * >  trace,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< Index0, Index0 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index0 >, change_index_up_lo< Index0 > > > &  metric 
)

Computes trace of a rank-2 symmetric tensor.

Details

Computes \(g^{ab}T_{ab}\) or \(g_{ab}T^{ab}\) where \((a,b)\) can be spatial or spacetime indices.

◆ trace_last_indices() [1/2]

template<typename DataType , typename Index0 , typename Index1 >
Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > trace_last_indices ( const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index1 >, change_index_up_lo< Index1 > > > &  metric 
)

Computes trace of a rank 3 tensor, which is symmetric in its last two indices, tracing the symmetric indices.

Details

For example, if \( T_{abc} \) is a tensor such that \(T_{abc} = T_{acb} \) then \( T_a = g^{bc}T_{abc} \) is computed, where \( g^{bc} \) is the inverse metric. Note that indices \(a,b,c,...\) can represent either spatial or spacetime indices, and can have either valence. You may have to add a new instantiation of this template if you need a new use case.

◆ trace_last_indices() [2/2]

template<typename DataType , typename Index0 , typename Index1 >
void trace_last_indices ( gsl::not_null< Tensor< DataType, Symmetry< 1 >, index_list< Index0 > > * >  trace_of_tensor,
const Tensor< DataType, Symmetry< 2, 1, 1 >, index_list< Index0, Index1, Index1 > > &  tensor,
const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index1 >, change_index_up_lo< Index1 > > > &  metric 
)

Computes trace of a rank 3 tensor, which is symmetric in its last two indices, tracing the symmetric indices.

Details

For example, if \( T_{abc} \) is a tensor such that \(T_{abc} = T_{acb} \) then \( T_a = g^{bc}T_{abc} \) is computed, where \( g^{bc} \) is the inverse metric. Note that indices \(a,b,c,...\) can represent either spatial or spacetime indices, and can have either valence. You may have to add a new instantiation of this template if you need a new use case.

◆ transverse_projection_operator() [1/6]

template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::Ab< DataType, VolumeDim, Frame > gr::transverse_projection_operator ( const tnsr::A< DataType, VolumeDim, Frame > &  spacetime_normal_vector,
const tnsr::a< DataType, VolumeDim, Frame > &  spacetime_normal_one_form,
const tnsr::I< DataType, VolumeDim, Frame > &  interface_unit_normal_vector,
const tnsr::i< DataType, VolumeDim, Frame > &  interface_unit_normal_one_form 
)

Compute spacetime projection operator onto an interface.

Details

Consider a \(d-1\)-dimensional surface \(S\) in a \(d\)-dimensional spatial hypersurface \(\Sigma\). Let \(s^a\) \((s_a)\) be the unit spacelike vector (one-form) orthogonal to \(S\) in \(\Sigma\), and \(n^a\) \((n_a)\) be the timelike unit vector (one-form) orthogonal to \(\Sigma\). This function returns the projection operator onto \(S\) for \(d+1\) dimensional quantities:

\begin{align*} P^a_b = \delta^a_b + n^a n_b - s^a s_b. \end{align*}

◆ transverse_projection_operator() [2/6]

template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::aa< DataType, VolumeDim, Frame > gr::transverse_projection_operator ( const tnsr::aa< DataType, VolumeDim, Frame > &  spacetime_metric,
const tnsr::a< DataType, VolumeDim, Frame > &  spacetime_normal_one_form,
const tnsr::i< DataType, VolumeDim, Frame > &  interface_unit_normal_one_form 
)

Compute spacetime projection operator onto an interface.

Details

Consider a \(d-1\)-dimensional surface \(S\) in a \(d\)-dimensional spatial hypersurface \(\Sigma\). Let \(s_a\) be the unit spacelike one-form orthogonal to \(S\) in \(\Sigma\), and \(n_a\) be the timelike unit vector orthogonal to \(\Sigma\). This function returns the projection operator onto \(S\) for \(d+1\) dimensional quantities:

\begin{align*} P_{ab} = g_{ab} + n_a n_b - s_a s_b = \gamma_{ab} - s_a s_b. \end{align*}

◆ transverse_projection_operator() [3/6]

template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::II< DataType, VolumeDim, Frame > gr::transverse_projection_operator ( const tnsr::II< DataType, VolumeDim, Frame > &  inverse_spatial_metric,
const tnsr::I< DataType, VolumeDim, Frame > &  normal_vector 
)

Compute projection operator onto an interface.

Details

Returns the operator \(P^{ij} = \gamma^{ij} - n^i n^j\), where \(\gamma^{ij}\) is the inverse spatial metric, and \(n^i\) is the normal vector to the interface in question.

◆ transverse_projection_operator() [4/6]

template<typename DataType , size_t VolumeDim, typename Frame >
void gr::transverse_projection_operator ( gsl::not_null< tnsr::AA< DataType, VolumeDim, Frame > * >  projection_tensor,
const tnsr::AA< DataType, VolumeDim, Frame > &  inverse_spacetime_metric,
const tnsr::A< DataType, VolumeDim, Frame > &  spacetime_normal_vector,
const tnsr::I< DataType, VolumeDim, Frame > &  interface_unit_normal_vector 
)

Compute spacetime projection operator onto an interface.

Details

Consider a \(d-1\)-dimensional surface \(S\) in a \(d\)-dimensional spatial hypersurface \(\Sigma\). Let \(s^a\) be the unit spacelike vector orthogonal to \(S\) in \(\Sigma\), and \(n^a\) be the timelike unit vector orthogonal to \(\Sigma\). This function returns the projection operator onto \(S\) for \(d+1\) dimensional quantities:

\begin{align*} P^{ab} = g^{ab} + n^a n^b - s^a s^b = \gamma_{ab} - s_a s_b. \end{align*}

◆ transverse_projection_operator() [5/6]

template<typename DataType , size_t VolumeDim, typename Frame >
void gr::transverse_projection_operator ( gsl::not_null< tnsr::Ab< DataType, VolumeDim, Frame > * >  projection_tensor,
const tnsr::A< DataType, VolumeDim, Frame > &  spacetime_normal_vector,
const tnsr::a< DataType, VolumeDim, Frame > &  spacetime_normal_one_form,
const tnsr::I< DataType, VolumeDim, Frame > &  interface_unit_normal_vector,
const tnsr::i< DataType, VolumeDim, Frame > &  interface_unit_normal_one_form 
)

Compute spacetime projection operator onto an interface.

Details

Consider a \(d-1\)-dimensional surface \(S\) in a \(d\)-dimensional spatial hypersurface \(\Sigma\). Let \(s^a\) \((s_a)\) be the unit spacelike vector (one-form) orthogonal to \(S\) in \(\Sigma\), and \(n^a\) \((n_a)\) be the timelike unit vector (one-form) orthogonal to \(\Sigma\). This function returns the projection operator onto \(S\) for \(d+1\) dimensional quantities:

\begin{align*} P^a_b = \delta^a_b + n^a n_b - s^a s_b. \end{align*}

◆ transverse_projection_operator() [6/6]

template<typename DataType , size_t VolumeDim, typename Frame >
void gr::transverse_projection_operator ( gsl::not_null< tnsr::ii< DataType, VolumeDim, Frame > * >  projection_tensor,
const tnsr::ii< DataType, VolumeDim, Frame > &  spatial_metric,
const tnsr::i< DataType, VolumeDim, Frame > &  normal_one_form 
)

Compute projection operator onto an interface.

Details

Returns the operator \(P_{ij} = \gamma_{ij} - n_i n_j\), where \( \gamma_{ij}\) is the spatial metric, and \( n_i\) is the normal one-form to the interface in question.

Details

Returns the operator \(P^{i}_{j} = \delta^{i}_{j} - n^i n_j\), where \(n^i\) and \(n_i\) are the normal vector and normal one-form to the interface in question.

◆ weyl_electric() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::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 
)

Computes the electric part of the Weyl tensor in vacuum.

Details

Computes the electric part of the Weyl tensor in vacuum \(E_{ij}\) as: \( E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\) where \(R_{ij}\) is the spatial Ricci tensor, \(K_{ij}\) is the extrinsic curvature, and \(K\) is the trace of \(K_{ij}\). An additional definition is \(E_{ij} = n^a n^b C_{a i b j}\), where \(n\) is the unit-normal to the hypersurface and \(C\) is the Weyl tensor consistent with the conventions in [25].

Note
This needs additional terms for computations in a non-vacuum.

◆ weyl_electric() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_electric ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  weyl_electric_part,
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 
)

Computes the electric part of the Weyl tensor in vacuum.

Details

Computes the electric part of the Weyl tensor in vacuum \(E_{ij}\) as: \( E_{ij} = R_{ij} + KK_{ij} - K^m_{i}K_{mj}\) where \(R_{ij}\) is the spatial Ricci tensor, \(K_{ij}\) is the extrinsic curvature, and \(K\) is the trace of \(K_{ij}\). An additional definition is \(E_{ij} = n^a n^b C_{a i b j}\), where \(n\) is the unit-normal to the hypersurface and \(C\) is the Weyl tensor consistent with the conventions in [25].

Note
This needs additional terms for computations in a non-vacuum.

◆ weyl_electric_scalar() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gr::weyl_electric_scalar ( const tnsr::ii< DataType, SpatialDim, Frame > &  weyl_electric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\).

Details

Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\) and the inverse spatial metric \(\gamma^{ij}\), i.e. \(E_{ij} = \gamma^{ik}\gamma^{jl}E_{ij}E_{kl}\).

Note
The electric part of the Weyl tensor in vacuum is available via gr::weyl_electric(). The electric part of the Weyl tensor needs additional terms for matter.

◆ weyl_electric_scalar() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_electric_scalar ( gsl::not_null< Scalar< DataType > * >  weyl_electric_scalar_result,
const tnsr::ii< DataType, SpatialDim, Frame > &  weyl_electric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\).

Details

Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\) and the inverse spatial metric \(\gamma^{ij}\), i.e. \(E_{ij} = \gamma^{ik}\gamma^{jl}E_{ij}E_{kl}\).

Note
The electric part of the Weyl tensor in vacuum is available via gr::weyl_electric(). The electric part of the Weyl tensor needs additional terms for matter.

◆ weyl_magnetic() [1/2]

template<typename Frame , typename DataType >
tnsr::ii< DataType, 3, Frame > gr::weyl_magnetic ( const tnsr::ijj< DataType, 3, Frame > &  grad_extrinsic_curvature,
const tnsr::ii< DataType, 3, Frame > &  spatial_metric,
const Scalar< DataType > &  sqrt_det_spatial_metric 
)

Computes the magnetic part of the Weyl tensor.

Details

Computes the magnetic part of the Weyl tensor \(B_{ij}\) as:

\begin{align} B_{ij} = \left(1/\sqrt{\det\gamma}\right)D_{k}K_{l(i}\gamma_{j)m}\epsilon^{mlk} \end{align}

where \(\epsilon^{ijk}\) is the spatial Levi-Civita symbol, \(K_{ij}\) is the extrinsic curvature, \(\gamma_{jm} \) is the spatial metric, and \(D_i\) is spatial covariant derivative.

◆ weyl_magnetic() [2/2]

template<typename Frame , typename DataType >
void gr::weyl_magnetic ( gsl::not_null< tnsr::ii< DataType, 3, Frame > * >  weyl_magnetic_part,
const tnsr::ijj< DataType, 3, Frame > &  grad_extrinsic_curvature,
const tnsr::ii< DataType, 3, Frame > &  spatial_metric,
const Scalar< DataType > &  sqrt_det_spatial_metric 
)

Computes the magnetic part of the Weyl tensor.

Details

Computes the magnetic part of the Weyl tensor \(B_{ij}\) as:

\begin{align} B_{ij} = \left(1/\sqrt{\det\gamma}\right)D_{k}K_{l(i}\gamma_{j)m}\epsilon^{mlk} \end{align}

where \(\epsilon^{ijk}\) is the spatial Levi-Civita symbol, \(K_{ij}\) is the extrinsic curvature, \(\gamma_{jm} \) is the spatial metric, and \(D_i\) is spatial covariant derivative.

◆ weyl_magnetic_scalar() [1/2]

template<typename Frame , typename DataType >
Scalar< DataType > gr::weyl_magnetic_scalar ( const tnsr::ii< DataType, 3, Frame > &  weyl_magnetic,
const tnsr::II< DataType, 3, Frame > &  inverse_spatial_metric 
)

Computes the scalar \(B_{ij} B^{ij}\) from the magnetic part of the Weyl tensor \(B_{ij}\).

Details

Computes the scalar \(B_{ij} B^{ij}\) from the magnetic part of the Weyl tensor \(B_{ij}\) and the inverse spatial metric \(\gamma^{ij}\), i.e. \(B_{ij} = \gamma^{ik}\gamma^{jl}B_{ij}B_{kl}\).

Note
The magnetic part of the Weyl tensor in vacuum is available via gr::weyl_magnetic(). The magnetic part of the Weyl tensor needs additional terms for matter.

◆ weyl_magnetic_scalar() [2/2]

template<typename Frame , typename DataType >
void gr::weyl_magnetic_scalar ( gsl::not_null< Scalar< DataType > * >  weyl_magnetic_scalar_result,
const tnsr::ii< DataType, 3, Frame > &  weyl_magnetic,
const tnsr::II< DataType, 3, Frame > &  inverse_spatial_metric 
)

Computes the scalar \(B_{ij} B^{ij}\) from the magnetic part of the Weyl tensor \(B_{ij}\).

Details

Computes the scalar \(B_{ij} B^{ij}\) from the magnetic part of the Weyl tensor \(B_{ij}\) and the inverse spatial metric \(\gamma^{ij}\), i.e. \(B_{ij} = \gamma^{ik}\gamma^{jl}B_{ij}B_{kl}\).

Note
The magnetic part of the Weyl tensor in vacuum is available via gr::weyl_magnetic(). The magnetic part of the Weyl tensor needs additional terms for matter.

◆ weyl_propagating() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::weyl_propagating ( const tnsr::ii< DataType, SpatialDim, Frame > &  ricci,
const tnsr::ii< DataType, SpatialDim, Frame > &  extrinsic_curvature,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::ijj< DataType, SpatialDim, Frame > &  cov_deriv_extrinsic_curvature,
const tnsr::I< DataType, SpatialDim, Frame > &  unit_interface_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  projection_IJ,
const tnsr::ii< DataType, SpatialDim, Frame > &  projection_ij,
const tnsr::Ij< DataType, SpatialDim, Frame > &  projection_Ij,
const double  sign 
)

Computes the propagating modes of the Weyl tensor.

Details

The Weyl tensor evolution system in vacuum has six characteristic fields, of which two ( \( U^{8\pm}\)) are proportional to the Newman-Penrose components of the Weyl tensor \(\Psi_4\) and \(\Psi_0\). These represent the true gravitational-wave degrees of freedom, and can be written down in terms of \(3+1\) quantities as [99] (see Eq. 75):

\begin{align} U^{8\pm}_{ij} &= \left(P^{k}_i P^{l}_j - \frac{1}{2} P_{ij} P^{kl}\right) \left(R_{kl} + K K_{kl} - K_k^m K_{ml} \mp n^m \nabla_m K_{kl} \pm n^m \nabla_{(k}K_{l)m} \right),\\ &= \left(P^{k}_i P^{l}_j - \frac{1}{2} P_{ij} P^{kl}\right) \left(E_{kl} \mp n^m \nabla_m K_{kl} \pm n^m \nabla_{(k}K_{l)m}\right), \end{align}

where \(R_{ij}\) is the spatial Ricci tensor, \(K_{ij}\) is the extrinsic curvature, \(K\) is the trace of \(K_{ij}\), \(E_{ij}\) is the electric part of the Weyl tensor in vacuum, \(n^i\) is the outward directed unit normal vector to the interface, \(\nabla_i\) denotes the covariant derivative, and \(P^{ij}\) and its index-raised and lowered forms project tensors transverse to \(n^i\).

◆ weyl_propagating() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_propagating ( gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  weyl_prop_u8,
const tnsr::ii< DataType, SpatialDim, Frame > &  ricci,
const tnsr::ii< DataType, SpatialDim, Frame > &  extrinsic_curvature,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::ijj< DataType, SpatialDim, Frame > &  cov_deriv_extrinsic_curvature,
const tnsr::I< DataType, SpatialDim, Frame > &  unit_interface_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  projection_IJ,
const tnsr::ii< DataType, SpatialDim, Frame > &  projection_ij,
const tnsr::Ij< DataType, SpatialDim, Frame > &  projection_Ij,
const double  sign 
)

Computes the propagating modes of the Weyl tensor.

Details

The Weyl tensor evolution system in vacuum has six characteristic fields, of which two ( \( U^{8\pm}\)) are proportional to the Newman-Penrose components of the Weyl tensor \(\Psi_4\) and \(\Psi_0\). These represent the true gravitational-wave degrees of freedom, and can be written down in terms of \(3+1\) quantities as [99] (see Eq. 75):

\begin{align} U^{8\pm}_{ij} &= \left(P^{k}_i P^{l}_j - \frac{1}{2} P_{ij} P^{kl}\right) \left(R_{kl} + K K_{kl} - K_k^m K_{ml} \mp n^m \nabla_m K_{kl} \pm n^m \nabla_{(k}K_{l)m} \right),\\ &= \left(P^{k}_i P^{l}_j - \frac{1}{2} P_{ij} P^{kl}\right) \left(E_{kl} \mp n^m \nabla_m K_{kl} \pm n^m \nabla_{(k}K_{l)m}\right), \end{align}

where \(R_{ij}\) is the spatial Ricci tensor, \(K_{ij}\) is the extrinsic curvature, \(K\) is the trace of \(K_{ij}\), \(E_{ij}\) is the electric part of the Weyl tensor in vacuum, \(n^i\) is the outward directed unit normal vector to the interface, \(\nabla_i\) denotes the covariant derivative, and \(P^{ij}\) and its index-raised and lowered forms project tensors transverse to \(n^i\).

◆ weyl_type_D1() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_type_D1 ( const gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * >  weyl_type_D1,
const tnsr::ii< DataType, SpatialDim, Frame > &  weyl_electric,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Computes a quantity measuring how far from type D spacetime is.

Details

Computes a quantity measuring how far from type D spacetime is, using measure D1 [Eq. (8) of [19]]:

\begin{align} \frac{a}{12} \gamma_{ij} - \frac{b}{a} E_{ij} - 4 E_{i}^{k} E_{jk} = 0 \end{align}

where \(\gamma_{ij}\) is the spatial metric and \(E_{ij}\) is the electric part ofthe Weyl tensor.

◆ weyl_type_D1() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > gr::weyl_type_D1 ( const tnsr::ii< DataType, SpatialDim, Frame > &  weyl_electric,
const tnsr::ii< DataType, SpatialDim, Frame > &  spatial_metric,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Computes a quantity measuring how far from type D spacetime is.

Details

Computes a quantity measuring how far from type D spacetime is, using measure D1 [Eq. (8) of [19]]:

\begin{align} \frac{a}{12} \gamma_{ij} - \frac{b}{a} E_{ij} - 4 E_{i}^{k} E_{jk} = 0 \end{align}

where \(\gamma_{ij}\) is the spatial metric and \(E_{ij}\) is the electric part ofthe Weyl tensor.

◆ weyl_type_D1_scalar() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gr::weyl_type_D1_scalar ( const gsl::not_null< Scalar< DataType > * >  weyl_type_D1_scalar_result,
const tnsr::ii< DataType, SpatialDim, Frame > &  weyl_type_D1,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Computes the scalar \(D_{ij} D^{ij}\) , a measure of a spacetime's devitation from type D.

Details

Computes the scalar \(D_{ij} D^{ij}\) from \(D_{ij}\) (Eq. (8) of [19]] and the inverse spatial metric \(\gamma^{ij}\), i.e. \(D = \gamma^{ik}\gamma^{jl}D_{ij}D_{kl}\).

Note
The Weyl Type D1 \(D_{ij}\) is available via gr::weyl_type_D1.

◆ weyl_type_D1_scalar() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gr::weyl_type_D1_scalar ( const tnsr::ii< DataType, SpatialDim, Frame > &  weyl_type_D1,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric 
)

Computes the scalar \(D_{ij} D^{ij}\) , a measure of a spacetime's devitation from type D.

Details

Computes the scalar \(D_{ij} D^{ij}\) from \(D_{ij}\) (Eq. (8) of [19]] and the inverse spatial metric \(\gamma^{ij}\), i.e. \(D = \gamma^{ik}\gamma^{jl}D_{ij}D_{kl}\).

Note
The Weyl Type D1 \(D_{ij}\) is available via gr::weyl_type_D1.