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

Computes the Ricci tensor and Ricci scalar from a 4D Riemann tensor. More...

#include <RicciTensor.hpp>

Collaboration diagram for tensorium_RG::RicciTensor< T >:

Public Types

using Tensor4D = tensorium::Tensor<T, 4>
 
using Tensor2D = tensorium::Tensor<T, 2>
 
using VectorT = tensorium::Vector<T>
 

Static Public Member Functions

static tensorium::Tensor< T, 2 > contract_to_ricci (const Tensor4D &Riemann, const tensorium::Tensor< T, 2 > &g_inv)
 Contracts a 4D Riemann tensor into the 2D Ricci tensor.
 
static double compute_ricci_scalar (const Tensor2D &Ricci, const tensorium::Tensor< T, 2 > &g_inv)
 Computes the Ricci scalar curvature.
 
static void print_componentwise (const Tensor2D &R, T threshold=1e-12)
 Prints the Ricci tensor components with optional zero threshold.
 
static void print (const Tensor2D &R, const std::string &name="Ricci")
 Prints only the non-zero components of the Ricci tensor.
 
static void print (const Tensor2D &R, const tensorium::Tensor< T, 2 > &g_inv, const std::string &name="Ricci")
 Prints non-zero components using both Ricci and inverse metric.
 
static void print_ricci_scalar (const Tensor2D &Ricci, const tensorium::Tensor< T, 2 > &g_inv)
 Computes and prints the Ricci scalar from the tensor and metric.
 

Detailed Description

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

Computes the Ricci tensor and Ricci scalar from a 4D Riemann tensor.

This class provides static methods to contract the Riemann tensor into the Ricci tensor, compute the scalar curvature, and print these results.

The Ricci tensor is obtained by contraction:

\[ R_{\mu\nu} = R^\rho_{\ \mu\rho\nu} = g^{\rho\sigma} R_{\rho\sigma\mu\nu} \]

The Ricci scalar is the trace:

\[ R = g^{\mu\nu} R_{\mu\nu} \]

Member Typedef Documentation

◆ Tensor2D

template<typename T >
using tensorium_RG::RicciTensor< T >::Tensor2D = tensorium::Tensor<T, 2>

◆ Tensor4D

template<typename T >
using tensorium_RG::RicciTensor< T >::Tensor4D = tensorium::Tensor<T, 4>

◆ VectorT

template<typename T >
using tensorium_RG::RicciTensor< T >::VectorT = tensorium::Vector<T>

Member Function Documentation

◆ compute_ricci_scalar()

template<typename T >
static double tensorium_RG::RicciTensor< T >::compute_ricci_scalar ( const Tensor2D & Ricci,
const tensorium::Tensor< T, 2 > & g_inv )
inlinestatic

Computes the Ricci scalar curvature.

Uses the trace formula: \( R = g^{\mu\nu} R_{\mu\nu} \)

Parameters
RicciThe Ricci tensor \( R_{\mu\nu} \)
g_invThe inverse metric \( g^{\mu\nu} \)
Returns
The scalar curvature \( R \)

References mu, and nu.

Referenced by tensorium::compute_ricci_scalar(), and tensorium_RG::RicciTensor< T >::print_ricci_scalar().

Here is the caller graph for this function:

◆ contract_to_ricci()

template<typename T >
static tensorium::Tensor< T, 2 > tensorium_RG::RicciTensor< T >::contract_to_ricci ( const Tensor4D & Riemann,
const tensorium::Tensor< T, 2 > & g_inv )
inlinestatic

Contracts a 4D Riemann tensor into the 2D Ricci tensor.

Uses the identity \( R_{\mu\nu} = g^{\rho\sigma} R_{\rho\sigma\mu\nu} \)

Parameters
RiemannThe Riemann tensor \( R_{\rho\sigma\mu\nu} \)
g_invThe inverse metric \( g^{\rho\sigma} \)
Returns
The Ricci tensor \( R_{\mu\nu} \)

References tensorium::Tensor< K, Rank >::fill(), mu, nu, rho, and sigma.

Referenced by tensorium::contract_riemann_to_ricci().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [1/2]

template<typename T >
static void tensorium_RG::RicciTensor< T >::print ( const Tensor2D & R,
const std::string & name = "Ricci" )
inlinestatic

Prints only the non-zero components of the Ricci tensor.

Parameters
RThe Ricci tensor
nameOptional tensor name label

References mu, and nu.

◆ print() [2/2]

template<typename T >
static void tensorium_RG::RicciTensor< T >::print ( const Tensor2D & R,
const tensorium::Tensor< T, 2 > & g_inv,
const std::string & name = "Ricci" )
inlinestatic

Prints non-zero components using both Ricci and inverse metric.

Parameters
RThe Ricci tensor
g_invThe inverse metric
nameOptional tensor name label

References mu, and nu.

◆ print_componentwise()

template<typename T >
static void tensorium_RG::RicciTensor< T >::print_componentwise ( const Tensor2D & R,
T threshold = 1e-12 )
inlinestatic

Prints the Ricci tensor components with optional zero threshold.

Parameters
RThe Ricci tensor
thresholdMinimum value to display (default = 1e-12)

References mu, and nu.

Referenced by tensorium::print_ricci_tensor().

Here is the caller graph for this function:

◆ print_ricci_scalar()

template<typename T >
static void tensorium_RG::RicciTensor< T >::print_ricci_scalar ( const Tensor2D & Ricci,
const tensorium::Tensor< T, 2 > & g_inv )
inlinestatic

Computes and prints the Ricci scalar from the tensor and metric.

Parameters
RicciThe Ricci tensor
g_invThe inverse metric

References tensorium_RG::RicciTensor< T >::compute_ricci_scalar().

Referenced by tensorium::print_ricci_scalar().

Here is the call graph for this function:
Here is the caller graph for this function:

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