SpECTRE  2021.08.02
General Relativity

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

Namespaces

namespace  gr
 Holds functions related to general relativity.
 

Functions

template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::ijj< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes the covariant derivative of extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes the spacetime derivative of the spacetime metric, \(\partial_a g_{bc}\). 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) noexcept
 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) noexcept
 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) noexcept
 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) noexcept -> tnsr::Abb< DataType, SpatialDim, Frame, Index >
 Computes Christoffel symbol of the second kind from derivative of metric and the inverse metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes spacetime derivative of spacetime metric from spatial metric, lapse, shift, and their space and time derivatives. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes spacetime derivative of spacetime metric from spatial metric, lapse, shift, and their space and time derivatives. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes extrinsic curvature from metric and derivatives. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes extrinsic curvature from metric and derivatives. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
auto GeneralizedHarmonic::christoffel_second_kind (const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::II< DataType, SpatialDim, Frame > &inv_metric) noexcept -> 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<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::deriv_spatial_metric (gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > * > d_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
 Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::ijj< DataType, SpatialDim, Frame > GeneralizedHarmonic::deriv_spatial_metric (const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
 Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::ii< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes generalized harmonic gauge source function. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::a< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes generalized harmonic gauge source function. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::iaa< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( \psi_{ab} \). More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::aa< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( \psi_{ab} \). More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Compute spatial Ricci tensor using evolved variables and their first derivatives. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::ii< DataType, VolumeDim, Frame > GeneralizedHarmonic::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) noexcept
 Compute spatial Ricci tensor using evolved variables and their first derivatives. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::a< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes spacetime derivatives of the norm of the shift vector. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::a< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes spacetime derivatives of the norm of the shift vector. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes spatial derivatives of lapse (N) from the generalized harmonic variables and spacetime unit normal 1-form. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::i< DataType, SpatialDim, Frame > GeneralizedHarmonic::spatial_deriv_of_lapse (const Scalar< DataType > &lapse, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi) noexcept
 Computes spatial derivatives of lapse (N) from the generalized harmonic variables and spacetime unit normal 1-form. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::iJ< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 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<size_t SpatialDim, typename Frame , typename DataType >
tnsr::aa< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 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<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes time derivative of lapse (N) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
Scalar< DataType > GeneralizedHarmonic::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) noexcept
 Computes time derivative of lapse (N) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::i< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes time derivative of the shift vector from the generalized harmonic and geometric variables. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::I< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes time derivative of the shift vector from the generalized harmonic and geometric variables. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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) noexcept
 Computes time derivative of the spatial metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::ii< DataType, SpatialDim, Frame > GeneralizedHarmonic::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) noexcept
 Computes time derivative of the spatial metric. More...
 
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) noexcept
 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) noexcept
 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) noexcept
 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) noexcept
 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) noexcept
 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) noexcept
 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) noexcept
 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) noexcept
 Computes trace of a rank-2 symmetric tensor. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute null normal one-form to the boundary of a closed region in a spatial slice of spacetime. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
void gr::interface_null_normal (gsl::not_null< tnsr::a< DataType, VolumeDim, Frame > * > null_one_form, const tnsr::a< DataType, VolumeDim, Frame > &spacetime_normal_one_form, const tnsr::i< DataType, VolumeDim, Frame > &interface_unit_normal_one_form, const double sign) noexcept
 Compute null normal one-form to the boundary of a closed region in a spatial slice of spacetime. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::A< DataType, VolumeDim, Frame > gr::interface_null_normal (const tnsr::A< DataType, VolumeDim, Frame > &spacetime_normal_vector, const tnsr::I< DataType, VolumeDim, Frame > &interface_unit_normal_vector, const double sign) noexcept
 Compute null normal vector to the boundary of a closed region in a spatial slice of spacetime. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute null normal vector to the boundary of a closed region in a spatial slice of spacetime. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Compute inverse spacetime metric from inverse spatial metric, lapse and shift. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Compute inverse spacetime metric from inverse spatial metric, lapse and shift. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
Scalar< DataType > gr::lapse (const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
 Compute lapse from shift and spacetime metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void gr::lapse (gsl::not_null< Scalar< DataType > * > lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
 Compute lapse from shift and spacetime metric. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
void gr::transverse_projection_operator (gsl::not_null< tnsr::II< DataType, VolumeDim, Frame > * > projection_tensor, const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric, const tnsr::I< DataType, VolumeDim, Frame > &normal_vector) noexcept
 Compute projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::ii< DataType, VolumeDim, Frame > gr::transverse_projection_operator (const tnsr::ii< DataType, VolumeDim, Frame > &spatial_metric, const tnsr::i< DataType, VolumeDim, Frame > &normal_one_form) noexcept
 Compute projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::Ij< DataType, VolumeDim, Frame > gr::transverse_projection_operator (const tnsr::I< DataType, VolumeDim, Frame > &normal_vector, const tnsr::i< DataType, VolumeDim, Frame > &normal_one_form) noexcept
 Compute projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
void gr::transverse_projection_operator (gsl::not_null< tnsr::Ij< DataType, VolumeDim, Frame > * > projection_tensor, const tnsr::I< DataType, VolumeDim, Frame > &normal_vector, const tnsr::i< DataType, VolumeDim, Frame > &normal_one_form) noexcept
 Compute projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute spacetime projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
void gr::transverse_projection_operator (gsl::not_null< tnsr::aa< DataType, VolumeDim, Frame > * > projection_tensor, 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) noexcept
 Compute spacetime projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::AA< DataType, VolumeDim, Frame > gr::transverse_projection_operator (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) noexcept
 Compute spacetime projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute spacetime projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute spacetime projection operator onto an interface. More...
 
template<size_t VolumeDim, typename Frame , typename DataType >
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) noexcept
 Compute spacetime projection operator onto an interface. More...
 
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) noexcept
 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) noexcept
 Computes Ricci tensor from the (spatial or spacetime) Christoffel symbol of the second kind and its derivative. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::I< DataType, SpatialDim, Frame > gr::shift (const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
 Compute shift from spacetime metric and inverse spatial metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Compute shift from spacetime metric and inverse spatial metric. More...
 
template<size_t Dim, typename Frame , typename DataType >
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) noexcept
 Computes the spacetime metric from the spatial metric, lapse, and shift. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the spacetime metric from the spatial metric, lapse, and shift. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::A< DataType, SpatialDim, Frame > gr::spacetime_normal_vector (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift) noexcept
 Computes spacetime normal vector from lapse and shift. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes spacetime normal vector from lapse and shift. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::ii< DataType, SpatialDim, Frame > gr::spatial_metric (const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
 Compute spatial metric from spacetime metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
void gr::spatial_metric (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > spatial_metric, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
 Compute spatial metric from spacetime metric. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the time derivative of the spacetime metric from spatial metric, lapse, shift, and their time derivatives. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the time derivative of the spacetime metric from spatial metric, lapse, shift, and their time derivatives. More...
 
template<size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::to_different_frame (const gsl::not_null< tnsr::ii< DataVector, VolumeDim, DestFrame > * > dest, const tnsr::ii< DataVector, VolumeDim, SrcFrame > &src, const Jacobian< DataVector, VolumeDim, DestFrame, SrcFrame > &jacobian) noexcept
 
template<size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::to_different_frame (const tnsr::ii< DataVector, VolumeDim, SrcFrame > &src, const Jacobian< DataVector, VolumeDim, DestFrame, SrcFrame > &jacobian) noexcept -> tnsr::ii< DataVector, VolumeDim, DestFrame >
 
template<size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::first_index_to_different_frame (const gsl::not_null< tnsr::ijj< DataVector, VolumeDim, DestFrame > * > dest, const Tensor< DataVector, tmpl::integral_list< std::int32_t, 2, 1, 1 >, index_list< SpatialIndex< VolumeDim, UpLo::Lo, SrcFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame > > > &src, const Jacobian< DataVector, VolumeDim, DestFrame, SrcFrame > &jacobian) noexcept
 
template<size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::first_index_to_different_frame (const Tensor< DataVector, tmpl::integral_list< std::int32_t, 2, 1, 1 >, index_list< SpatialIndex< VolumeDim, UpLo::Lo, SrcFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame > > > &src, const Jacobian< DataVector, VolumeDim, DestFrame, SrcFrame > &jacobian) noexcept -> tnsr::ijj< DataVector, VolumeDim, DestFrame >
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the electric part of the Weyl tensor in vacuum. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the electric part of the Weyl tensor in vacuum. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
Scalar< DataType > gr::weyl_electric_scalar (const tnsr::ii< DataType, SpatialDim, Frame > &weyl_electric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric) noexcept
 Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\). More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the scalar \(E_{ij} E^{ij}\) from the electric part of the Weyl tensor \(E_{ij}\). More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the propagating modes of the Weyl tensor. More...
 
template<size_t SpatialDim, typename Frame , typename DataType >
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) noexcept
 Computes the propagating modes of the Weyl tensor. 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)
noexcept

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 
)
noexcept

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 
)
noexcept

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<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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 \psi_{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 >
noexcept

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<size_t SpatialDim, typename Frame , typename DataType >
auto GeneralizedHarmonic::christoffel_second_kind ( const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::II< DataType, SpatialDim, Frame > &  inv_metric 
) -> tnsr::Ijj< DataType, SpatialDim, Frame >
noexcept

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 \psi_{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<size_t SpatialDim, typename Frame , typename DataType >
tnsr::ijj< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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_spatial_metric() [1/2]

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

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 g_{ij} = \Phi_{kij} \]

This quantity is needed for computing spatial Christoffel symbols.

◆ deriv_spatial_metric() [2/2]

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

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 g_{ij} = \Phi_{kij} \]

This quantity is needed for computing spatial Christoffel symbols.

◆ derivatives_of_spacetime_metric() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 \psi_{tt} &= - 2 N \partial_\mu N + 2 g_{mn} N^m \partial_\mu N^n + N^m N^n \partial_\mu g_{mn} \\ \partial_\mu \psi_{ti} &= g_{mi} \partial_\mu N^m + N^m \partial_\mu g_{mi} \\ \partial_\mu \psi_{ij} &= \partial_\mu g_{ij} \end{align}

where \( N, N^i, g \) are the lapse, shift, and spatial metric respectively.

◆ derivatives_of_spacetime_metric() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 \psi_{tt} &= - 2 N \partial_\mu N + 2 g_{mn} N^m \partial_\mu N^n + N^m N^n \partial_\mu g_{mn} \\ \partial_\mu \psi_{ti} &= g_{mi} \partial_\mu N^m + N^m \partial_\mu g_{mi} \\ \partial_\mu \psi_{ij} &= \partial_\mu g_{ij} \end{align}

where \( N, N^i, g \) are the lapse, shift, and spatial metric respectively.

◆ extrinsic_curvature() [1/4]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

Computes extrinsic curvature from metric and derivatives.

Details

Uses the ADM evolution equation for the spatial metric,

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

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

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

◆ extrinsic_curvature() [2/4]

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

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 \(t^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} t^a \end{align}

◆ extrinsic_curvature() [3/4]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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 \(t^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} t^a \end{align}

◆ extrinsic_curvature() [4/4]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

Computes extrinsic curvature from metric and derivatives.

Details

Uses the ADM evolution equation for the spatial metric,

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

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

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

◆ first_index_to_different_frame() [1/2]

template<size_t VolumeDim, typename SrcFrame , typename DestFrame >
void transform::first_index_to_different_frame ( const gsl::not_null< tnsr::ijj< DataVector, VolumeDim, DestFrame > * >  dest,
const Tensor< DataVector, tmpl::integral_list< std::int32_t, 2, 1, 1 >, index_list< SpatialIndex< VolumeDim, UpLo::Lo, SrcFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame > > > &  src,
const Jacobian< DataVector, VolumeDim, DestFrame, SrcFrame > &  jacobian 
)
noexcept

Transforms only the first index to different frame.

Often used for derivatives: When representing derivatives as tensors, the first index is typically the derivative index. Numerical derivatives must be computed in the logical frame or sometimes the grid frame (independent of the frame of the tensor being differentiated), and then that derivative index must later be transformed into the same frame as the other indices of the tensor.

The formula for transforming \(T_{i\bar{\jmath}\bar{k}}\) is

\begin{align} T_{\bar{\imath}\bar{\jmath}\bar{k}} &= T_{i\bar{\jmath}\bar{k}} \frac{\partial x^i}{\partial x^{\bar{\imath}}}, \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}}\).

In principle first_index_to_different_frame can be extended/generalized to other tensor types if needed.

◆ first_index_to_different_frame() [2/2]

template<size_t VolumeDim, typename SrcFrame , typename DestFrame >
auto transform::first_index_to_different_frame ( const Tensor< DataVector, tmpl::integral_list< std::int32_t, 2, 1, 1 >, index_list< SpatialIndex< VolumeDim, UpLo::Lo, SrcFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame >, SpatialIndex< VolumeDim, UpLo::Lo, DestFrame > > > &  src,
const Jacobian< DataVector, VolumeDim, DestFrame, SrcFrame > &  jacobian 
) -> tnsr::ijj< DataVector, VolumeDim, DestFrame >
noexcept

Transforms only the first index to different frame.

Often used for derivatives: When representing derivatives as tensors, the first index is typically the derivative index. Numerical derivatives must be computed in the logical frame or sometimes the grid frame (independent of the frame of the tensor being differentiated), and then that derivative index must later be transformed into the same frame as the other indices of the tensor.

The formula for transforming \(T_{i\bar{\jmath}\bar{k}}\) is

\begin{align} T_{\bar{\imath}\bar{\jmath}\bar{k}} &= T_{i\bar{\jmath}\bar{k}} \frac{\partial x^i}{\partial x^{\bar{\imath}}}, \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}}\).

In principle first_index_to_different_frame can be extended/generalized to other tensor types if needed.

◆ gauge_source() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::a< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

Computes generalized harmonic gauge source function.

Details

If \(N, N^i, g_{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 &= N^{-2} g_{il}(\partial_t N^i - N^k \partial_k N^i) + N^{-1} \partial_l N - g^{km}\Gamma_{lkm} \\ H_0 &= -N^{-1} \partial_t N + N^{-1} N^k\partial_k N + N^k H_k - N K \end{align}

See Eqs. 8 and 9 of [72]

◆ gauge_source() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

Computes generalized harmonic gauge source function.

Details

If \(N, N^i, g_{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 &= N^{-2} g_{il}(\partial_t N^i - N^k \partial_k N^i) + N^{-1} \partial_l N - g^{km}\Gamma_{lkm} \\ H_0 &= -N^{-1} \partial_t N + N^{-1} N^k\partial_k N + N^k H_k - N K \end{align}

See Eqs. 8 and 9 of [72]

◆ interface_null_normal() [1/4]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

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/4]

template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::A< DataType, VolumeDim, Frame > gr::interface_null_normal ( const tnsr::A< DataType, VolumeDim, Frame > &  spacetime_normal_vector,
const tnsr::I< DataType, VolumeDim, Frame > &  interface_unit_normal_vector,
const double  sign 
)
noexcept

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*}

◆ interface_null_normal() [3/4]

template<size_t VolumeDim, typename Frame , typename DataType >
void gr::interface_null_normal ( gsl::not_null< tnsr::a< DataType, VolumeDim, Frame > * >  null_one_form,
const tnsr::a< DataType, VolumeDim, Frame > &  spacetime_normal_one_form,
const tnsr::i< DataType, VolumeDim, Frame > &  interface_unit_normal_one_form,
const double  sign 
)
noexcept

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() [4/4]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

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<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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

Details

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

\begin{align} \psi^{tt} &= - 1/N^2 \\ \psi^{ti} &= N^i / N^2 \\ \psi^{ij} &= g^{ij} - N^i N^j / N^2 \end{align}

where \( N, N^i\) and \( g^{ij}\) are the lapse, shift and inverse spatial metric respectively

◆ inverse_spacetime_metric() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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

Details

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

\begin{align} \psi^{tt} &= - 1/N^2 \\ \psi^{ti} &= N^i / N^2 \\ \psi^{ij} &= g^{ij} - N^i N^j / N^2 \end{align}

where \( N, N^i\) and \( g^{ij}\) are the lapse, shift and inverse spatial metric respectively

◆ lapse() [1/2]

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

Compute lapse from shift and spacetime metric.

Details

Computes

\begin{align} N &= \sqrt{N^i \psi_{it}-\psi_{tt}} \end{align}

where \( N \), \( N^i\), and \(\psi_{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<size_t SpatialDim, typename Frame , typename DataType >
void gr::lapse ( gsl::not_null< Scalar< DataType > * >  lapse,
const tnsr::I< DataType, SpatialDim, Frame > &  shift,
const tnsr::aa< DataType, SpatialDim, Frame > &  spacetime_metric 
)
noexcept

Compute lapse from shift and spacetime metric.

Details

Computes

\begin{align} N &= \sqrt{N^i \psi_{it}-\psi_{tt}} \end{align}

where \( N \), \( N^i\), and \(\psi_{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<size_t SpatialDim, typename Frame , typename DataType >
tnsr::iaa< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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

Details

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

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

◆ phi() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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

Details

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

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

◆ pi() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::aa< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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

Details

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

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

◆ pi() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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

Details

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

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

◆ 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 
)
noexcept

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 
)
noexcept

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 
)
noexcept

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 
)
noexcept

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_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 
)
noexcept

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} = \frac{1}{2} ( \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 
)
noexcept

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} = \frac{1}{2} ( \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.

◆ shift() [1/2]

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

Compute shift from spacetime metric and inverse spatial metric.

Details

Computes

\begin{align} N^i &= g^{ij} \psi_{jt} \end{align}

where \( N^i\), \( g^{ij}\), and \(\psi_{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<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

Compute shift from spacetime metric and inverse spatial metric.

Details

Computes

\begin{align} N^i &= g^{ij} \psi_{jt} \end{align}

where \( N^i\), \( g^{ij}\), and \(\psi_{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<size_t SpatialDim, typename Frame , typename DataType >
tnsr::a< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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 g = g g^{jk} \partial_a g_{jk} \)

◆ spacetime_deriv_of_det_spatial_metric() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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 g = g g^{jk} \partial_a g_{jk} \)

◆ spacetime_deriv_of_norm_of_shift() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::a< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

Computes spacetime derivatives of the norm of the shift vector.

Details

The same is computed as:

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

◆ spacetime_deriv_of_norm_of_shift() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

Computes spacetime derivatives of the norm of the shift vector.

Details

The same is computed as:

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

◆ spacetime_derivative_of_spacetime_metric()

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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

Details

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

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

where \( N, N^i\) and \( g_{ij}\) are the lapse, shift and spatial metric respectively

◆ spacetime_metric() [2/2]

template<size_t Dim, typename Frame , typename DataType >
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 
)
noexcept

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

Details

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

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

where \( N, N^i\) and \( g_{ij}\) are the lapse, shift and spatial metric respectively

◆ spacetime_normal_vector() [1/2]

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

Computes spacetime normal vector from lapse and shift.

Details

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

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

is computed.

◆ spacetime_normal_vector() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

Computes spacetime normal vector from lapse and shift.

Details

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

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

is computed.

◆ spatial_deriv_of_lapse() [1/2]

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

Computes spatial derivatives of lapse (N) 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} = -t^c \partial_c \psi_{ab} \) and \(\Phi_{iab} = \partial_i \psi_{ab} \), the spatial derivatives of N can be obtained from:

\begin{align*} t^a t^b \Phi_{iab} = -\frac{1}{2N} [\partial_i (-N^2 + N_jN^j)- 2 N^j \partial_i N_j + N^j N^k \partial_i g_{jk}] = -\frac{2}{N} \partial_i N, \end{align*}

since

\[ \partial_i (N_jN^j) = 2N^j \partial_i N_j - N^j N^k \partial_i g_{jk}. \]

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

◆ spatial_deriv_of_lapse() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

Computes spatial derivatives of lapse (N) 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} = -t^c \partial_c \psi_{ab} \) and \(\Phi_{iab} = \partial_i \psi_{ab} \), the spatial derivatives of N can be obtained from:

\begin{align*} t^a t^b \Phi_{iab} = -\frac{1}{2N} [\partial_i (-N^2 + N_jN^j)- 2 N^j \partial_i N_j + N^j N^k \partial_i g_{jk}] = -\frac{2}{N} \partial_i N, \end{align*}

since

\[ \partial_i (N_jN^j) = 2N^j \partial_i N_j - N^j N^k \partial_i g_{jk}. \]

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

◆ spatial_deriv_of_shift() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::iJ< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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

Details

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

\begin{align*} \partial_i N^j =& g^{jl} g_{kl} \partial_i N^k \\ =& g^{jl} (N^k \partial_i g_{lk} + g_{kl}\partial_i N^k - N^k \partial_i g_{kl}) \\ =& g^{jl} (\partial_i N_l - N^k \partial_i g_{lk}) (\because g^{j0} = 0) \\ =& g^{ja} (\partial_i \psi_{a0} - N^k \partial _i \psi_{ak}) \\ =& N g^{ja} t^b \partial_i \psi_{ab} \\ =& (g^{ja} - t^j t^a) N t^b \Phi_{iab} - 2 t^j \partial_i N \\ =& \psi^{ja} N t^b \Phi_{iab} - 2 t^j \partial_i N \\ =& N (\psi^{ja} + t^j t^a) t^b \Phi_{iab}. \end{align*}

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

◆ spatial_deriv_of_shift() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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

Details

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

\begin{align*} \partial_i N^j =& g^{jl} g_{kl} \partial_i N^k \\ =& g^{jl} (N^k \partial_i g_{lk} + g_{kl}\partial_i N^k - N^k \partial_i g_{kl}) \\ =& g^{jl} (\partial_i N_l - N^k \partial_i g_{lk}) (\because g^{j0} = 0) \\ =& g^{ja} (\partial_i \psi_{a0} - N^k \partial _i \psi_{ak}) \\ =& N g^{ja} t^b \partial_i \psi_{ab} \\ =& (g^{ja} - t^j t^a) N t^b \Phi_{iab} - 2 t^j \partial_i N \\ =& \psi^{ja} N t^b \Phi_{iab} - 2 t^j \partial_i N \\ =& N (\psi^{ja} + t^j t^a) t^b \Phi_{iab}. \end{align*}

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

◆ spatial_metric() [1/2]

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

Compute spatial metric from spacetime metric.

Details

Simply pull out the spatial components.

◆ spatial_metric() [2/2]

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

Compute spatial metric from spacetime metric.

Details

Simply pull out the spatial components.

◆ spatial_ricci_tensor() [1/2]

template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::ii< DataType, VolumeDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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 g_{jk} + \partial_j g_{ik} - \partial_k g_{ij}) = (\Phi_{(ij)k} - \frac{1}{2}\Phi_{kij}) \end{align}

substituting \(\partial_k g_{ij}\rightarrow{}\Phi_{kij}\) by subtracting out the three-index constraint \(C_{kij}=\partial_{k}g_{ij}-\Phi_{kij}\) from every term. We also define contractions \(d_k=\frac{1}{2}g^{ij}\Phi_{kij}\) and \(b_k=\frac{1}{2}g^{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},\\ =& g^{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\\ & - g^{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\\ & + g^{km}\left(\Phi_{(kl)m} - \frac{1}{2}\Phi_{mkl}\right) g^{ln}\left(\Phi_{(ij)n} - \frac{1}{2}\Phi_{nij}\right) \nonumber\\ & - g^{km}\left(\Phi_{(il)m} - \frac{1}{2}\Phi_{mil}\right) g^{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} g^{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} g^{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}\label{eq:rij} R_{i j} &=& \frac{1}{2} g^{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). \end{eqnarray}

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

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<size_t VolumeDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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 g_{jk} + \partial_j g_{ik} - \partial_k g_{ij}) = (\Phi_{(ij)k} - \frac{1}{2}\Phi_{kij}) \end{align}

substituting \(\partial_k g_{ij}\rightarrow{}\Phi_{kij}\) by subtracting out the three-index constraint \(C_{kij}=\partial_{k}g_{ij}-\Phi_{kij}\) from every term. We also define contractions \(d_k=\frac{1}{2}g^{ij}\Phi_{kij}\) and \(b_k=\frac{1}{2}g^{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},\\ =& g^{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\\ & - g^{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\\ & + g^{km}\left(\Phi_{(kl)m} - \frac{1}{2}\Phi_{mkl}\right) g^{ln}\left(\Phi_{(ij)n} - \frac{1}{2}\Phi_{nij}\right) \nonumber\\ & - g^{km}\left(\Phi_{(il)m} - \frac{1}{2}\Phi_{mil}\right) g^{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} g^{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} g^{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}\label{eq:rij} R_{i j} &=& \frac{1}{2} g^{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). \end{eqnarray}

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

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<size_t SpatialDim, typename Frame , typename DataType >
Scalar< DataType > GeneralizedHarmonic::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 
)
noexcept

Computes time derivative of lapse (N) 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} = -t^c \partial_c \psi_{ab} \) and \(\Phi_{iab} = \partial_i \psi_{ab} \), and the operator \(D := \partial_0 - N^k \partial_k \). The time derivative of N is then:

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

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

Thus,

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

◆ time_deriv_of_lapse() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

Computes time derivative of lapse (N) 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} = -t^c \partial_c \psi_{ab} \) and \(\Phi_{iab} = \partial_i \psi_{ab} \), and the operator \(D := \partial_0 - N^k \partial_k \). The time derivative of N is then:

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

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

Thus,

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

◆ time_deriv_of_lower_shift() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
tnsr::i< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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

Details

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

\begin{align*} \partial_0 N_i = g_{ij} \partial_0 N^j + N^j \partial_0 g_{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<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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

Details

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

\begin{align*} \partial_0 N_i = g_{ij} \partial_0 N^j + N^j \partial_0 g_{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<size_t SpatialDim, typename Frame , typename DataType >
tnsr::I< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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

Details

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

\begin{align*} \partial_0 N^i =& g^{ik} \partial_0 (g_{kj} N^j) - N^j g^{ik} \partial_0 g_{kj} \\ =& N g^{ik} t^b \partial_0 \psi_{kb} \\ =& N g^{ik} t^b (\partial_0 - N^j\partial_j) \psi_{kb} + N g^{ik} t^b N^j\partial_j \psi_{kb} \\ =& -N^2 t^b\Pi_{kb} g^{ik} + N N^j t^b\Phi_{jkb} g^{ik} \\ =& -N g^{ik} t^b (N \Pi_{kb} - N^j \Phi_{jkb}) \\ \end{align*}

◆ time_deriv_of_shift() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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

Details

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

\begin{align*} \partial_0 N^i =& g^{ik} \partial_0 (g_{kj} N^j) - N^j g^{ik} \partial_0 g_{kj} \\ =& N g^{ik} t^b \partial_0 \psi_{kb} \\ =& N g^{ik} t^b (\partial_0 - N^j\partial_j) \psi_{kb} + N g^{ik} t^b N^j\partial_j \psi_{kb} \\ =& -N^2 t^b\Pi_{kb} g^{ik} + N N^j t^b\Phi_{jkb} g^{ik} \\ =& -N g^{ik} t^b (N \Pi_{kb} - N^j \Phi_{jkb}) \\ \end{align*}

◆ time_deriv_of_spatial_metric() [1/2]

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

Computes time derivative of the spatial metric.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -t^c \partial_c \psi_{ab} \) and \(\Phi_{iab} = \partial_i \psi_{ab} \). As \( t_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 g_{ij} = \partial_0 \psi_{ij} \).

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

\[ \partial_0 \psi_{ab} = - N \Pi_{ab} + N^k \Phi_{kab} \]

◆ time_deriv_of_spatial_metric() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

Computes time derivative of the spatial metric.

Details

Let the generalized harmonic conjugate momentum and spatial derivative variables be \(\Pi_{ab} = -t^c \partial_c \psi_{ab} \) and \(\Phi_{iab} = \partial_i \psi_{ab} \). As \( t_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 g_{ij} = \partial_0 \psi_{ij} \).

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

\[ \partial_0 \psi_{ab} = - N \Pi_{ab} + N^k \Phi_{kab} \]

◆ time_derivative_of_spacetime_metric() [1/4]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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<size_t SpatialDim, typename Frame , typename DataType >
tnsr::aa< DataType, SpatialDim, Frame > GeneralizedHarmonic::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 
)
noexcept

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 \psi_{a b} = \beta^i \Phi_{i a b} - \alpha \Pi_{a b}. \end{align}

◆ time_derivative_of_spacetime_metric() [3/4]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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<size_t SpatialDim, typename Frame , typename DataType >
void GeneralizedHarmonic::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 
)
noexcept

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 \psi_{a b} = \beta^i \Phi_{i a b} - \alpha \Pi_{a b}. \end{align}

◆ to_different_frame() [1/2]

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

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}}\).

In principle to_different_frame can be extended/generalized to other tensor types if needed.

◆ to_different_frame() [2/2]

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

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}}\).

In principle to_different_frame can be extended/generalized to other tensor types if needed.

◆ 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 
)
noexcept

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 
)
noexcept

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 
)
noexcept

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 
)
noexcept

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/12]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

Compute spacetime projection operator onto an interface.

Details

Consider an \(n-1\)-dimensional surface \(S\) in an \(n\)-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 \(n+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/12]

template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::AA< DataType, VolumeDim, Frame > gr::transverse_projection_operator ( 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 
)
noexcept

Compute spacetime projection operator onto an interface.

Details

Consider an \(n-1\)-dimensional surface \(S\) 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 projection operator onto \(S\) for \(n+1\) dimensional quantities:

\begin{align*} P^{ab} = \psi^{ab} + n^a n^b - s^a s^b. \end{align*}

◆ transverse_projection_operator() [3/12]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

Compute spacetime projection operator onto an interface.

Details

Consider an \(n-1\)-dimensional surface \(S\) in an \(n\)-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 \(n+1\) dimensional quantities:

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

◆ transverse_projection_operator() [4/12]

template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::Ij< DataType, VolumeDim, Frame > gr::transverse_projection_operator ( const tnsr::I< DataType, VolumeDim, Frame > &  normal_vector,
const tnsr::i< DataType, VolumeDim, Frame > &  normal_one_form 
)
noexcept

Compute projection operator onto an interface.

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.

◆ transverse_projection_operator() [5/12]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

Compute projection operator onto an interface.

Details

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

◆ transverse_projection_operator() [6/12]

template<size_t VolumeDim, typename Frame , typename DataType >
tnsr::ii< DataType, VolumeDim, Frame > gr::transverse_projection_operator ( const tnsr::ii< DataType, VolumeDim, Frame > &  spatial_metric,
const tnsr::i< DataType, VolumeDim, Frame > &  normal_one_form 
)
noexcept

Compute projection operator onto an interface.

Details

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

◆ transverse_projection_operator() [7/12]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

Compute spacetime projection operator onto an interface.

Details

Consider an \(n-1\)-dimensional surface \(S\) 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 projection operator onto \(S\) for \(n+1\) dimensional quantities:

\begin{align*} P^{ab} = \psi^{ab} + n^a n^b - s^a s^b. \end{align*}

◆ transverse_projection_operator() [8/12]

template<size_t VolumeDim, typename Frame , typename DataType >
void gr::transverse_projection_operator ( gsl::not_null< tnsr::aa< DataType, VolumeDim, Frame > * >  projection_tensor,
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 
)
noexcept

Compute spacetime projection operator onto an interface.

Details

Consider an \(n-1\)-dimensional surface \(S\) in an \(n\)-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 \(n+1\) dimensional quantities:

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

◆ transverse_projection_operator() [9/12]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

Compute spacetime projection operator onto an interface.

Details

Consider an \(n-1\)-dimensional surface \(S\) in an \(n\)-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 \(n+1\) dimensional quantities:

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

◆ transverse_projection_operator() [10/12]

template<size_t VolumeDim, typename Frame , typename DataType >
void gr::transverse_projection_operator ( gsl::not_null< tnsr::II< DataType, VolumeDim, Frame > * >  projection_tensor,
const tnsr::II< DataType, VolumeDim, Frame > &  inverse_spatial_metric,
const tnsr::I< DataType, VolumeDim, Frame > &  normal_vector 
)
noexcept

Compute projection operator onto an interface.

Details

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

◆ transverse_projection_operator() [11/12]

template<size_t VolumeDim, typename Frame , typename DataType >
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 
)
noexcept

Compute projection operator onto an interface.

Details

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

◆ transverse_projection_operator() [12/12]

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

Compute projection operator onto an interface.

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<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 [17].

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

◆ weyl_electric() [2/2]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 [17].

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

◆ weyl_electric_scalar() [1/2]

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

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 \(g^{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<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 \(g^{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_propagating() [1/2]

template<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 [63] (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<size_t SpatialDim, typename Frame , typename DataType >
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 
)
noexcept

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 [63] (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\).