tetrads.cu

Documentation for the file tetrads.cu. This file contains functions related to tetrad transformations.

Functions

Functions

__device__ void make_tetrad(double Ucon[NDIM], double trial[NDIM], const double Gcov[NDIM][NDIM], double Econ[NDIM][NDIM], double Ecov[NDIM][NDIM])

Constructs an orthonormal tetrad (local laboratory frame) for a moving observer.

A tetrad represents a local Minkowski frame \((e_{(0)}, e_{(1)}, e_{(2)}, e_{(3)})\) at a point in curved spacetime.

Note

This function uses the Gram-Schmidt process to orthogonalize a set of coordinate basis vectors against the fluid’s 4-velocity.

Parameters:
  • Ucon – The contravariant 4-velocity of the fluid/observer ( \(u^\mu\)).

  • trial – A trial vector used to define the first spatial direction (usually radial).

  • Gcov – The covariant metric tensor ( \(g_{\mu\nu}\)).

  • Econ – [Output] Contravariant tetrad \(e^\mu_{(a)}\). First index (k) is the tetrad label, second (l) is the coordinate index.

  • Ecov – [Output] Covariant tetrad \(e_{(a)\mu}\).

Returns:

void

__device__ void tetrad_to_coordinate(const double Econ[NDIM][NDIM], const double K_tetrad[NDIM], double K[NDIM])

Transforms a vector from the local tetrad (fluid) frame to the global coordinate frame.

This function performs a change of basis. Physical processes are calculated in the local orthonormal.

The transformation is defined by the sum: \( K^\mu = \sum_{a=0}^{3} e^\mu_{(a)} K^{(a)} \)

Parameters:
  • Econ – The contravariant tetrad basis vectors \( e^\mu_{(a)} \).

  • K_tetrad – The components of the vector in the local frame \( K^{(a)} \).

  • K – [Output] The components of the vector in the coordinate frame \( K^\mu \).

Returns:

void

__device__ void coordinate_to_tetrad(const double Ecov[NDIM][NDIM], const double K[NDIM], double K_tetrad[NDIM])

Projects a global coordinate vector into the local orthonormal tetrad (fluid) frame. This is the inverse operation of tetrad_to_coordinate. It is used to “measure” global quantities from the perspective of a local observer moving with the fluid.

The projection is defined by the inner product of the coordinate vector with the covariant tetrad basis: \( K^{(a)} = e_{(a)\mu} K^\mu \)

Parameters:
  • Ecov – The covariant tetrad basis vectors \( e_{(a)\mu} \).

  • K – The components of the vector in the coordinate frame \( K^\mu \).

  • K_tetrad – [Output] The components of the vector in the local frame \( K^{(a)} \).

Returns:

void

__device__ double delta(int i, int j)

Implements the Kronecker delta function \( \delta_{ij} \).

Parameters:
  • i – Row or vector index.

  • j – Column or reference index.

Returns:

1.0 if i == j, otherwise 0.0.

__device__ void normalize(double *vcon, const double Gcov[NDIM][NDIM])

Normalizes a contravariant 4-vector to unit length in curved spacetime.

It follows the expression in General Relativity:

\( V^\mu_{\rm norm} = \frac{V^\mu}{\sqrt{\sum^4_{\mu = 0} \sum^4_{\nu = 0} g_{\mu\nu} V^\mu V^\nu}} \)

Parameters:
  • vcon – The contravariant vector \(v^\mu\) to be normalized (modified in-place).

  • Gcov – The covariant metric tensor \(g_{\mu\nu}\) at the vector’s location.

Returns:

void

__device__ void project_out(double *vcona, double *vconb, const double Gcov[NDIM][NDIM])

Projects one vector out of another to ensure orthogonality in curved spacetime. This is used during the Gram-Schmidt process. It modifies vector ‘a’ such that it becomes perpendicular to vector ‘b’. This orthogonality is defined via the metric tensor: \(g_{\mu\nu} A^\mu B^\nu = 0\).

Parameters:
  • vcona – The vector to be modified ( \(A^\mu\)). After the call, it will be orthogonal to vconb.

  • vconb – The reference vector ( \(B^\mu\)) to project against.

  • Gcov – The covariant metric tensor ( \(g_{\mu\nu}\)).

Returns:

void