SpECTRE  v2024.06.18
gh Namespace Reference

Items related to evolving the first-order generalized harmonic system. More...

Namespaces

namespace  BoundaryConditions
 Boundary conditions for the generalized harmonic system.
 
namespace  BoundaryCorrections
 Boundary corrections/numerical fluxes.
 
namespace  ConstraintDamping
 Holds classes implementing DampingFunction (functions \(R^n \to R\)).
 
namespace  gauges
 Gauge conditions for generalized harmonic evolution systems.
 
namespace  OptionTags
 Input option tags for the generalized harmonic evolution system.
 
namespace  Tags
 Tags for the generalized harmonic formulation of Einstein equations.
 

Classes

struct  CharacteristicFieldsCompute
 
struct  CharacteristicSpeedsCompute
 
struct  CharacteristicSpeedsOnStrahlkorper
 
struct  CharacteristicSpeedsOnStrahlkorperCompute
 
struct  ComputeNormalDotFluxes
 Set the normal dot the flux to zero since the generalized harmonic system has no fluxes and they're currently still needed for the evolution scheme. More...
 
struct  EvolvedFieldsFromCharacteristicFieldsCompute
 
class  NumericInitialData
 Numeric initial data loaded from volume data files. More...
 
struct  System
 
struct  TimeDerivative
 Compute the RHS of the Generalized Harmonic formulation of Einstein's equations. More...
 

Typedefs

using ghmhd_solutions = tmpl::append< gh::RelativisticEuler::Solutions::all_solutions, gh::grmhd::Solutions::all_solutions, gh::grmhd::AnalyticData::all_analytic_data >
 All solutions, including matter ones from GRMHD, etc. Used by e.g. boundary conditions.
 
template<size_t Dim>
using solutions_including_matter = tmpl::append< gh::Solutions::all_solutions< Dim >, tmpl::conditional_t< Dim==3, tmpl::append< ghmhd_solutions, gh::ScalarTensor::AnalyticData::all_analytic_data >, tmpl::list<> > >
 

Functions

template<size_t Dim>
void initial_gh_variables_from_adm (gsl::not_null< tnsr::aa< DataVector, Dim > * > spacetime_metric, gsl::not_null< tnsr::aa< DataVector, Dim > * > pi, gsl::not_null< tnsr::iaa< DataVector, Dim > * > phi, const tnsr::ii< DataVector, Dim > &spatial_metric, const Scalar< DataVector > &lapse, const tnsr::I< DataVector, Dim > &shift, const tnsr::ii< DataVector, Dim > &extrinsic_curvature, const Mesh< Dim > &mesh, const InverseJacobian< DataVector, Dim, Frame::ElementLogical, Frame::Inertial > &inv_jacobian)
 Compute initial GH variables from ADM variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ijj< DataType, SpatialDim, Frame > covariant_deriv_of_extrinsic_curvature (const tnsr::ii< DataType, SpatialDim, Frame > &extrinsic_curvature, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal_vector, const tnsr::Ijj< DataType, SpatialDim, Frame > &spatial_christoffel_second_kind, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi)
 Computes the covariant derivative of extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void covariant_deriv_of_extrinsic_curvature (gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > * > d_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)
 
template<typename DataType , size_t SpatialDim, typename Frame >
void spacetime_derivative_of_spacetime_metric (gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame > * > da_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the spacetime derivative of the spacetime metric, \(\partial_a g_{bc}\). More...
 
template<size_t Dim, typename Frame >
std::array< DataVector, 4 > characteristic_speeds (const Scalar< DataVector > &gamma_1, const Scalar< DataVector > &lapse, const tnsr::I< DataVector, Dim, Frame > &shift, const tnsr::i< DataVector, Dim, Frame > &unit_normal_one_form, const std::optional< tnsr::I< DataVector, Dim, Frame > > &mesh_velocity)
 Compute the characteristic speeds for the generalized harmonic system. More...
 
template<size_t Dim, typename Frame >
void characteristic_speeds (gsl::not_null< std::array< DataVector, 4 > * > char_speeds, const Scalar< DataVector > &gamma_1, const Scalar< DataVector > &lapse, const tnsr::I< DataVector, Dim, Frame > &shift, const tnsr::i< DataVector, Dim, Frame > &unit_normal_one_form, const std::optional< tnsr::I< DataVector, Dim, Frame > > &mesh_velocity)
 Compute the characteristic speeds for the generalized harmonic system. More...
 
template<size_t Dim, typename Frame >
Tags::CharacteristicFields< DataVector, Dim, Frame >::type characteristic_fields (const Scalar< DataVector > &gamma_2, const tnsr::II< DataVector, Dim, Frame > &inverse_spatial_metric, const tnsr::aa< DataVector, Dim, Frame > &spacetime_metric, const tnsr::aa< DataVector, Dim, Frame > &pi, const tnsr::iaa< DataVector, Dim, Frame > &phi, const tnsr::i< DataVector, Dim, Frame > &unit_normal_one_form)
 Computes characteristic fields from evolved fields. More...
 
template<size_t Dim, typename Frame >
void characteristic_fields (gsl::not_null< typename Tags::CharacteristicFields< DataVector, Dim, Frame >::type * > char_fields, const Scalar< DataVector > &gamma_2, const tnsr::II< DataVector, Dim, Frame > &inverse_spatial_metric, const tnsr::aa< DataVector, Dim, Frame > &spacetime_metric, const tnsr::aa< DataVector, Dim, Frame > &pi, const tnsr::iaa< DataVector, Dim, Frame > &phi, const tnsr::i< DataVector, Dim, Frame > &unit_normal_one_form)
 Computes characteristic fields from evolved fields. More...
 
template<size_t Dim, typename Frame >
Tags::EvolvedFieldsFromCharacteristicFields< DataVector, Dim, Frame >::type evolved_fields_from_characteristic_fields (const Scalar< DataVector > &gamma_2, const tnsr::aa< DataVector, Dim, Frame > &u_psi, const tnsr::iaa< DataVector, Dim, Frame > &u_zero, const tnsr::aa< DataVector, Dim, Frame > &u_plus, const tnsr::aa< DataVector, Dim, Frame > &u_minus, const tnsr::i< DataVector, Dim, Frame > &unit_normal_one_form)
 For expressions used here to compute evolved fields from characteristic ones, see CharacteristicFieldsCompute.
 
template<size_t Dim, typename Frame >
void evolved_fields_from_characteristic_fields (gsl::not_null< typename Tags::EvolvedFieldsFromCharacteristicFields< DataVector, Dim, Frame >::type * > evolved_fields, const Scalar< DataVector > &gamma_2, const tnsr::aa< DataVector, Dim, Frame > &u_psi, const tnsr::iaa< DataVector, Dim, Frame > &u_zero, const tnsr::aa< DataVector, Dim, Frame > &u_plus, const tnsr::aa< DataVector, Dim, Frame > &u_minus, const tnsr::i< DataVector, Dim, Frame > &unit_normal_one_form)
 For expressions used here to compute evolved fields from characteristic ones, see CharacteristicFieldsCompute.
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iaa< DataType, SpatialDim, Frame > three_index_constraint (const tnsr::iaa< DataType, SpatialDim, Frame > &d_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the generalized-harmonic 3-index constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void three_index_constraint (gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * > constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &d_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the generalized-harmonic 3-index constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gauge_constraint (const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the generalized-harmonic gauge constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gauge_constraint (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > constraint, const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the generalized-harmonic gauge constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ia< DataType, SpatialDim, Frame > two_index_constraint (const tnsr::ab< DataType, SpatialDim, Frame > &spacetime_d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint)
 Computes the generalized-harmonic 2-index constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void two_index_constraint (gsl::not_null< tnsr::ia< DataType, SpatialDim, Frame > * > constraint, const tnsr::ab< DataType, SpatialDim, Frame > &spacetime_d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint)
 Computes the generalized-harmonic 2-index constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iaa< DataType, SpatialDim, Frame > four_index_constraint (const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi)
 Computes the generalized-harmonic 4-index constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void four_index_constraint (gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * > constraint, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi)
 Computes the generalized-harmonic 4-index constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > f_constraint (const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::ab< DataType, SpatialDim, Frame > &spacetime_d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint)
 Computes the generalized-harmonic F constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void f_constraint (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > constraint, const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::ab< DataType, SpatialDim, Frame > &spacetime_d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint)
 Computes the generalized-harmonic F constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > f_constraint (const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::ab< DataType, SpatialDim, Frame > &spacetime_d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint, const tnsr::aa< DataType, SpatialDim, Frame > &trace_reversed_stress_energy)
 Computes the generalized-harmonic F constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void f_constraint (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > constraint, const tnsr::a< DataType, SpatialDim, Frame > &gauge_function, const tnsr::ab< DataType, SpatialDim, Frame > &spacetime_d_gauge_function, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const Scalar< DataType > &gamma2, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint, const tnsr::aa< DataType, SpatialDim, Frame > &trace_reversed_stress_energy)
 Computes the generalized-harmonic F constraint. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > constraint_energy (const tnsr::a< DataType, SpatialDim, Frame > &gauge_constraint, const tnsr::a< DataType, SpatialDim, Frame > &f_constraint, const tnsr::ia< DataType, SpatialDim, Frame > &two_index_constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &four_index_constraint, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const Scalar< DataType > &spatial_metric_determinant, double gauge_constraint_multiplier=1.0, double two_index_constraint_multiplier=1.0, double three_index_constraint_multiplier=1.0, double four_index_constraint_multiplier=1.0)
 Computes the generalized-harmonic (unnormalized) constraint energy. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void constraint_energy (gsl::not_null< Scalar< DataType > * > energy, const tnsr::a< DataType, SpatialDim, Frame > &gauge_constraint, const tnsr::a< DataType, SpatialDim, Frame > &f_constraint, const tnsr::ia< DataType, SpatialDim, Frame > &two_index_constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &three_index_constraint, const tnsr::iaa< DataType, SpatialDim, Frame > &four_index_constraint, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const Scalar< DataType > &spatial_metric_determinant, double gauge_constraint_multiplier=1.0, double two_index_constraint_multiplier=1.0, double three_index_constraint_multiplier=1.0, double four_index_constraint_multiplier=1.0)
 Computes the generalized-harmonic (unnormalized) constraint energy. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > constraint_energy_normalization (const tnsr::iaa< DataType, SpatialDim, Frame > &d_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const Scalar< DataType > &sqrt_spatial_metric_determinant, double dimensional_constant)
 Computes the generalized-harmonic normalized constraint energy. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void constraint_energy_normalization (gsl::not_null< Scalar< DataType > * > energy_norm, const tnsr::iaa< DataType, SpatialDim, Frame > &d_spacetime_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &d_pi, const tnsr::ijaa< DataType, SpatialDim, Frame > &d_phi, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const Scalar< DataType > &sqrt_spatial_metric_determinant, double dimensional_constant)
 Computes the generalized-harmonic normalized constraint energy. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void christoffel_second_kind (const gsl::not_null< tnsr::Ijj< DataType, SpatialDim, Frame > * > christoffel, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::II< DataType, SpatialDim, Frame > &inv_metric)
 Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
auto christoffel_second_kind (const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::II< DataType, SpatialDim, Frame > &inv_metric) -> tnsr::Ijj< DataType, SpatialDim, Frame >
 Computes spatial Christoffel symbol of the 2nd kind from the the generalized harmonic spatial derivative variable and the inverse spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > trace_christoffel (const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Compute \(\Gamma_a\) from the generalized harmonic evolved variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void trace_christoffel (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > trace, const tnsr::a< DataType, SpatialDim, Frame > &spacetime_normal_one_form, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Compute \(\Gamma_a\) from the generalized harmonic evolved variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void deriv_spatial_metric (gsl::not_null< tnsr::ijj< DataType, SpatialDim, Frame > * > d_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ijj< DataType, SpatialDim, Frame > deriv_spatial_metric (const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the spatial metric from the generalized harmonic spatial derivative variable. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void extrinsic_curvature (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > ex_curv, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > extrinsic_curvature (const tnsr::A< DataType, SpatialDim, Frame > &spacetime_normal_vector, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes extrinsic curvature from generalized harmonic variables and the spacetime normal vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void gauge_source (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > gauge_source_h, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const Scalar< DataType > &trace_extrinsic_curvature, const tnsr::i< DataType, SpatialDim, Frame > &trace_christoffel_last_indices)
 Computes generalized harmonic gauge source function. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gauge_source (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const Scalar< DataType > &trace_extrinsic_curvature, const tnsr::i< DataType, SpatialDim, Frame > &trace_christoffel_last_indices)
 Computes generalized harmonic gauge source function. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void phi (gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * > phi, const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric)
 Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iaa< DataType, SpatialDim, Frame > phi (const Scalar< DataType > &lapse, const tnsr::i< DataType, SpatialDim, Frame > &deriv_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iJ< DataType, SpatialDim, Frame > &deriv_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ijj< DataType, SpatialDim, Frame > &deriv_spatial_metric)
 Computes the auxiliary variable \(\Phi_{iab}\) used by the generalized harmonic formulation of Einstein's equations. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void pi (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > pi, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( g_{ab} \). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > pi (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the conjugate momentum \(\Pi_{ab}\) of the spacetime metric \( g_{ab} \). More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
void spatial_ricci_tensor (gsl::not_null< tnsr::ii< DataType, VolumeDim, Frame > * > ricci, const tnsr::iaa< DataType, VolumeDim, Frame > &phi, const tnsr::ijaa< DataType, VolumeDim, Frame > &deriv_phi, const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric)
 Compute spatial Ricci tensor using evolved variables and their first derivatives. More...
 
template<typename DataType , size_t VolumeDim, typename Frame >
tnsr::ii< DataType, VolumeDim, Frame > spatial_ricci_tensor (const tnsr::iaa< DataType, VolumeDim, Frame > &phi, const tnsr::ijaa< DataType, VolumeDim, Frame > &deriv_phi, const tnsr::II< DataType, VolumeDim, Frame > &inverse_spatial_metric)
 Compute spatial Ricci tensor using evolved variables and their first derivatives. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void second_time_deriv_of_spacetime_metric (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > d2t2_spacetime_metric, const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &dt_phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::aa< DataType, SpatialDim, Frame > &dt_pi)
 Computes the second time derivative of the spacetime metric from the generalized harmonic variables, lapse, shift, and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > second_time_deriv_of_spacetime_metric (const Scalar< DataType > &lapse, const Scalar< DataType > &dt_lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::I< DataType, SpatialDim, Frame > &dt_shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::iaa< DataType, SpatialDim, Frame > &dt_phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::aa< DataType, SpatialDim, Frame > &dt_pi)
 Computes the second time derivative of the spacetime metric from the generalized harmonic variables, lapse, shift, and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void spacetime_deriv_of_det_spatial_metric (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > d4_det_spatial_metric, const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > spacetime_deriv_of_det_spatial_metric (const Scalar< DataType > &sqrt_det_spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::ii< DataType, SpatialDim, Frame > &dt_spatial_metric, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spacetime derivatives of the determinant of spatial metric, using the generalized harmonic variables, spatial metric, and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void spacetime_deriv_of_norm_of_shift (gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * > d4_norm_of_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes spacetime derivatives of the norm of the shift vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > spacetime_deriv_of_norm_of_shift (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes spacetime derivatives of the norm of the shift vector. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void spatial_deriv_of_lapse (gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > * > deriv_lapse, const Scalar< DataType > &lapse, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of lapse ( \(\alpha\)) from the generalized harmonic variables and spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::i< DataType, SpatialDim, Frame > spatial_deriv_of_lapse (const Scalar< DataType > &lapse, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of lapse ( \(\alpha\)) from the generalized harmonic variables and spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void spatial_deriv_of_shift (gsl::not_null< tnsr::iJ< DataType, SpatialDim, Frame > * > deriv_shift, const Scalar< DataType > &lapse, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iJ< DataType, SpatialDim, Frame > spatial_deriv_of_shift (const Scalar< DataType > &lapse, const tnsr::AA< DataType, SpatialDim, Frame > &inverse_spacetime_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes spatial derivatives of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void time_derivative_of_spacetime_metric (gsl::not_null< tnsr::aa< DataType, SpatialDim, Frame > * > dt_spacetime_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the time derivative of the spacetime metric from the generalized harmonic quantities \(\Pi_{a b}\), \(\Phi_{i a b}\), and the lapse \(\alpha\) and shift \(\beta^i\). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::aa< DataType, SpatialDim, Frame > time_derivative_of_spacetime_metric (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &pi, const tnsr::iaa< DataType, SpatialDim, Frame > &phi)
 Computes the time derivative of the spacetime metric from the generalized harmonic quantities \(\Pi_{a b}\), \(\Phi_{i a b}\), and the lapse \(\alpha\) and shift \(\beta^i\). More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void time_deriv_of_lapse (gsl::not_null< Scalar< DataType > * > dt_lapse, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of lapse ( \(\alpha\)) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > time_deriv_of_lapse (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of lapse ( \(\alpha\)) from the generalized harmonic variables, lapse, shift and the spacetime unit normal 1-form. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void time_deriv_of_lower_shift (gsl::not_null< tnsr::i< DataType, SpatialDim, Frame > * > dt_lower_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::i< DataType, SpatialDim, Frame > time_deriv_of_lower_shift (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::ii< DataType, SpatialDim, Frame > &spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of index lowered shift from generalized harmonic variables, spatial metric and its time derivative. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void time_deriv_of_shift (gsl::not_null< tnsr::I< DataType, SpatialDim, Frame > * > dt_shift, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::I< DataType, SpatialDim, Frame > time_deriv_of_shift (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::II< DataType, SpatialDim, Frame > &inverse_spatial_metric, const tnsr::A< DataType, SpatialDim, Frame > &spacetime_unit_normal, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the shift vector from the generalized harmonic and geometric variables. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
void time_deriv_of_spatial_metric (gsl::not_null< tnsr::ii< DataType, SpatialDim, Frame > * > dt_spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the spatial metric. More...
 
template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ii< DataType, SpatialDim, Frame > time_deriv_of_spatial_metric (const Scalar< DataType > &lapse, const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::iaa< DataType, SpatialDim, Frame > &phi, const tnsr::aa< DataType, SpatialDim, Frame > &pi)
 Computes time derivative of the spatial metric. More...
 

Detailed Description

Items related to evolving the first-order generalized harmonic system.

Function Documentation

◆ characteristic_fields() [1/2]

template<size_t Dim, typename Frame >
Tags::CharacteristicFields< DataVector, Dim, Frame >::type gh::characteristic_fields ( const Scalar< DataVector > &  gamma_2,
const tnsr::II< DataVector, Dim, Frame > &  inverse_spatial_metric,
const tnsr::aa< DataVector, Dim, Frame > &  spacetime_metric,
const tnsr::aa< DataVector, Dim, Frame > &  pi,
const tnsr::iaa< DataVector, Dim, Frame > &  phi,
const tnsr::i< DataVector, Dim, Frame > &  unit_normal_one_form 
)

Computes characteristic fields from evolved fields.

CharacteristicFieldsCompute and EvolvedFieldsFromCharacteristicFieldsCompute convert between characteristic and evolved fields for the generalized harmonic system.

CharacteristicFieldsCompute computes characteristic fields as described in "A New Generalized Harmonic Evolution System" by Lindblom et. al [119] . Their names used here differ from this paper:

\begin{align*} \mathrm{SpECTRE} && \mathrm{Lindblom} \\ u^{\psi}_{ab} && u^\hat{0}_{ab} \\ u^0_{iab} && u^\hat{2}_{iab} \\ u^{\pm}_{ab} && u^{\hat{1}\pm}_{ab} \end{align*}

The characteristic fields \(u\) are given in terms of the evolved fields by Eq.(32) - (34) of [119], respectively:

\begin{align*} u^{\psi}_{ab} =& \psi_{ab} \\ u^0_{iab} =& (\delta^k_i - n_i n^k) \Phi_{kab} := P^k_i \Phi_{kab} \\ u^{\pm}_{ab} =& \Pi_{ab} \pm n^i \Phi_{iab} - \gamma_2\psi_{ab} \end{align*}

where \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}\) and \(\Phi_{iab}\) are evolved generalized harmonic fields introduced by first derivatives of \(\psi_{ab}\), \(\gamma_2\) is a constraint damping parameter, and \(n_k\) is the unit normal to the surface.

EvolvedFieldsFromCharacteristicFieldsCompute computes evolved fields \(w\) in terms of the characteristic fields. This uses the inverse of above relations:

\begin{align*} \psi_{ab} =& u^{\psi}_{ab}, \\ \Pi_{ab} =& \frac{1}{2}(u^{+}_{ab} + u^{-}_{ab}) + \gamma_2 u^{\psi}_{ab}, \\ \Phi_{iab} =& \frac{1}{2}(u^{+}_{ab} - u^{-}_{ab}) n_i + u^0_{iab}. \end{align*}

The corresponding characteristic speeds \(v\) are computed by CharacteristicSpeedsCompute .

◆ characteristic_fields() [2/2]

template<size_t Dim, typename Frame >
void gh::characteristic_fields ( gsl::not_null< typename Tags::CharacteristicFields< DataVector, Dim, Frame >::type * >  char_fields,
const Scalar< DataVector > &  gamma_2,
const tnsr::II< DataVector, Dim, Frame > &  inverse_spatial_metric,
const tnsr::aa< DataVector, Dim, Frame > &  spacetime_metric,
const tnsr::aa< DataVector, Dim, Frame > &  pi,
const tnsr::iaa< DataVector, Dim, Frame > &  phi,
const tnsr::i< DataVector, Dim, Frame > &  unit_normal_one_form 
)

Computes characteristic fields from evolved fields.

CharacteristicFieldsCompute and EvolvedFieldsFromCharacteristicFieldsCompute convert between characteristic and evolved fields for the generalized harmonic system.

CharacteristicFieldsCompute computes characteristic fields as described in "A New Generalized Harmonic Evolution System" by Lindblom et. al [119] . Their names used here differ from this paper:

\begin{align*} \mathrm{SpECTRE} && \mathrm{Lindblom} \\ u^{\psi}_{ab} && u^\hat{0}_{ab} \\ u^0_{iab} && u^\hat{2}_{iab} \\ u^{\pm}_{ab} && u^{\hat{1}\pm}_{ab} \end{align*}

The characteristic fields \(u\) are given in terms of the evolved fields by Eq.(32) - (34) of [119], respectively:

\begin{align*} u^{\psi}_{ab} =& \psi_{ab} \\ u^0_{iab} =& (\delta^k_i - n_i n^k) \Phi_{kab} := P^k_i \Phi_{kab} \\ u^{\pm}_{ab} =& \Pi_{ab} \pm n^i \Phi_{iab} - \gamma_2\psi_{ab} \end{align*}

where \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}\) and \(\Phi_{iab}\) are evolved generalized harmonic fields introduced by first derivatives of \(\psi_{ab}\), \(\gamma_2\) is a constraint damping parameter, and \(n_k\) is the unit normal to the surface.

EvolvedFieldsFromCharacteristicFieldsCompute computes evolved fields \(w\) in terms of the characteristic fields. This uses the inverse of above relations:

\begin{align*} \psi_{ab} =& u^{\psi}_{ab}, \\ \Pi_{ab} =& \frac{1}{2}(u^{+}_{ab} + u^{-}_{ab}) + \gamma_2 u^{\psi}_{ab}, \\ \Phi_{iab} =& \frac{1}{2}(u^{+}_{ab} - u^{-}_{ab}) n_i + u^0_{iab}. \end{align*}

The corresponding characteristic speeds \(v\) are computed by CharacteristicSpeedsCompute .

◆ characteristic_speeds() [1/2]

template<size_t Dim, typename Frame >
std::array< DataVector, 4 > gh::characteristic_speeds ( const Scalar< DataVector > &  gamma_1,
const Scalar< DataVector > &  lapse,
const tnsr::I< DataVector, Dim, Frame > &  shift,
const tnsr::i< DataVector, Dim, Frame > &  unit_normal_one_form,
const std::optional< tnsr::I< DataVector, Dim, Frame > > &  mesh_velocity 
)

Compute the characteristic speeds for the generalized harmonic system.

Computes the speeds as described in "A New Generalized Harmonic Evolution System" by Lindblom et. al [119] [see text following Eq.(34)]. The characteristic fields' names used here differ from this paper:

\begin{align*} \mathrm{SpECTRE} && \mathrm{Lindblom} \\ u^{\psi}_{ab} && u^\hat{0}_{ab} \\ u^0_{iab} && u^\hat{2}_{iab} \\ u^{\pm}_{ab} && u^{\hat{1}\pm}_{ab} \end{align*}

The corresponding characteristic speeds \(v\) are given in the text between Eq.(34) and Eq.(35) of [119] :

\begin{align*} v_{\psi} =& -(1 + \gamma_1) n_k \beta^k - \gamma_1 n_k v^k_g \\ v_{0} =& -n_k \beta^k \\ v_{\pm} =& -n_k \beta^k \pm \alpha \end{align*}

where \(\alpha, \beta^k\) are the lapse and shift respectively, \(\gamma_1\) is a constraint damping parameter, \(n_k\) is the unit normal to the surface, and \(v^k_g\) is the (optional) mesh velocity.

◆ characteristic_speeds() [2/2]

template<size_t Dim, typename Frame >
void gh::characteristic_speeds ( gsl::not_null< std::array< DataVector, 4 > * >  char_speeds,
const Scalar< DataVector > &  gamma_1,
const Scalar< DataVector > &  lapse,
const tnsr::I< DataVector, Dim, Frame > &  shift,
const tnsr::i< DataVector, Dim, Frame > &  unit_normal_one_form,
const std::optional< tnsr::I< DataVector, Dim, Frame > > &  mesh_velocity 
)

Compute the characteristic speeds for the generalized harmonic system.

Computes the speeds as described in "A New Generalized Harmonic Evolution System" by Lindblom et. al [119] [see text following Eq.(34)]. The characteristic fields' names used here differ from this paper:

\begin{align*} \mathrm{SpECTRE} && \mathrm{Lindblom} \\ u^{\psi}_{ab} && u^\hat{0}_{ab} \\ u^0_{iab} && u^\hat{2}_{iab} \\ u^{\pm}_{ab} && u^{\hat{1}\pm}_{ab} \end{align*}

The corresponding characteristic speeds \(v\) are given in the text between Eq.(34) and Eq.(35) of [119] :

\begin{align*} v_{\psi} =& -(1 + \gamma_1) n_k \beta^k - \gamma_1 n_k v^k_g \\ v_{0} =& -n_k \beta^k \\ v_{\pm} =& -n_k \beta^k \pm \alpha \end{align*}

where \(\alpha, \beta^k\) are the lapse and shift respectively, \(\gamma_1\) is a constraint damping parameter, \(n_k\) is the unit normal to the surface, and \(v^k_g\) is the (optional) mesh velocity.

◆ constraint_energy() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gh::constraint_energy ( const tnsr::a< DataType, SpatialDim, Frame > &  gauge_constraint,
const tnsr::a< DataType, SpatialDim, Frame > &  f_constraint,
const tnsr::ia< DataType, SpatialDim, Frame > &  two_index_constraint,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint,
const tnsr::iaa< DataType, SpatialDim, Frame > &  four_index_constraint,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const Scalar< DataType > &  spatial_metric_determinant,
double  gauge_constraint_multiplier = 1.0,
double  two_index_constraint_multiplier = 1.0,
double  three_index_constraint_multiplier = 1.0,
double  four_index_constraint_multiplier = 1.0 
)

Computes the generalized-harmonic (unnormalized) constraint energy.

Details

Computes the generalized-harmonic unnormalized constraint energy [Eq. (53) of [119] with \(m^{ab}=\delta^{ab}\) and with each term in the sum scaled by an arbitrary coefficient],

\begin{eqnarray} E & = & K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij} + K_4 C_{ikab} C_{jlab}g^{ij} g^{kl}. \end{eqnarray}

Here \(C_a\) is the gauge constraint, \(F_a\) is the f constraint, \(C_{ia}\) is the two-index constraint, \(C_{iab}\) is the three-index constraint, \(C_{ikab}\) is the four-index constraint, \(g^{ij}\) is the inverse spatial metric, and \(K_1\), \(K_2\), \(K_3\), and \(K_4\) are constant multipliers for each term that each default to a value of 1.0. Note that in this equation, spacetime indices \(a,b\) are raised and lowered with the Kronecker delta.

Also note that the argument four_index_constraint is a rank-3 tensor. This is because gh::four_index_constraint() takes advantage of the antisymmetry of the four-index constraint's first two indices to only compute and return the independent components of \(C_{ijab}\), which can be written as

\begin{eqnarray} D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab}, \end{eqnarray}

where \(\epsilon_{ijk}\) is the flat-space Levi-Civita tensor, whose inidces are raised and lowered with the Kronecker delta. The result is

\begin{eqnarray} E & = & K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & 2 K_4 g D_{iab} D_{jab} g^{ij}, \end{eqnarray}

where \(g\) is the determinant of the spatial metric.

To derive this expression for the constraint energy implemented here, Eq.~(53) of [119] is

\begin{eqnarray} S_{AB} dc^A dc^B &=& m^{ab}\Bigl[d F_ad F_b +g^{ij}\bigl(d C_{ia}d C_{jb} +g^{kl}m^{cd}d C_{ikac}d C_{jlbd}\bigr) \nonumber\\ & + & \Lambda^2\bigl(d C_ad C_b +g^{ij}m^{cd}d C_{iac}d C_{jbd}\bigr) \Bigr]. \end{eqnarray}

Replace \(dc^A\rightarrow c^A\) to get

\begin{eqnarray} E&=& m^{ab}\Bigl[ F_a F_b +g^{ij}\bigl( C_{ia} C_{jb} +g^{kl}m^{cd} C_{ikac} C_{jlbd}\bigr) \nonumber\\ & + & \Lambda^2\bigl( C_a C_b +g^{ij}m^{cd} C_{iac} C_{jbd}\bigr) \Bigr]\nonumber\\ &=& m^{ab} F_a F_b +m^{ab}g^{ij} C_{ia} C_{jb} +m^{ab}g^{ij} g^{kl}m^{cd} C_{ikac} C_{jlbd} \nonumber\\ & + & m^{ab}\Lambda^2 C_a C_b +m^{ab}\Lambda^2 g^{ij}m^{cd} C_{iac} C_{jbd}. \end{eqnarray}

Here \(m^{ab}\) is an arbitrary positive-definite matrix, and \(\Lambda\) is an arbitrary real scalar. Choose \(m^{ab} = \delta^{ab}\) but allow an arbitrary coefficient to be placed in front of each term. Then, absorb \(\Lambda^2\) into one of these coefficients, to get

\begin{eqnarray} E &=& K_ F\delta^{ab} F_a F_b +K_2\delta^{ab}g^{ij} C_{ia} C_{jb} +K_4\delta^{ab}g^{ij} g^{kl}\delta^{cd} C_{ikac} C_{jlbd} \nonumber\\ & + & K_1\delta^{ab} C_a C_b +K_3\delta^{ab} g^{ij}\delta^{cd} C_{iac} C_{jbd}. \end{eqnarray}

Adopting a Euclidean norm for the constraint space (i.e., choosing to raise and lower spacetime indices with Kronecker deltas) gives

\begin{eqnarray} E &=& K_ F F_a F_a +K_2g^{ij} C_{ia} C_{ja} +K_4 g^{ij} g^{kl} C_{ikac} C_{jlac} \nonumber\\ & + & K_1 C_a C_a +K_3g^{ij} C_{iac} C_{jac}. \end{eqnarray}

The two-index constraint and f constraint can be viewed as the time and space components of a combined spacetime constraint. So next choose \(K_ F=K_2\), giving

\begin{eqnarray} E&=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij} + K_4 C_{ikab} C_{jlab}g^{ij} g^{kl}. \end{eqnarray}

Note that \(C_{ikab}\) is antisymmetric on the first two indices. Next, replace the four-index constraint \(C_{ijab}\) with \(D_{iab}\), which contains the independent components of \(C_{ijab}\). Specifically,

\begin{eqnarray} D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab}. \end{eqnarray}

The inverse relationship is

\begin{eqnarray} C_{jkab} = \epsilon^{i}{}_{jk} D_{iab}, \end{eqnarray}

where \(\epsilon_{ijk}\) is the flat-space Levi-Civita tensor, whose indices are raised and lowered with the Kronecker delta. Inserting this relation to replace \(C_{jkab}\) with \(D_{iab}\) gives

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} \epsilon^{m}{}_{ik} \epsilon^{n}{}_{jl} g^{ij} g^{kl}. \end{eqnarray}

There's a subtle point here: \(g^{ij}\) is the inverse spatial metric, which is not necessarily flat. But \(\epsilon^{i}{}_{jk}\) is the flat space Levi-Civita tensor. In order to raise and lower indices of the Levi-Civita tensor with the inverse spatial metrics, put in the appropriate factors of \(\sqrt{g}\), where \(g\) is the metric determinant, to make the curved-space Levi-Civita tensor compatible with \(g^{ij}\). Let \(\varepsilon^{ijk}\) represent the curved space Levi-Civita tensor compatible with \(g^{ij}\):

\begin{eqnarray} \varepsilon^{mik} = g^{-1/2} \epsilon^{mik}\\ \varepsilon_{mik} = g^{1/2} \epsilon_{mik}. \end{eqnarray}

Then we can write the constraint energy as

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g g^{-1/2}\epsilon^{m}{}_{ik} g^{-1/2}\epsilon^{n}{}_{jl} g^{ij} g^{kl}. \end{eqnarray}

The factors of \(g^{-1/2}\) make the Levi-Civita tensor compatible with \(g^{ij}\). Swapping which summed indices are raised and which are lowered gives

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g g^{-1/2}\epsilon^{mik} g^{-1/2}\epsilon^{njl} g_{ij} g_{kl}, \end{eqnarray}

or

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g \varepsilon^{mik} \varepsilon^{njl} g_{ij} g_{kl}, \end{eqnarray}

or, reversing up and down repeated indices again,

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g \varepsilon^{m}{}_{ik} \varepsilon^{n}{}_{jl} g^{ij} g^{kl}. \end{eqnarray}

The metric raises and lowers the indices of \(\varepsilon^{ijk}\), so this can be written as

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 g D_{mab} D^{n}{}_{ab} \varepsilon^{mjl} \varepsilon_{njl}. \end{eqnarray}

Now, in flat space (Eq. (1.23) of [182]),

\begin{eqnarray} \epsilon^{mjl} \epsilon_{njl} = \delta^{mj}_{nj} = \delta^m_n \delta^j_j - \delta^m_j \delta^j_n = 2 \delta^m_n. \end{eqnarray}

But this holds for curved space as well: multiply the left hand side by \(1 = g^{1/2} g^{-1/2}\) to get

\begin{eqnarray} g^{-1/2}\epsilon^{mjl} g^{1/2}\epsilon_{njl} = \varepsilon^{mjl} \varepsilon_{njl} = \delta^{mj}_{nj} = \delta^m_n \delta^j_j - \delta^m_j \delta^j_n = 2 \delta^m_n. \end{eqnarray}

So the constraint energy is

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & 2 K_4 D_{mab} D^{n}{}_{ab} \delta^m_n. \end{eqnarray}

Simplifying gives the formula implemented here:

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & 2 K_4 g D_{iab} D_{jab} g^{ij}. \end{eqnarray}

◆ constraint_energy() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::constraint_energy ( gsl::not_null< Scalar< DataType > * >  energy,
const tnsr::a< DataType, SpatialDim, Frame > &  gauge_constraint,
const tnsr::a< DataType, SpatialDim, Frame > &  f_constraint,
const tnsr::ia< DataType, SpatialDim, Frame > &  two_index_constraint,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint,
const tnsr::iaa< DataType, SpatialDim, Frame > &  four_index_constraint,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const Scalar< DataType > &  spatial_metric_determinant,
double  gauge_constraint_multiplier = 1.0,
double  two_index_constraint_multiplier = 1.0,
double  three_index_constraint_multiplier = 1.0,
double  four_index_constraint_multiplier = 1.0 
)

Computes the generalized-harmonic (unnormalized) constraint energy.

Details

Computes the generalized-harmonic unnormalized constraint energy [Eq. (53) of [119] with \(m^{ab}=\delta^{ab}\) and with each term in the sum scaled by an arbitrary coefficient],

\begin{eqnarray} E & = & K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij} + K_4 C_{ikab} C_{jlab}g^{ij} g^{kl}. \end{eqnarray}

Here \(C_a\) is the gauge constraint, \(F_a\) is the f constraint, \(C_{ia}\) is the two-index constraint, \(C_{iab}\) is the three-index constraint, \(C_{ikab}\) is the four-index constraint, \(g^{ij}\) is the inverse spatial metric, and \(K_1\), \(K_2\), \(K_3\), and \(K_4\) are constant multipliers for each term that each default to a value of 1.0. Note that in this equation, spacetime indices \(a,b\) are raised and lowered with the Kronecker delta.

Also note that the argument four_index_constraint is a rank-3 tensor. This is because gh::four_index_constraint() takes advantage of the antisymmetry of the four-index constraint's first two indices to only compute and return the independent components of \(C_{ijab}\), which can be written as

\begin{eqnarray} D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab}, \end{eqnarray}

where \(\epsilon_{ijk}\) is the flat-space Levi-Civita tensor, whose inidces are raised and lowered with the Kronecker delta. The result is

\begin{eqnarray} E & = & K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & 2 K_4 g D_{iab} D_{jab} g^{ij}, \end{eqnarray}

where \(g\) is the determinant of the spatial metric.

To derive this expression for the constraint energy implemented here, Eq.~(53) of [119] is

\begin{eqnarray} S_{AB} dc^A dc^B &=& m^{ab}\Bigl[d F_ad F_b +g^{ij}\bigl(d C_{ia}d C_{jb} +g^{kl}m^{cd}d C_{ikac}d C_{jlbd}\bigr) \nonumber\\ & + & \Lambda^2\bigl(d C_ad C_b +g^{ij}m^{cd}d C_{iac}d C_{jbd}\bigr) \Bigr]. \end{eqnarray}

Replace \(dc^A\rightarrow c^A\) to get

\begin{eqnarray} E&=& m^{ab}\Bigl[ F_a F_b +g^{ij}\bigl( C_{ia} C_{jb} +g^{kl}m^{cd} C_{ikac} C_{jlbd}\bigr) \nonumber\\ & + & \Lambda^2\bigl( C_a C_b +g^{ij}m^{cd} C_{iac} C_{jbd}\bigr) \Bigr]\nonumber\\ &=& m^{ab} F_a F_b +m^{ab}g^{ij} C_{ia} C_{jb} +m^{ab}g^{ij} g^{kl}m^{cd} C_{ikac} C_{jlbd} \nonumber\\ & + & m^{ab}\Lambda^2 C_a C_b +m^{ab}\Lambda^2 g^{ij}m^{cd} C_{iac} C_{jbd}. \end{eqnarray}

Here \(m^{ab}\) is an arbitrary positive-definite matrix, and \(\Lambda\) is an arbitrary real scalar. Choose \(m^{ab} = \delta^{ab}\) but allow an arbitrary coefficient to be placed in front of each term. Then, absorb \(\Lambda^2\) into one of these coefficients, to get

\begin{eqnarray} E &=& K_ F\delta^{ab} F_a F_b +K_2\delta^{ab}g^{ij} C_{ia} C_{jb} +K_4\delta^{ab}g^{ij} g^{kl}\delta^{cd} C_{ikac} C_{jlbd} \nonumber\\ & + & K_1\delta^{ab} C_a C_b +K_3\delta^{ab} g^{ij}\delta^{cd} C_{iac} C_{jbd}. \end{eqnarray}

Adopting a Euclidean norm for the constraint space (i.e., choosing to raise and lower spacetime indices with Kronecker deltas) gives

\begin{eqnarray} E &=& K_ F F_a F_a +K_2g^{ij} C_{ia} C_{ja} +K_4 g^{ij} g^{kl} C_{ikac} C_{jlac} \nonumber\\ & + & K_1 C_a C_a +K_3g^{ij} C_{iac} C_{jac}. \end{eqnarray}

The two-index constraint and f constraint can be viewed as the time and space components of a combined spacetime constraint. So next choose \(K_ F=K_2\), giving

\begin{eqnarray} E&=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij} + K_4 C_{ikab} C_{jlab}g^{ij} g^{kl}. \end{eqnarray}

Note that \(C_{ikab}\) is antisymmetric on the first two indices. Next, replace the four-index constraint \(C_{ijab}\) with \(D_{iab}\), which contains the independent components of \(C_{ijab}\). Specifically,

\begin{eqnarray} D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab}. \end{eqnarray}

The inverse relationship is

\begin{eqnarray} C_{jkab} = \epsilon^{i}{}_{jk} D_{iab}, \end{eqnarray}

where \(\epsilon_{ijk}\) is the flat-space Levi-Civita tensor, whose indices are raised and lowered with the Kronecker delta. Inserting this relation to replace \(C_{jkab}\) with \(D_{iab}\) gives

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} \epsilon^{m}{}_{ik} \epsilon^{n}{}_{jl} g^{ij} g^{kl}. \end{eqnarray}

There's a subtle point here: \(g^{ij}\) is the inverse spatial metric, which is not necessarily flat. But \(\epsilon^{i}{}_{jk}\) is the flat space Levi-Civita tensor. In order to raise and lower indices of the Levi-Civita tensor with the inverse spatial metrics, put in the appropriate factors of \(\sqrt{g}\), where \(g\) is the metric determinant, to make the curved-space Levi-Civita tensor compatible with \(g^{ij}\). Let \(\varepsilon^{ijk}\) represent the curved space Levi-Civita tensor compatible with \(g^{ij}\):

\begin{eqnarray} \varepsilon^{mik} = g^{-1/2} \epsilon^{mik}\\ \varepsilon_{mik} = g^{1/2} \epsilon_{mik}. \end{eqnarray}

Then we can write the constraint energy as

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g g^{-1/2}\epsilon^{m}{}_{ik} g^{-1/2}\epsilon^{n}{}_{jl} g^{ij} g^{kl}. \end{eqnarray}

The factors of \(g^{-1/2}\) make the Levi-Civita tensor compatible with \(g^{ij}\). Swapping which summed indices are raised and which are lowered gives

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g g^{-1/2}\epsilon^{mik} g^{-1/2}\epsilon^{njl} g_{ij} g_{kl}, \end{eqnarray}

or

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g \varepsilon^{mik} \varepsilon^{njl} g_{ij} g_{kl}, \end{eqnarray}

or, reversing up and down repeated indices again,

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 D_{mab} D_{nab} g \varepsilon^{m}{}_{ik} \varepsilon^{n}{}_{jl} g^{ij} g^{kl}. \end{eqnarray}

The metric raises and lowers the indices of \(\varepsilon^{ijk}\), so this can be written as

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & K_4 g D_{mab} D^{n}{}_{ab} \varepsilon^{mjl} \varepsilon_{njl}. \end{eqnarray}

Now, in flat space (Eq. (1.23) of [182]),

\begin{eqnarray} \epsilon^{mjl} \epsilon_{njl} = \delta^{mj}_{nj} = \delta^m_n \delta^j_j - \delta^m_j \delta^j_n = 2 \delta^m_n. \end{eqnarray}

But this holds for curved space as well: multiply the left hand side by \(1 = g^{1/2} g^{-1/2}\) to get

\begin{eqnarray} g^{-1/2}\epsilon^{mjl} g^{1/2}\epsilon_{njl} = \varepsilon^{mjl} \varepsilon_{njl} = \delta^{mj}_{nj} = \delta^m_n \delta^j_j - \delta^m_j \delta^j_n = 2 \delta^m_n. \end{eqnarray}

So the constraint energy is

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & 2 K_4 D_{mab} D^{n}{}_{ab} \delta^m_n. \end{eqnarray}

Simplifying gives the formula implemented here:

\begin{eqnarray} E &=& K_1 C_a C_a + K_2\left(F_a F_a + C_{ia} C_{ja} g^{ij}\right)\nonumber\\ & + & K_3 C_{iab} C_{jab} g^{ij}\nonumber\\ & + & 2 K_4 g D_{iab} D_{jab} g^{ij}. \end{eqnarray}

◆ constraint_energy_normalization() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
Scalar< DataType > gh::constraint_energy_normalization ( const tnsr::iaa< DataType, SpatialDim, Frame > &  d_spacetime_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const Scalar< DataType > &  sqrt_spatial_metric_determinant,
double  dimensional_constant 
)

Computes the generalized-harmonic normalized constraint energy.

Details

Computes the generalized-harmonic normalized constraint energy integrand [Eq. (70) of [119] with \(m^{ab}=\delta^{ab}\)],

\begin{eqnarray} ||E||=\gamma^{ij}\delta^{ab}\delta^{cd} (\Lambda^{2}\partial_{i}g_{ac}\partial_{j}g_{bd} + \partial_{i}\Pi_{ac}\partial_{j}\Pi_{bd} + \gamma^{kl}\partial_{i}\Phi_{kac}\partial_{j}\Phi_{lbd})\gamma^{1/2} \end{eqnarray}

Here \(\gamma^{ij}\) is the inverse spatial metric, and \(\Lambda^{2}\) is the squared dimensional constant. Note that in this equation, spacetime indices \(a,b\) are raised and lowered with the Kronecker delta.

◆ constraint_energy_normalization() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::constraint_energy_normalization ( gsl::not_null< Scalar< DataType > * >  energy_norm,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_spacetime_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const Scalar< DataType > &  sqrt_spatial_metric_determinant,
double  dimensional_constant 
)

Computes the generalized-harmonic normalized constraint energy.

Details

Computes the generalized-harmonic normalized constraint energy integrand [Eq. (70) of [119] with \(m^{ab}=\delta^{ab}\)],

\begin{eqnarray} ||E||=\gamma^{ij}\delta^{ab}\delta^{cd} (\Lambda^{2}\partial_{i}g_{ac}\partial_{j}g_{bd} + \partial_{i}\Pi_{ac}\partial_{j}\Pi_{bd} + \gamma^{kl}\partial_{i}\Phi_{kac}\partial_{j}\Phi_{lbd})\gamma^{1/2} \end{eqnarray}

Here \(\gamma^{ij}\) is the inverse spatial metric, and \(\Lambda^{2}\) is the squared dimensional constant. Note that in this equation, spacetime indices \(a,b\) are raised and lowered with the Kronecker delta.

◆ f_constraint() [1/4]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::f_constraint ( const tnsr::a< DataType, SpatialDim, Frame > &  gauge_function,
const tnsr::ab< DataType, SpatialDim, Frame > &  spacetime_d_gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const Scalar< DataType > &  gamma2,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint 
)

Computes the generalized-harmonic F constraint.

Details

Computes the generalized-harmonic F constraint [Eq. (43) of [119]],

\begin{eqnarray} {\cal F}_a &\equiv& \frac{1}{2} g_a^i \psi^{bc}\partial_i \Pi_{bc} - g^{ij} \partial_i \Pi_{ja} - g^{ij} t^b \partial_i \Phi_{jba} + \frac{1}{2} t_a \psi^{bc} g^{ij} \partial_i \Phi_{jbc} \nonumber \\ && + t_a g^{ij} \partial_i H_j + g_a^i \Phi_{ijb} g^{jk}\Phi_{kcd} \psi^{bd} t^c - \frac{1}{2} g_a^i \Phi_{ijb} g^{jk} \Phi_{kcd} \psi^{cd} t^b \nonumber \\ && - g_a^i t^b \partial_i H_b + g^{ij} \Phi_{icd} \Phi_{jba} \psi^{bc} t^d - \frac{1}{2} t_a g^{ij} g^{mn} \Phi_{imc} \Phi_{njd}\psi^{cd} \nonumber \\ && - \frac{1}{4} t_a g^{ij}\Phi_{icd}\Phi_{jbe} \psi^{cb}\psi^{de} + \frac{1}{4} t_a \Pi_{cd} \Pi_{be} \psi^{cb}\psi^{de} - g^{ij} H_i \Pi_{ja} \nonumber \\ && - t^b g^{ij} \Pi_{b i} \Pi_{ja} - \frac{1}{4} g_a^i \Phi_{icd} t^c t^d \Pi_{be} \psi^{be} + \frac{1}{2} t_a \Pi_{cd} \Pi_{be}\psi^{ce} t^d t^b \nonumber \\ && + g_a^i \Phi_{icd} \Pi_{be} t^c t^b \psi^{de} - g^{ij}\Phi_{iba} t^b \Pi_{je} t^e - \frac{1}{2} g^{ij}\Phi_{icd} t^c t^d \Pi_{ja} \nonumber \\ && - g^{ij} H_i \Phi_{jba} t^b + g_{a}^i \Phi_{icd} H_b \psi^{bc} t^d +\gamma_2\bigl(g^{id}{\cal C}_{ida} -\frac{1}{2} g_a^i\psi^{cd}{\cal C}_{icd}\bigr) \nonumber \\ && + \frac{1}{2} t_a \Pi_{cd}\psi^{cd} H_b t^b - t_a g^{ij} \Phi_{ijc} H_d \psi^{cd} +\frac{1}{2} t_a g^{ij} H_i \Phi_{jcd}\psi^{cd} \nonumber \\ && - 16 \pi t^a T_{a b} \end{eqnarray}

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, \(g^b_c = \delta^b_c + t^b t_c\), and \(T_{a b}\) is the stress-energy tensor if nonzero (if using the overload with no stress-energy tensor provided, the stress energy term is omitted).

To justify the stress-energy contribution to the F constraint, note that the stress-energy tensor appears in the dynamics of the Generalized Harmonic system only through \(\partial_t \Pi_{a b}\). That dependence arises from (using \(\dots\) to indicate collections of terms that are known to be independent of the stress-energy tensor):

\[ {\cal F}_a = \dots \alpha^{-1}(\partial_t {\cal C}_a), \]

where

\[ {\cal C}_a = H_a + g^{i j} \Phi_{ij a} + t^b \Pi_{ba} - \frac{1}{2} g_a{}^i \psi^{bc} \Phi_{i b c} - \frac{1}{2} t_a \psi^{bc} \Pi_{b c}. \]

.

Therefore, the Stress-energy contribution can be calculated from the trace-reversed contribution appearing in grmhd::GhValenciaDivClean::add_stress_energy_term_to_dt_pi – the trace reversal in that function and the trace-reversal that appears explicitly in \({\cal C}_a\) cancel.

◆ f_constraint() [2/4]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::f_constraint ( const tnsr::a< DataType, SpatialDim, Frame > &  gauge_function,
const tnsr::ab< DataType, SpatialDim, Frame > &  spacetime_d_gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const Scalar< DataType > &  gamma2,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint,
const tnsr::aa< DataType, SpatialDim, Frame > &  trace_reversed_stress_energy 
)

Computes the generalized-harmonic F constraint.

Details

Computes the generalized-harmonic F constraint [Eq. (43) of [119]],

\begin{eqnarray} {\cal F}_a &\equiv& \frac{1}{2} g_a^i \psi^{bc}\partial_i \Pi_{bc} - g^{ij} \partial_i \Pi_{ja} - g^{ij} t^b \partial_i \Phi_{jba} + \frac{1}{2} t_a \psi^{bc} g^{ij} \partial_i \Phi_{jbc} \nonumber \\ && + t_a g^{ij} \partial_i H_j + g_a^i \Phi_{ijb} g^{jk}\Phi_{kcd} \psi^{bd} t^c - \frac{1}{2} g_a^i \Phi_{ijb} g^{jk} \Phi_{kcd} \psi^{cd} t^b \nonumber \\ && - g_a^i t^b \partial_i H_b + g^{ij} \Phi_{icd} \Phi_{jba} \psi^{bc} t^d - \frac{1}{2} t_a g^{ij} g^{mn} \Phi_{imc} \Phi_{njd}\psi^{cd} \nonumber \\ && - \frac{1}{4} t_a g^{ij}\Phi_{icd}\Phi_{jbe} \psi^{cb}\psi^{de} + \frac{1}{4} t_a \Pi_{cd} \Pi_{be} \psi^{cb}\psi^{de} - g^{ij} H_i \Pi_{ja} \nonumber \\ && - t^b g^{ij} \Pi_{b i} \Pi_{ja} - \frac{1}{4} g_a^i \Phi_{icd} t^c t^d \Pi_{be} \psi^{be} + \frac{1}{2} t_a \Pi_{cd} \Pi_{be}\psi^{ce} t^d t^b \nonumber \\ && + g_a^i \Phi_{icd} \Pi_{be} t^c t^b \psi^{de} - g^{ij}\Phi_{iba} t^b \Pi_{je} t^e - \frac{1}{2} g^{ij}\Phi_{icd} t^c t^d \Pi_{ja} \nonumber \\ && - g^{ij} H_i \Phi_{jba} t^b + g_{a}^i \Phi_{icd} H_b \psi^{bc} t^d +\gamma_2\bigl(g^{id}{\cal C}_{ida} -\frac{1}{2} g_a^i\psi^{cd}{\cal C}_{icd}\bigr) \nonumber \\ && + \frac{1}{2} t_a \Pi_{cd}\psi^{cd} H_b t^b - t_a g^{ij} \Phi_{ijc} H_d \psi^{cd} +\frac{1}{2} t_a g^{ij} H_i \Phi_{jcd}\psi^{cd} \nonumber \\ && - 16 \pi t^a T_{a b} \end{eqnarray}

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, \(g^b_c = \delta^b_c + t^b t_c\), and \(T_{a b}\) is the stress-energy tensor if nonzero (if using the overload with no stress-energy tensor provided, the stress energy term is omitted).

To justify the stress-energy contribution to the F constraint, note that the stress-energy tensor appears in the dynamics of the Generalized Harmonic system only through \(\partial_t \Pi_{a b}\). That dependence arises from (using \(\dots\) to indicate collections of terms that are known to be independent of the stress-energy tensor):

\[ {\cal F}_a = \dots \alpha^{-1}(\partial_t {\cal C}_a), \]

where

\[ {\cal C}_a = H_a + g^{i j} \Phi_{ij a} + t^b \Pi_{ba} - \frac{1}{2} g_a{}^i \psi^{bc} \Phi_{i b c} - \frac{1}{2} t_a \psi^{bc} \Pi_{b c}. \]

.

Therefore, the Stress-energy contribution can be calculated from the trace-reversed contribution appearing in grmhd::GhValenciaDivClean::add_stress_energy_term_to_dt_pi – the trace reversal in that function and the trace-reversal that appears explicitly in \({\cal C}_a\) cancel.

◆ f_constraint() [3/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::f_constraint ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  constraint,
const tnsr::a< DataType, SpatialDim, Frame > &  gauge_function,
const tnsr::ab< DataType, SpatialDim, Frame > &  spacetime_d_gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const Scalar< DataType > &  gamma2,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint 
)

Computes the generalized-harmonic F constraint.

Details

Computes the generalized-harmonic F constraint [Eq. (43) of [119]],

\begin{eqnarray} {\cal F}_a &\equiv& \frac{1}{2} g_a^i \psi^{bc}\partial_i \Pi_{bc} - g^{ij} \partial_i \Pi_{ja} - g^{ij} t^b \partial_i \Phi_{jba} + \frac{1}{2} t_a \psi^{bc} g^{ij} \partial_i \Phi_{jbc} \nonumber \\ && + t_a g^{ij} \partial_i H_j + g_a^i \Phi_{ijb} g^{jk}\Phi_{kcd} \psi^{bd} t^c - \frac{1}{2} g_a^i \Phi_{ijb} g^{jk} \Phi_{kcd} \psi^{cd} t^b \nonumber \\ && - g_a^i t^b \partial_i H_b + g^{ij} \Phi_{icd} \Phi_{jba} \psi^{bc} t^d - \frac{1}{2} t_a g^{ij} g^{mn} \Phi_{imc} \Phi_{njd}\psi^{cd} \nonumber \\ && - \frac{1}{4} t_a g^{ij}\Phi_{icd}\Phi_{jbe} \psi^{cb}\psi^{de} + \frac{1}{4} t_a \Pi_{cd} \Pi_{be} \psi^{cb}\psi^{de} - g^{ij} H_i \Pi_{ja} \nonumber \\ && - t^b g^{ij} \Pi_{b i} \Pi_{ja} - \frac{1}{4} g_a^i \Phi_{icd} t^c t^d \Pi_{be} \psi^{be} + \frac{1}{2} t_a \Pi_{cd} \Pi_{be}\psi^{ce} t^d t^b \nonumber \\ && + g_a^i \Phi_{icd} \Pi_{be} t^c t^b \psi^{de} - g^{ij}\Phi_{iba} t^b \Pi_{je} t^e - \frac{1}{2} g^{ij}\Phi_{icd} t^c t^d \Pi_{ja} \nonumber \\ && - g^{ij} H_i \Phi_{jba} t^b + g_{a}^i \Phi_{icd} H_b \psi^{bc} t^d +\gamma_2\bigl(g^{id}{\cal C}_{ida} -\frac{1}{2} g_a^i\psi^{cd}{\cal C}_{icd}\bigr) \nonumber \\ && + \frac{1}{2} t_a \Pi_{cd}\psi^{cd} H_b t^b - t_a g^{ij} \Phi_{ijc} H_d \psi^{cd} +\frac{1}{2} t_a g^{ij} H_i \Phi_{jcd}\psi^{cd} \nonumber \\ && - 16 \pi t^a T_{a b} \end{eqnarray}

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, \(g^b_c = \delta^b_c + t^b t_c\), and \(T_{a b}\) is the stress-energy tensor if nonzero (if using the overload with no stress-energy tensor provided, the stress energy term is omitted).

To justify the stress-energy contribution to the F constraint, note that the stress-energy tensor appears in the dynamics of the Generalized Harmonic system only through \(\partial_t \Pi_{a b}\). That dependence arises from (using \(\dots\) to indicate collections of terms that are known to be independent of the stress-energy tensor):

\[ {\cal F}_a = \dots \alpha^{-1}(\partial_t {\cal C}_a), \]

where

\[ {\cal C}_a = H_a + g^{i j} \Phi_{ij a} + t^b \Pi_{ba} - \frac{1}{2} g_a{}^i \psi^{bc} \Phi_{i b c} - \frac{1}{2} t_a \psi^{bc} \Pi_{b c}. \]

.

Therefore, the Stress-energy contribution can be calculated from the trace-reversed contribution appearing in grmhd::GhValenciaDivClean::add_stress_energy_term_to_dt_pi – the trace reversal in that function and the trace-reversal that appears explicitly in \({\cal C}_a\) cancel.

◆ f_constraint() [4/4]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::f_constraint ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  constraint,
const tnsr::a< DataType, SpatialDim, Frame > &  gauge_function,
const tnsr::ab< DataType, SpatialDim, Frame > &  spacetime_d_gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const Scalar< DataType > &  gamma2,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint,
const tnsr::aa< DataType, SpatialDim, Frame > &  trace_reversed_stress_energy 
)

Computes the generalized-harmonic F constraint.

Details

Computes the generalized-harmonic F constraint [Eq. (43) of [119]],

\begin{eqnarray} {\cal F}_a &\equiv& \frac{1}{2} g_a^i \psi^{bc}\partial_i \Pi_{bc} - g^{ij} \partial_i \Pi_{ja} - g^{ij} t^b \partial_i \Phi_{jba} + \frac{1}{2} t_a \psi^{bc} g^{ij} \partial_i \Phi_{jbc} \nonumber \\ && + t_a g^{ij} \partial_i H_j + g_a^i \Phi_{ijb} g^{jk}\Phi_{kcd} \psi^{bd} t^c - \frac{1}{2} g_a^i \Phi_{ijb} g^{jk} \Phi_{kcd} \psi^{cd} t^b \nonumber \\ && - g_a^i t^b \partial_i H_b + g^{ij} \Phi_{icd} \Phi_{jba} \psi^{bc} t^d - \frac{1}{2} t_a g^{ij} g^{mn} \Phi_{imc} \Phi_{njd}\psi^{cd} \nonumber \\ && - \frac{1}{4} t_a g^{ij}\Phi_{icd}\Phi_{jbe} \psi^{cb}\psi^{de} + \frac{1}{4} t_a \Pi_{cd} \Pi_{be} \psi^{cb}\psi^{de} - g^{ij} H_i \Pi_{ja} \nonumber \\ && - t^b g^{ij} \Pi_{b i} \Pi_{ja} - \frac{1}{4} g_a^i \Phi_{icd} t^c t^d \Pi_{be} \psi^{be} + \frac{1}{2} t_a \Pi_{cd} \Pi_{be}\psi^{ce} t^d t^b \nonumber \\ && + g_a^i \Phi_{icd} \Pi_{be} t^c t^b \psi^{de} - g^{ij}\Phi_{iba} t^b \Pi_{je} t^e - \frac{1}{2} g^{ij}\Phi_{icd} t^c t^d \Pi_{ja} \nonumber \\ && - g^{ij} H_i \Phi_{jba} t^b + g_{a}^i \Phi_{icd} H_b \psi^{bc} t^d +\gamma_2\bigl(g^{id}{\cal C}_{ida} -\frac{1}{2} g_a^i\psi^{cd}{\cal C}_{icd}\bigr) \nonumber \\ && + \frac{1}{2} t_a \Pi_{cd}\psi^{cd} H_b t^b - t_a g^{ij} \Phi_{ijc} H_d \psi^{cd} +\frac{1}{2} t_a g^{ij} H_i \Phi_{jcd}\psi^{cd} \nonumber \\ && - 16 \pi t^a T_{a b} \end{eqnarray}

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, \(g^b_c = \delta^b_c + t^b t_c\), and \(T_{a b}\) is the stress-energy tensor if nonzero (if using the overload with no stress-energy tensor provided, the stress energy term is omitted).

To justify the stress-energy contribution to the F constraint, note that the stress-energy tensor appears in the dynamics of the Generalized Harmonic system only through \(\partial_t \Pi_{a b}\). That dependence arises from (using \(\dots\) to indicate collections of terms that are known to be independent of the stress-energy tensor):

\[ {\cal F}_a = \dots \alpha^{-1}(\partial_t {\cal C}_a), \]

where

\[ {\cal C}_a = H_a + g^{i j} \Phi_{ij a} + t^b \Pi_{ba} - \frac{1}{2} g_a{}^i \psi^{bc} \Phi_{i b c} - \frac{1}{2} t_a \psi^{bc} \Pi_{b c}. \]

.

Therefore, the Stress-energy contribution can be calculated from the trace-reversed contribution appearing in grmhd::GhValenciaDivClean::add_stress_energy_term_to_dt_pi – the trace reversal in that function and the trace-reversal that appears explicitly in \({\cal C}_a\) cancel.

◆ four_index_constraint() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::iaa< DataType, SpatialDim, Frame > gh::four_index_constraint ( const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi)

Computes the generalized-harmonic 4-index constraint.

Details

Computes the independent components of the generalized-harmonic 4-index constraint. The constraint itself is given by Eq. (45) of [119],

\begin{eqnarray} C_{ijab} = 2 \partial_{[i}\Phi_{j]ab}, \end{eqnarray}

where \(\Phi_{iab} = \partial_i\psi_{ab}\). Because the constraint is antisymmetric on the two spatial indices, here we compute and store only the independent components of \(C_{ijab}\). Specifically, we compute

\begin{eqnarray} D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab} = \epsilon_{i}{}^{jk} \partial_j \Phi_{kab}, \end{eqnarray}

where \(\epsilon_{ijk}\) is the flat-space Levi-Civita symbol, which is raised and lowered with the Kronecker delta. In terms of \(D_{iab}\), the full 4-index constraint is

\begin{eqnarray} C_{jkab} = \epsilon^{i}{}_{jk} D_{iab}. \end{eqnarray}

◆ four_index_constraint() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::four_index_constraint ( gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * >  constraint,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi 
)

Computes the generalized-harmonic 4-index constraint.

Details

Computes the independent components of the generalized-harmonic 4-index constraint. The constraint itself is given by Eq. (45) of [119],

\begin{eqnarray} C_{ijab} = 2 \partial_{[i}\Phi_{j]ab}, \end{eqnarray}

where \(\Phi_{iab} = \partial_i\psi_{ab}\). Because the constraint is antisymmetric on the two spatial indices, here we compute and store only the independent components of \(C_{ijab}\). Specifically, we compute

\begin{eqnarray} D_{iab} \equiv \frac{1}{2} \epsilon_{i}{}^{jk} C_{jkab} = \epsilon_{i}{}^{jk} \partial_j \Phi_{kab}, \end{eqnarray}

where \(\epsilon_{ijk}\) is the flat-space Levi-Civita symbol, which is raised and lowered with the Kronecker delta. In terms of \(D_{iab}\), the full 4-index constraint is

\begin{eqnarray} C_{jkab} = \epsilon^{i}{}_{jk} D_{iab}. \end{eqnarray}

◆ gauge_constraint() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::gauge_constraint ( const tnsr::a< DataType, SpatialDim, Frame > &  gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the generalized-harmonic gauge constraint.

Details

Computes the generalized-harmonic gauge constraint [Eq. (40) of [119]],

\[ C_a = H_a + g^{ij} \Phi_{ija} + t^b \Pi_{ba} - \frac{1}{2} g^i_a \psi^{bc} \Phi_{ibc} - \frac{1}{2} t_a \psi^{bc} \Pi_{bc}, \]

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, and \(g^b_c = \delta^b_c + t^b t_c\).

◆ gauge_constraint() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::gauge_constraint ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  constraint,
const tnsr::a< DataType, SpatialDim, Frame > &  gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the generalized-harmonic gauge constraint.

Details

Computes the generalized-harmonic gauge constraint [Eq. (40) of [119]],

\[ C_a = H_a + g^{ij} \Phi_{ija} + t^b \Pi_{ba} - \frac{1}{2} g^i_a \psi^{bc} \Phi_{ibc} - \frac{1}{2} t_a \psi^{bc} \Pi_{bc}, \]

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, and \(g^b_c = \delta^b_c + t^b t_c\).

◆ initial_gh_variables_from_adm()

template<size_t Dim>
void gh::initial_gh_variables_from_adm ( gsl::not_null< tnsr::aa< DataVector, Dim > * >  spacetime_metric,
gsl::not_null< tnsr::aa< DataVector, Dim > * >  pi,
gsl::not_null< tnsr::iaa< DataVector, Dim > * >  phi,
const tnsr::ii< DataVector, Dim > &  spatial_metric,
const Scalar< DataVector > &  lapse,
const tnsr::I< DataVector, Dim > &  shift,
const tnsr::ii< DataVector, Dim > &  extrinsic_curvature,
const Mesh< Dim > &  mesh,
const InverseJacobian< DataVector, Dim, Frame::ElementLogical, Frame::Inertial > &  inv_jacobian 
)

Compute initial GH variables from ADM variables.

  • The spacetime metric is assembled from the spatial metric, lapse, and shift. See gr::spacetime_metric for details.
  • Phi is set to the numerical derivative of the spacetime metric. This ensures that the 3-index constraint is initially satisfied.
  • Pi is computed by choosing the time derivatives of lapse and shift to be zero. The gh::gauges::SetPiAndPhiFromConstraints mutator exists to override Pi later in the algorithm (it should be combined with this function).

◆ three_index_constraint() [1/2]

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

Computes the generalized-harmonic 3-index constraint.

Details

Computes the generalized-harmonic 3-index constraint, \(C_{iab} = \partial_i\psi_{ab} - \Phi_{iab},\) which is given by Eq. (26) of [119]

◆ three_index_constraint() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::three_index_constraint ( gsl::not_null< tnsr::iaa< DataType, SpatialDim, Frame > * >  constraint,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_spacetime_metric,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Computes the generalized-harmonic 3-index constraint.

Details

Computes the generalized-harmonic 3-index constraint, \(C_{iab} = \partial_i\psi_{ab} - \Phi_{iab},\) which is given by Eq. (26) of [119]

◆ trace_christoffel() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::a< DataType, SpatialDim, Frame > gh::trace_christoffel ( const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Compute \(\Gamma_a\) from the generalized harmonic evolved variables.

Starting from Eq. (40) of [119] we get

\begin{align*} \Gamma_a &= \gamma^{ij}\Phi_{ija} + n^b \Pi_{ab} - \frac{1}{2}\gamma^{i}{}_ag^{bc}\Phi_{ibc} - \frac{1}{2}n_ag^{bc}\Pi_{bc} \\ \Gamma_a &= \gamma^{ij}\Phi_{ija} + n^b \Pi_{ab} -\frac{1}{2} n_a g^{bc} \left(n^i \Phi_{ibc} + \Pi_{bc}\right) - \frac{1}{2} \delta^i_a g^{bc} \Phi_{ibc} \end{align*}

◆ trace_christoffel() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::trace_christoffel ( gsl::not_null< tnsr::a< DataType, SpatialDim, Frame > * >  trace,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi 
)

Compute \(\Gamma_a\) from the generalized harmonic evolved variables.

Starting from Eq. (40) of [119] we get

\begin{align*} \Gamma_a &= \gamma^{ij}\Phi_{ija} + n^b \Pi_{ab} - \frac{1}{2}\gamma^{i}{}_ag^{bc}\Phi_{ibc} - \frac{1}{2}n_ag^{bc}\Pi_{bc} \\ \Gamma_a &= \gamma^{ij}\Phi_{ija} + n^b \Pi_{ab} -\frac{1}{2} n_a g^{bc} \left(n^i \Phi_{ibc} + \Pi_{bc}\right) - \frac{1}{2} \delta^i_a g^{bc} \Phi_{ibc} \end{align*}

◆ two_index_constraint() [1/2]

template<typename DataType , size_t SpatialDim, typename Frame >
tnsr::ia< DataType, SpatialDim, Frame > gh::two_index_constraint ( const tnsr::ab< DataType, SpatialDim, Frame > &  spacetime_d_gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const Scalar< DataType > &  gamma2,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint 
)

Computes the generalized-harmonic 2-index constraint.

Details

Computes the generalized-harmonic 2-index constraint [Eq. (44) of [119]],

\begin{eqnarray} C_{ia} &\equiv& g^{jk}\partial_j \Phi_{ika} - \frac{1}{2} g_a^j\psi^{cd}\partial_j \Phi_{icd} + t^b \partial_i \Pi_{ba} - \frac{1}{2} t_a \psi^{cd}\partial_i\Pi_{cd} \nonumber\\&& + \partial_i H_a + \frac{1}{2} g_a^j \Phi_{jcd} \Phi_{ief} \psi^{ce}\psi^{df} + \frac{1}{2} g^{jk} \Phi_{jcd} \Phi_{ike} \psi^{cd}t^e t_a \nonumber\\&& - g^{jk}g^{mn}\Phi_{jma}\Phi_{ikn} + \frac{1}{2} \Phi_{icd} \Pi_{be} t_a \left(\psi^{cb}\psi^{de} +\frac{1}{2}\psi^{be} t^c t^d\right) \nonumber\\&& - \Phi_{icd} \Pi_{ba} t^c \left(\psi^{bd} +\frac{1}{2} t^b t^d\right) + \frac{1}{2} \gamma_2 \left(t_a \psi^{cd} - 2 \delta^c_a t^d\right) C_{icd}. \end{eqnarray}

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, and \(g^b_c = \delta^b_c + t^b t_c\).

◆ two_index_constraint() [2/2]

template<typename DataType , size_t SpatialDim, typename Frame >
void gh::two_index_constraint ( gsl::not_null< tnsr::ia< DataType, SpatialDim, Frame > * >  constraint,
const tnsr::ab< DataType, SpatialDim, Frame > &  spacetime_d_gauge_function,
const tnsr::a< DataType, SpatialDim, Frame > &  spacetime_normal_one_form,
const tnsr::A< DataType, SpatialDim, Frame > &  spacetime_normal_vector,
const tnsr::II< DataType, SpatialDim, Frame > &  inverse_spatial_metric,
const tnsr::AA< DataType, SpatialDim, Frame > &  inverse_spacetime_metric,
const tnsr::aa< DataType, SpatialDim, Frame > &  pi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  phi,
const tnsr::iaa< DataType, SpatialDim, Frame > &  d_pi,
const tnsr::ijaa< DataType, SpatialDim, Frame > &  d_phi,
const Scalar< DataType > &  gamma2,
const tnsr::iaa< DataType, SpatialDim, Frame > &  three_index_constraint 
)

Computes the generalized-harmonic 2-index constraint.

Details

Computes the generalized-harmonic 2-index constraint [Eq. (44) of [119]],

\begin{eqnarray} C_{ia} &\equiv& g^{jk}\partial_j \Phi_{ika} - \frac{1}{2} g_a^j\psi^{cd}\partial_j \Phi_{icd} + t^b \partial_i \Pi_{ba} - \frac{1}{2} t_a \psi^{cd}\partial_i\Pi_{cd} \nonumber\\&& + \partial_i H_a + \frac{1}{2} g_a^j \Phi_{jcd} \Phi_{ief} \psi^{ce}\psi^{df} + \frac{1}{2} g^{jk} \Phi_{jcd} \Phi_{ike} \psi^{cd}t^e t_a \nonumber\\&& - g^{jk}g^{mn}\Phi_{jma}\Phi_{ikn} + \frac{1}{2} \Phi_{icd} \Pi_{be} t_a \left(\psi^{cb}\psi^{de} +\frac{1}{2}\psi^{be} t^c t^d\right) \nonumber\\&& - \Phi_{icd} \Pi_{ba} t^c \left(\psi^{bd} +\frac{1}{2} t^b t^d\right) + \frac{1}{2} \gamma_2 \left(t_a \psi^{cd} - 2 \delta^c_a t^d\right) C_{icd}. \end{eqnarray}

where \(H_a\) is the gauge function, \(\psi_{ab}\) is the spacetime metric, \(\Pi_{ab}=-t^c\partial_c \psi_{ab}\), and \(\Phi_{iab} = \partial_i\psi_{ab}\); \(t^a\) is the timelike unit normal vector to the spatial slice, \(g^{ij}\) is the inverse spatial metric, and \(g^b_c = \delta^b_c + t^b t_c\).