SpECTRE  v2024.09.29
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 RnR).
 
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 = implementation defined
 All solutions, including matter ones from GRMHD, etc. Used by e.g. boundary conditions.
 
template<size_t Dim>
using solutions_including_matter = implementation defined
 

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, agbc. 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 Γ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 Γ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 Φ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 Φ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 Πab of the spacetime metric gab. 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 Πab of the spacetime metric gab. 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 ( α) 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 ( α) 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 Πab, Φiab, and the lapse α and shift β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 Πab, Φiab, and the lapse α and shift β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 ( α) 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 ( α) 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 . Their names used here differ from this paper:

SpECTRELindblomuabψuab0^uiab0uiab2^uab±uab1^±

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

uabψ=ψabuiab0=(δiknink)Φkab:=PikΦkabuab±=Πab±niΦiabγ2ψab

where ψab is the spacetime metric, Πab and Φiab are evolved generalized harmonic fields introduced by first derivatives of ψab, γ2 is a constraint damping parameter, and nk 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:

ψab=uabψ,Πab=12(uab++uab)+γ2uabψ,Φiab=12(uab+uab)ni+uiab0.

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 . Their names used here differ from this paper:

SpECTRELindblomuabψuab0^uiab0uiab2^uab±uab1^±

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

uabψ=ψabuiab0=(δiknink)Φkab:=PikΦkabuab±=Πab±niΦiabγ2ψab

where ψab is the spacetime metric, Πab and Φiab are evolved generalized harmonic fields introduced by first derivatives of ψab, γ2 is a constraint damping parameter, and nk 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:

ψab=uabψ,Πab=12(uab++uab)+γ2uabψ,Φiab=12(uab+uab)ni+uiab0.

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 [see text following Eq.(34)]. The characteristic fields' names used here differ from this paper:

SpECTRELindblomuabψuab0^uiab0uiab2^uab±uab1^±

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

vψ=(1+γ1)nkβkγ1nkvgkv0=nkβkv±=nkβk±α

where α,βk are the lapse and shift respectively, γ1 is a constraint damping parameter, nk is the unit normal to the surface, and vgk 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 [see text following Eq.(34)]. The characteristic fields' names used here differ from this paper:

SpECTRELindblomuabψuab0^uiab0uiab2^uab±uab1^±

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

vψ=(1+γ1)nkβkγ1nkvgkv0=nkβkv±=nkβk±α

where α,βk are the lapse and shift respectively, γ1 is a constraint damping parameter, nk is the unit normal to the surface, and vgk 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 with mab=δab and with each term in the sum scaled by an arbitrary coefficient],

E=K1CaCa+K2(FaFa+CiaCjagij)(1)+K3CiabCjabgij+K4CikabCjlabgijgkl.

Here Ca is the gauge constraint, Fa is the f constraint, Cia is the two-index constraint, Ciab is the three-index constraint, Cikab is the four-index constraint, gij is the inverse spatial metric, and K1, K2, K3, and K4 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 Cijab, which can be written as

(2)Diab12ϵijkCjkab,

where ϵijk is the flat-space Levi-Civita tensor, whose inidces are raised and lowered with the Kronecker delta. The result is

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(3)+2K4gDiabDjabgij,

where g is the determinant of the spatial metric.

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

SABdcAdcB=mab[dFadFb+gij(dCiadCjb+gklmcddCikacdCjlbd)(4)+Λ2(dCadCb+gijmcddCiacdCjbd)].

Replace dcAcA to get

E=mab[FaFb+gij(CiaCjb+gklmcdCikacCjlbd)+Λ2(CaCb+gijmcdCiacCjbd)]=mabFaFb+mabgijCiaCjb+mabgijgklmcdCikacCjlbd(5)+mabΛ2CaCb+mabΛ2gijmcdCiacCjbd.

Here mab is an arbitrary positive-definite matrix, and Λ is an arbitrary real scalar. Choose mab=δab but allow an arbitrary coefficient to be placed in front of each term. Then, absorb Λ2 into one of these coefficients, to get

E=KFδabFaFb+K2δabgijCiaCjb+K4δabgijgklδcdCikacCjlbd(6)+K1δabCaCb+K3δabgijδcdCiacCjbd.

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

E=KFFaFa+K2gijCiaCja+K4gijgklCikacCjlac(7)+K1CaCa+K3gijCiacCjac.

The two-index constraint and f constraint can be viewed as the time and space components of a combined spacetime constraint. So next choose KF=K2, giving

E=K1CaCa+K2(FaFa+CiaCjagij)(8)+K3CiabCjabgij+K4CikabCjlabgijgkl.

Note that Cikab is antisymmetric on the first two indices. Next, replace the four-index constraint Cijab with Diab, which contains the independent components of Cijab. Specifically,

(9)Diab12ϵijkCjkab.

The inverse relationship is

(10)Cjkab=ϵijkDiab,

where ϵijk is the flat-space Levi-Civita tensor, whose indices are raised and lowered with the Kronecker delta. Inserting this relation to replace Cjkab with Diab gives

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(11)+K4DmabDnabϵmikϵnjlgijgkl.

There's a subtle point here: gij is the inverse spatial metric, which is not necessarily flat. But ϵijk 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 g, where g is the metric determinant, to make the curved-space Levi-Civita tensor compatible with gij. Let εijk represent the curved space Levi-Civita tensor compatible with gij:

(12)εmik=g1/2ϵmik(13)εmik=g1/2ϵmik.

Then we can write the constraint energy as

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(14)+K4DmabDnabgg1/2ϵmikg1/2ϵnjlgijgkl.

The factors of g1/2 make the Levi-Civita tensor compatible with gij. Swapping which summed indices are raised and which are lowered gives

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(15)+K4DmabDnabgg1/2ϵmikg1/2ϵnjlgijgkl,

or

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(16)+K4DmabDnabgεmikεnjlgijgkl,

or, reversing up and down repeated indices again,

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(17)+K4DmabDnabgεmikεnjlgijgkl.

The metric raises and lowers the indices of εijk, so this can be written as

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(18)+K4gDmabDnabεmjlεnjl.

Now, in flat space (Eq. (1.23) of ),

(19)ϵmjlϵnjl=δnjmj=δnmδjjδjmδnj=2δnm.

But this holds for curved space as well: multiply the left hand side by 1=g1/2g1/2 to get

(20)g1/2ϵmjlg1/2ϵnjl=εmjlεnjl=δnjmj=δnmδjjδjmδnj=2δnm.

So the constraint energy is

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(21)+2K4DmabDnabδnm.

Simplifying gives the formula implemented here:

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(22)+2K4gDiabDjabgij.

◆ 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 with mab=δab and with each term in the sum scaled by an arbitrary coefficient],

E=K1CaCa+K2(FaFa+CiaCjagij)(23)+K3CiabCjabgij+K4CikabCjlabgijgkl.

Here Ca is the gauge constraint, Fa is the f constraint, Cia is the two-index constraint, Ciab is the three-index constraint, Cikab is the four-index constraint, gij is the inverse spatial metric, and K1, K2, K3, and K4 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 Cijab, which can be written as

(24)Diab12ϵijkCjkab,

where ϵijk is the flat-space Levi-Civita tensor, whose inidces are raised and lowered with the Kronecker delta. The result is

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(25)+2K4gDiabDjabgij,

where g is the determinant of the spatial metric.

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

SABdcAdcB=mab[dFadFb+gij(dCiadCjb+gklmcddCikacdCjlbd)(26)+Λ2(dCadCb+gijmcddCiacdCjbd)].

Replace dcAcA to get

E=mab[FaFb+gij(CiaCjb+gklmcdCikacCjlbd)+Λ2(CaCb+gijmcdCiacCjbd)]=mabFaFb+mabgijCiaCjb+mabgijgklmcdCikacCjlbd(27)+mabΛ2CaCb+mabΛ2gijmcdCiacCjbd.

Here mab is an arbitrary positive-definite matrix, and Λ is an arbitrary real scalar. Choose mab=δab but allow an arbitrary coefficient to be placed in front of each term. Then, absorb Λ2 into one of these coefficients, to get

E=KFδabFaFb+K2δabgijCiaCjb+K4δabgijgklδcdCikacCjlbd(28)+K1δabCaCb+K3δabgijδcdCiacCjbd.

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

E=KFFaFa+K2gijCiaCja+K4gijgklCikacCjlac(29)+K1CaCa+K3gijCiacCjac.

The two-index constraint and f constraint can be viewed as the time and space components of a combined spacetime constraint. So next choose KF=K2, giving

E=K1CaCa+K2(FaFa+CiaCjagij)(30)+K3CiabCjabgij+K4CikabCjlabgijgkl.

Note that Cikab is antisymmetric on the first two indices. Next, replace the four-index constraint Cijab with Diab, which contains the independent components of Cijab. Specifically,

(31)Diab12ϵijkCjkab.

The inverse relationship is

(32)Cjkab=ϵijkDiab,

where ϵijk is the flat-space Levi-Civita tensor, whose indices are raised and lowered with the Kronecker delta. Inserting this relation to replace Cjkab with Diab gives

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(33)+K4DmabDnabϵmikϵnjlgijgkl.

There's a subtle point here: gij is the inverse spatial metric, which is not necessarily flat. But ϵijk 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 g, where g is the metric determinant, to make the curved-space Levi-Civita tensor compatible with gij. Let εijk represent the curved space Levi-Civita tensor compatible with gij:

(34)εmik=g1/2ϵmik(35)εmik=g1/2ϵmik.

Then we can write the constraint energy as

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(36)+K4DmabDnabgg1/2ϵmikg1/2ϵnjlgijgkl.

The factors of g1/2 make the Levi-Civita tensor compatible with gij. Swapping which summed indices are raised and which are lowered gives

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(37)+K4DmabDnabgg1/2ϵmikg1/2ϵnjlgijgkl,

or

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(38)+K4DmabDnabgεmikεnjlgijgkl,

or, reversing up and down repeated indices again,

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(39)+K4DmabDnabgεmikεnjlgijgkl.

The metric raises and lowers the indices of εijk, so this can be written as

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(40)+K4gDmabDnabεmjlεnjl.

Now, in flat space (Eq. (1.23) of ),

(41)ϵmjlϵnjl=δnjmj=δnmδjjδjmδnj=2δnm.

But this holds for curved space as well: multiply the left hand side by 1=g1/2g1/2 to get

(42)g1/2ϵmjlg1/2ϵnjl=εmjlεnjl=δnjmj=δnmδjjδjmδnj=2δnm.

So the constraint energy is

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(43)+2K4DmabDnabδnm.

Simplifying gives the formula implemented here:

E=K1CaCa+K2(FaFa+CiaCjagij)+K3CiabCjabgij(44)+2K4gDiabDjabgij.

◆ 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 with mab=δab],

(45)||E||=γijδabδcd(Λ2igacjgbd+iΠacjΠbd+γkliΦkacjΦlbd)γ1/2

Here γij is the inverse spatial metric, and Λ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 with mab=δab],

(46)||E||=γijδabδcd(Λ2igacjgbd+iΠacjΠbd+γkliΦkacjΦlbd)γ1/2

Here γij is the inverse spatial metric, and Λ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 ],

Fa12gaiψbciΠbcgijiΠjagijtbiΦjba+12taψbcgijiΦjbc+tagijiHj+gaiΦijbgjkΦkcdψbdtc12gaiΦijbgjkΦkcdψcdtbgaitbiHb+gijΦicdΦjbaψbctd12tagijgmnΦimcΦnjdψcd14tagijΦicdΦjbeψcbψde+14taΠcdΠbeψcbψdegijHiΠjatbgijΠbiΠja14gaiΦicdtctdΠbeψbe+12taΠcdΠbeψcetdtb+gaiΦicdΠbetctbψdegijΦibatbΠjete12gijΦicdtctdΠjagijHiΦjbatb+gaiΦicdHbψbctd+γ2(gidCida12gaiψcdCicd)+12taΠcdψcdHbtbtagijΦijcHdψcd+12tagijHiΦjcdψcd(47)16πtaTab

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, gcb=δcb+tbtc, and Tab 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 tΠab. That dependence arises from (using to indicate collections of terms that are known to be independent of the stress-energy tensor):

Fa=α1(tCa),

where

Ca=Ha+gijΦija+tbΠba12gaiψbcΦibc12taψbcΠbc.

.

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 Ca 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 ],

Fa12gaiψbciΠbcgijiΠjagijtbiΦjba+12taψbcgijiΦjbc+tagijiHj+gaiΦijbgjkΦkcdψbdtc12gaiΦijbgjkΦkcdψcdtbgaitbiHb+gijΦicdΦjbaψbctd12tagijgmnΦimcΦnjdψcd14tagijΦicdΦjbeψcbψde+14taΠcdΠbeψcbψdegijHiΠjatbgijΠbiΠja14gaiΦicdtctdΠbeψbe+12taΠcdΠbeψcetdtb+gaiΦicdΠbetctbψdegijΦibatbΠjete12gijΦicdtctdΠjagijHiΦjbatb+gaiΦicdHbψbctd+γ2(gidCida12gaiψcdCicd)+12taΠcdψcdHbtbtagijΦijcHdψcd+12tagijHiΦjcdψcd(48)16πtaTab

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, gcb=δcb+tbtc, and Tab 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 tΠab. That dependence arises from (using to indicate collections of terms that are known to be independent of the stress-energy tensor):

Fa=α1(tCa),

where

Ca=Ha+gijΦija+tbΠba12gaiψbcΦibc12taψbcΠbc.

.

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 Ca 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 ],

Fa12gaiψbciΠbcgijiΠjagijtbiΦjba+12taψbcgijiΦjbc+tagijiHj+gaiΦijbgjkΦkcdψbdtc12gaiΦijbgjkΦkcdψcdtbgaitbiHb+gijΦicdΦjbaψbctd12tagijgmnΦimcΦnjdψcd14tagijΦicdΦjbeψcbψde+14taΠcdΠbeψcbψdegijHiΠjatbgijΠbiΠja14gaiΦicdtctdΠbeψbe+12taΠcdΠbeψcetdtb+gaiΦicdΠbetctbψdegijΦibatbΠjete12gijΦicdtctdΠjagijHiΦjbatb+gaiΦicdHbψbctd+γ2(gidCida12gaiψcdCicd)+12taΠcdψcdHbtbtagijΦijcHdψcd+12tagijHiΦjcdψcd(49)16πtaTab

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, gcb=δcb+tbtc, and Tab 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 tΠab. That dependence arises from (using to indicate collections of terms that are known to be independent of the stress-energy tensor):

Fa=α1(tCa),

where

Ca=Ha+gijΦija+tbΠba12gaiψbcΦibc12taψbcΠbc.

.

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 Ca 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 ],

Fa12gaiψbciΠbcgijiΠjagijtbiΦjba+12taψbcgijiΦjbc+tagijiHj+gaiΦijbgjkΦkcdψbdtc12gaiΦijbgjkΦkcdψcdtbgaitbiHb+gijΦicdΦjbaψbctd12tagijgmnΦimcΦnjdψcd14tagijΦicdΦjbeψcbψde+14taΠcdΠbeψcbψdegijHiΠjatbgijΠbiΠja14gaiΦicdtctdΠbeψbe+12taΠcdΠbeψcetdtb+gaiΦicdΠbetctbψdegijΦibatbΠjete12gijΦicdtctdΠjagijHiΦjbatb+gaiΦicdHbψbctd+γ2(gidCida12gaiψcdCicd)+12taΠcdψcdHbtbtagijΦijcHdψcd+12tagijHiΦjcdψcd(50)16πtaTab

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, gcb=δcb+tbtc, and Tab 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 tΠab. That dependence arises from (using to indicate collections of terms that are known to be independent of the stress-energy tensor):

Fa=α1(tCa),

where

Ca=Ha+gijΦija+tbΠba12gaiψbcΦibc12taψbcΠbc.

.

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 Ca 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 ,

(51)Cijab=2[iΦj]ab,

where Φiab=iψab. Because the constraint is antisymmetric on the two spatial indices, here we compute and store only the independent components of Cijab. Specifically, we compute

(52)Diab12ϵijkCjkab=ϵijkjΦkab,

where ϵijk is the flat-space Levi-Civita symbol, which is raised and lowered with the Kronecker delta. In terms of Diab, the full 4-index constraint is

(53)Cjkab=ϵijkDiab.

◆ 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 ,

(54)Cijab=2[iΦj]ab,

where Φiab=iψab. Because the constraint is antisymmetric on the two spatial indices, here we compute and store only the independent components of Cijab. Specifically, we compute

(55)Diab12ϵijkCjkab=ϵijkjΦkab,

where ϵijk is the flat-space Levi-Civita symbol, which is raised and lowered with the Kronecker delta. In terms of Diab, the full 4-index constraint is

(56)Cjkab=ϵijkDiab.

◆ 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 ],

Ca=Ha+gijΦija+tbΠba12gaiψbcΦibc12taψbcΠbc,

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, and gcb=δcb+tbtc.

◆ 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 ],

Ca=Ha+gijΦija+tbΠba12gaiψbcΦibc12taψbcΠbc,

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, and gcb=δcb+tbtc.

◆ 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, Ciab=iψabΦiab, which is given by Eq. (26) of

◆ 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, Ciab=iψabΦiab, which is given by Eq. (26) of

◆ 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 Γa from the generalized harmonic evolved variables.

Starting from Eq. (40) of we get

Γa=γijΦija+nbΠab12γiagbcΦibc12nagbcΠbcΓa=γijΦija+nbΠab12nagbc(niΦibc+Πbc)12δaigbcΦibc

◆ 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 Γa from the generalized harmonic evolved variables.

Starting from Eq. (40) of we get

Γa=γijΦija+nbΠab12γiagbcΦibc12nagbcΠbcΓa=γijΦija+nbΠab12nagbc(niΦibc+Πbc)12δaigbcΦibc

◆ 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 ],

CiagjkjΦika12gajψcdjΦicd+tbiΠba12taψcdiΠcd+iHa+12gajΦjcdΦiefψceψdf+12gjkΦjcdΦikeψcdtetagjkgmnΦjmaΦikn+12ΦicdΠbeta(ψcbψde+12ψbetctd)(57)ΦicdΠbatc(ψbd+12tbtd)+12γ2(taψcd2δactd)Cicd.

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, and gcb=δcb+tbtc.

◆ 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 ],

CiagjkjΦika12gajψcdjΦicd+tbiΠba12taψcdiΠcd+iHa+12gajΦjcdΦiefψceψdf+12gjkΦjcdΦikeψcdtetagjkgmnΦjmaΦikn+12ΦicdΠbeta(ψcbψde+12ψbetctd)(58)ΦicdΠbatc(ψbd+12tbtd)+12γ2(taψcd2δactd)Cicd.

where Ha is the gauge function, ψab is the spacetime metric, Πab=tccψab, and Φiab=iψab; ta is the timelike unit normal vector to the spatial slice, gij is the inverse spatial metric, and gcb=δcb+tbtc.