Tensorium
Loading...
Searching...
No Matches
tensorium_RG::ChristoffelSym< T > Class Template Reference

Stores and computes Christoffel symbols \( \Gamma^\lambda_{\mu\nu} \). More...

#include <ChristoffelSymbol.hpp>

Collaboration diagram for tensorium_RG::ChristoffelSym< T >:

Public Member Functions

 ChristoffelSym (size_t dim)
 Construct a Christoffel symbol tensor.
 
T & operator() (size_t i, size_t j, size_t k, size_t l)
 Mutable access to component \( \Gamma^\lambda_{\mu\nu} \).
 
const T & operator() (size_t i, size_t j, size_t k, size_t l) const
 Const access to component \( \Gamma^\lambda_{\mu\nu} \).
 
void fill (T value)
 Fill all components with a constant value.
 
void print () const
 Print all non-zero Christoffel components to stdout.
 
 __attribute__ ((always_inline, hot, flatten)) static inline ChristoffelSym< T > compute_christoffel(const tensorium
 Compute Christoffel symbols numerically from a metric.
 

Public Attributes

aligned_vector< T > data
 
size_t dim
 

Static Public Attributes

static constexpr size_t rank = 4
 

Detailed Description

template<typename T>
class tensorium_RG::ChristoffelSym< T >

Stores and computes Christoffel symbols \( \Gamma^\lambda_{\mu\nu} \).

This class represents a tensor of Christoffel symbols for a 4D metric and supports:

  • Storage in a flattened aligned vector
  • Numerical computation from the metric via centered finite differences

The Christoffel symbols are given by:

\[ \Gamma^\lambda_{\mu\nu} = \frac{1}{2} g^{\lambda\kappa} \left( \partial_\mu g_{\nu\kappa} + \partial_\nu g_{\mu\kappa} - \partial_\kappa g_{\mu\nu} \right) \]

Template Parameters
TScalar type (e.g., float or double)

Constructor & Destructor Documentation

◆ ChristoffelSym()

template<typename T >
tensorium_RG::ChristoffelSym< T >::ChristoffelSym ( size_t dim)
inline

Construct a Christoffel symbol tensor.

Parameters
dimDimensionality of the space

Member Function Documentation

◆ __attribute__()

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

Compute Christoffel symbols numerically from a metric.

Uses centered finite differences on the metric tensor and contracts with \( g^{\mu\nu} \).

Parameters
XCoordinates \( X^\mu \)
hStep size
gMetric tensor \( g_{\mu\nu} \)
g_invInverse metric \( g^{\mu\nu} \)
metric_generatorA callable that generates \( g_{\mu\nu}(X) \)
Returns
Christoffel symbol tensor \( \Gamma^\lambda_{\mu\nu} \)

References tensorium_RG::ChristoffelSym< T >::dim, tensorium_RG::ChristoffelSym< T >::fill(), gamma, mu, nu, and X().

Here is the call graph for this function:

◆ fill()

template<typename T >
void tensorium_RG::ChristoffelSym< T >::fill ( T value)
inline

Fill all components with a constant value.

Parameters
valueValue to fill

References tensorium_RG::ChristoffelSym< T >::data.

Referenced by tensorium_RG::ChristoffelSym< T >::__attribute__().

Here is the caller graph for this function:

◆ operator()() [1/2]

template<typename T >
T & tensorium_RG::ChristoffelSym< T >::operator() ( size_t i,
size_t j,
size_t k,
size_t l )
inline

Mutable access to component \( \Gamma^\lambda_{\mu\nu} \).

References tensorium_RG::ChristoffelSym< T >::data, and tensorium_RG::ChristoffelSym< T >::dim.

◆ operator()() [2/2]

template<typename T >
const T & tensorium_RG::ChristoffelSym< T >::operator() ( size_t i,
size_t j,
size_t k,
size_t l ) const
inline

Const access to component \( \Gamma^\lambda_{\mu\nu} \).

References tensorium_RG::ChristoffelSym< T >::data, and tensorium_RG::ChristoffelSym< T >::dim.

◆ print()

template<typename T >
void tensorium_RG::ChristoffelSym< T >::print ( ) const
inline

Print all non-zero Christoffel components to stdout.

References tensorium_RG::ChristoffelSym< T >::dim.

Member Data Documentation

◆ data

◆ dim

◆ rank

template<typename T >
constexpr size_t tensorium_RG::ChristoffelSym< T >::rank = 4
staticconstexpr

The documentation for this class was generated from the following file: