Tensorium
Loading...
Searching...
No Matches
tensorium_RG Namespace Reference

Classes

class  BSSN
 Driver class to initialize and store BSSN variables from an input spacetime metric. More...
 
class  BSSNAtildeTensor
 Computes the trace-free conformal extrinsic curvature tensor \( \tilde{A}_{ij} \) in the BSSN formalism. More...
 
class  BSSNChristoffel
 Compute the conformal Christoffel symbols \( \tilde{\Gamma}^k_{ij} \). More...
 
struct  BSSNGrid
 Storage structure for all evolved BSSN variables on a single grid point or patch. More...
 
class  ChristoffelSym
 Stores and computes Christoffel symbols \( \Gamma^\lambda_{\mu\nu} \). More...
 
class  ExtrinsicCurvature
 Computes the extrinsic curvature tensor \( K_{ij} \) from BSSN variables. More...
 
class  Metric
 A callable 4D metric class for general relativity (Minkowski, Schwarzschild, Kerr, etc.) More...
 
class  RicciTensor
 Computes the Ricci tensor and Ricci scalar from a 4D Riemann tensor. More...
 
class  RiemannTensor
 Computes the 4D Riemann curvature tensor \( R^\rho_{\ \sigma\mu\nu} \). More...
 
class  TildeGamma
 Computes the contracted conformal Christoffel vector \( \tilde{\Gamma}^i \). More...
 

Functions

template<typename T >
void compute_partial_derivatives_3D (const tensorium::Tensor< T, 5 > &gamma_field, size_t i, size_t j, size_t k, T dx, T dy, T dz, tensorium::Tensor< T, 3 > &dgamma_out)
 Compute the 3D partial derivatives \( \partial_k \tilde{\gamma}_{ij} \) from a 5D field tensor.
 
template<typename T , typename TensorFunc >
void compute_partial_derivatives_tensor2D (const tensorium::Vector< T > &X, T dx, T dy, T dz, TensorFunc &&func, tensorium::Tensor< T, 3 > &out)
 
template<typename T , typename VectorFunc >
void compute_partial_derivatives_vector (const tensorium::Vector< T > &X, T dx, T dy, T dz, VectorFunc &&func, tensorium::Tensor< T, 2 > &out)
 
template<typename T >
tensorium::Tensor< T, 5 > generate_conformal_metric_field (const tensorium_RG::Metric< T > &metric, size_t Nx, size_t Ny, size_t Nz, T dx, T dy, T dz)
 Generate the conformal 3-metric field \( \tilde{\gamma}_{ij}(x^i) \) on a 3D grid.
 
template<typename T >
 __attribute__ ((always_inline, hot, flatten)) inline tensorium
 Compute the inverse of a 2D metric tensor using local matrix inversion.
 

Function Documentation

◆ __attribute__()

template<typename T >
tensorium_RG::__attribute__ ( (always_inline, hot, flatten) )

Compute the inverse of a 2D metric tensor using local matrix inversion.

Compute Christoffel symbols at an offset position along one direction.

Converts the tensor to a matrix, computes the inverse, and converts back.

Template Parameters
TScalar type
Parameters
gMetric tensor \( g_{\mu\nu} \)
Returns
Inverse tensor \( g^{\mu\nu} \)

Used in numerical relativity to evaluate derivatives of Christoffel symbols.

Template Parameters
TScalar type
Parameters
XBase coordinate
directionAxis of offset
offsetValue to add (positive or negative)
hFinite difference step size
gOutput metric tensor
g_invOutput inverse metric
Gamma_outOutput Christoffel tensor
metricMetric object

References tensorium::Tensor< K, Rank >::dimensions.

◆ compute_partial_derivatives_3D()

template<typename T >
void tensorium_RG::compute_partial_derivatives_3D ( const tensorium::Tensor< T, 5 > & gamma_field,
size_t i,
size_t j,
size_t k,
T dx,
T dy,
T dz,
tensorium::Tensor< T, 3 > & dgamma_out )
inline

Compute the 3D partial derivatives \( \partial_k \tilde{\gamma}_{ij} \) from a 5D field tensor.

Uses centered 4th-order or 2nd-order finite differences for inner and boundary points.

\[ \partial_k \tilde{\gamma}_{ij} = \begin{cases} \frac{-f(x+2h) + 8f(x+h) - 8f(x-h) + f(x-2h)}{12h} & \text{if inner} \\ \frac{f(x+h) - f(x-h)}{2h} & \text{if near boundary} \\ 0 & \text{otherwise} \end{cases} \]

Parameters
gamma_fieldField of type Tensor<T, 5> with dimensions [Nx, Ny, Nz, 3, 3]
i,j,kGrid position
dx,dy,dzGrid spacings
dgamma_outOutput tensor \( \partial_k \tilde{\gamma}_{ij} \)

References tensorium::Tensor< K, Rank >::resize(), and tensorium::Tensor< K, Rank >::shape().

Here is the call graph for this function:

◆ compute_partial_derivatives_tensor2D()

template<typename T , typename TensorFunc >
void tensorium_RG::compute_partial_derivatives_tensor2D ( const tensorium::Vector< T > & X,
T dx,
T dy,
T dz,
TensorFunc && func,
tensorium::Tensor< T, 3 > & out )

References tensorium::Tensor< K, Rank >::resize(), and X().

Here is the call graph for this function:

◆ compute_partial_derivatives_vector()

template<typename T , typename VectorFunc >
void tensorium_RG::compute_partial_derivatives_vector ( const tensorium::Vector< T > & X,
T dx,
T dy,
T dz,
VectorFunc && func,
tensorium::Tensor< T, 2 > & out )

References tensorium::Tensor< K, Rank >::resize(), and X().

Here is the call graph for this function:

◆ generate_conformal_metric_field()

template<typename T >
tensorium::Tensor< T, 5 > tensorium_RG::generate_conformal_metric_field ( const tensorium_RG::Metric< T > & metric,
size_t Nx,
size_t Ny,
size_t Nz,
T dx,
T dy,
T dz )

Generate the conformal 3-metric field \( \tilde{\gamma}_{ij}(x^i) \) on a 3D grid.

For each spatial grid point \( (x, y, z) \), the spatial metric \( \gamma_{ij} \) is extracted from the given metric, the conformal factor \( \chi \) is computed, and the conformal metric is defined as:

\[ \tilde{\gamma}_{ij} = \chi \, \gamma_{ij} \]

Template Parameters
TScalar type (typically double)
Parameters
metricA metric object providing BSSN(X, α, β, γ) and compute_conformal_factor(γ)
Nx,Ny,NzGrid resolution in x, y, z directions
dx,dy,dzGrid spacings in x, y, z directions
Returns
A 5D tensor with shape \( (N_x, N_y, N_z, 3, 3) \) containing \( \tilde{\gamma}_{ij} \) at each grid point

< Coordinates X^μ = (t, x, y, z)

< Time is fixed at t = 0

References alpha, beta, tensorium_RG::Metric< T >::BSSN(), chi, tensorium_RG::Metric< T >::compute_conformal_factor(), tensorium_RG::Metric< T >::compute_conformal_metric(), gamma, and X().

Here is the call graph for this function: