Tensorium
|
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. | |
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.
T | Scalar type |
g | Metric tensor \( g_{\mu\nu} \) |
Used in numerical relativity to evaluate derivatives of Christoffel symbols.
T | Scalar type |
X | Base coordinate |
direction | Axis of offset |
offset | Value to add (positive or negative) |
h | Finite difference step size |
g | Output metric tensor |
g_inv | Output inverse metric |
Gamma_out | Output Christoffel tensor |
metric | Metric object |
References tensorium::Tensor< K, Rank >::dimensions.
|
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} \]
gamma_field | Field of type Tensor<T, 5> with dimensions [Nx, Ny, Nz, 3, 3] |
i,j,k | Grid position |
dx,dy,dz | Grid spacings |
dgamma_out | Output tensor \( \partial_k \tilde{\gamma}_{ij} \) |
References tensorium::Tensor< K, Rank >::resize(), and tensorium::Tensor< K, Rank >::shape().
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().
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().
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} \]
T | Scalar type (typically double ) |
metric | A metric object providing BSSN(X, α, β, γ) and compute_conformal_factor(γ) |
Nx,Ny,Nz | Grid resolution in x, y, z directions |
dx,dy,dz | Grid spacings in x, y, z directions |
< 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().