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

Namespaces

namespace  solver
 Namespace containing linear system solvers.
namespace  mpi

Classes

class  GemmKernelBig
class  MatrixKernel
 MatrixKernel provides specialized SIMD-accelerated matrix multiplication routines for statically-sized square matrices. More...
class  CacheInfo
class  Derivate
 A 2D aligned matrix for numerical derivatives. More...
class  DerivateND
 A multi-dimensional aligned tensor for numerical derivatives. More...
class  Matrix
 High-performance aligned matrix class with SIMD support. More...
class  SpectralFFT
 Fast Fourier Transform (FFT) implementation using Cooley–Tukey algorithm. More...
class  SpectalChebyshev
 Placeholder Chebyshev spectral method class. More...
class  Tensor
 Multi-dimensional tensor class with fixed rank and SIMD support. More...
class  Vector
 Aligned, SIMD-optimized mathematical vector class for scientific computing. More...
struct  TensorTraits
struct  TensorTraits< Tensor< T, Rank > >
struct  TensorTraits< Vector< T > >

Functions

template<typename Container>
Container richardson_derivative_container (const Container &plus_h, const Container &minus_h, const Container &plus_half_h, const Container &minus_half_h, double h)
 Richardson extrapolation for vectors or containers.
template<typename T>
richardson_derivative (const T &plus_h, const T &minus_h, const T &plus_half_h, const T &minus_half_h, double h)
 Richardson extrapolation for scalar values.
template<typename K, bool RM>
Matrix< K, RM > operator+ (const Matrix< K, RM > &a, const Matrix< K, RM > &b)
template<typename K, bool RM>
Matrix< K, RM > operator- (const Matrix< K, RM > &a, const Matrix< K, RM > &b)
template<typename K, bool RM>
Matrix< K, RM > operator* (const Matrix< K, RM > &a, const Matrix< K, RM > &b)
template<typename K, bool RM>
Matrix< K, RM > operator* (const Matrix< K, RM > &m, K alpha)
template<typename K, bool RM>
Matrix< K, RM > operator* (K alpha, const Matrix< K, RM > &m)
template<typename K>
Vector< K > operator+ (const Vector< K > &a, const Vector< K > &b)
template<typename K>
Vector< K > operator- (const Vector< K > &a, const Vector< K > &b)
template<typename T>
Vector< T > add_vec (const Vector< T > &a, const Vector< T > &b)
template<typename T>
Vector< T > sub_vec (const Vector< T > &a, const Vector< T > &b)
template<typename T>
Vector< T > scl_vec (const Vector< T > &a, T scalar)
template<typename T>
norm1_vec (const Vector< T > &a)
template<typename T>
norm2_vec (const Vector< T > &a)
template<typename T>
normInf_vec (const Vector< T > &a)
template<typename T>
dot_vec (const Vector< T > &a, const Vector< T > &b)
template<typename T>
cosine_vec (const Vector< T > &a, const Vector< T > &b)
template<typename T>
Vector< T > lerp_vec (const Vector< T > &a, const Vector< T > &b, T t)
template<typename T>
Vector< T > linear_combination_vec (const std::vector< Vector< T > > &u, const std::vector< T > &coef)
template<typename T>
Vector< T > cross_vec (const Vector< T > &a, const Vector< T > &b)
template<typename T>
Matrix< T > add_mat (const Matrix< T > &A, const Matrix< T > &B)
template<typename T>
Matrix< T > sub_mat (const Matrix< T > &A, const Matrix< T > &B)
template<typename T>
Matrix< T > scl_mat (const Matrix< T > &A, T scalar)
template<typename T>
Matrix< T > lerp_mat (const Matrix< T > &A, const Matrix< T > &B, T t)
template<typename T>
Matrix< T > mul_mat (const Matrix< T > &A, const Matrix< T > &B)
template<typename T>
Matrix< T > transpose_mat (const Matrix< T > &A)
template<typename T>
Matrix< T > trace_mat (const Matrix< T > &A)
template<typename T>
Vector< T > mul_vec (const Matrix< T > &A, const Vector< T > &x)
template<typename T>
Matrix< T > inverse_mat (const Matrix< T > &A)
template<typename T>
det_mat (const Matrix< T > &A)
template<typename T>
size_t rank_mat (const Matrix< T > &A)
template<typename K, std::size_t Rank>
Tensor< K, Rank > transpose_tensor (const Tensor< K, Rank > &T)
template<typename K, size_t R1, size_t R2>
Tensor< K, R1+R2 > mul_tensor (const Tensor< K, R1 > &A, const Tensor< K, R2 > &B)
template<size_t I, size_t J, typename K, std::size_t Rank>
Tensor< K, Rank - 2 > contract_tensor (const Tensor< K, Rank > &T)
template<typename T>
Vector< T > gauss_solve (const Matrix< T > &A, const Vector< T > &b)
template<typename T>
Vector< T > jacobi_solve (const Matrix< T > &A, const Vector< T > &b, T tol=1e-6, int max_iter=1000)
template<typename T>
void row_echelon (Matrix< T > &A, Vector< T > *b=nullptr, T eps=T(1e-12))
template<typename K>
void centered_derivative (const Derivate< K > &input, Derivate< K > &output, size_t axis, K dx)
template<typename K>
void centered_derivative_order4 (const Derivate< K > &input, Derivate< K > &output, size_t axis, K dx)
template<typename K, size_t Rank>
void centered_derivative (const DerivateND< K, Rank > &input, DerivateND< K, Rank > &output, size_t axis, K dx)
template<typename K, size_t Rank>
void centered_derivative_order4 (const DerivateND< K, Rank > &input, DerivateND< K, Rank > &output, size_t axis, K dx)
template<typename T>
void forwardFFT (tensorium::Vector< std::complex< T > > &data)
template<typename T>
void backwardFFT (tensorium::Vector< std::complex< T > > &data)
template<typename T>
void backwardFFP (tensorium::Vector< std::complex< T > > &data)
template<typename T>
tensorium::Tensor< T, 2 > inv_mat_tensor (const tensorium::Tensor< T, 2 > &g)
template<typename T>
Matrix< T > tensor_to_matrix (const Tensor< T, 2 > &tensor)
template<typename T>
Tensor< T, 2 > matrix_to_tensor (const Matrix< T > &mat)
template<typename T, typename MetricFunc>
tensorium_RG::ChristoffelSym< T > compute_christoffel (const tensorium::Vector< T > &X, T h, const tensorium::Tensor< T, 2 > &g, const tensorium::Tensor< T, 2 > &g_inv, MetricFunc &&metric_generator)
template<typename T>
void generate_metric (const tensorium_RG::Metric< T > &metric, const Vector< T > &X, Tensor< T, 2 > &g)
template<typename T>
tensorium::Tensor< T, 4 > compute_riemann_tensor (const tensorium::Vector< T > &X, T h, const tensorium_RG::Metric< T > &metric)
template<typename T>
void print_riemann_tensor (const tensorium::Tensor< T, 4 > &R)
template<typename T>
Tensor< T, 2 > contract_riemann_to_ricci (const Tensor< T, 4 > &R, const Tensor< T, 2 > &ginv)
template<typename T>
compute_ricci_scalar (const Tensor< T, 2 > &Ricci, const Tensor< T, 2 > &ginv)
template<typename T>
void print_ricci_tensor (const Tensor< T, 2 > &R)
template<typename T>
void print_ricci_scalar (const Tensor< T, 2 > &Ricci, const Tensor< T, 2 > &g_inv)
template<typename T>
compute_conformal_factor (const tensorium_RG::Metric< T > &metric, const Tensor< T, 2 > &gamma)
template<typename T>
Tensor< T, 2 > compute_conformal_metric (const tensorium_RG::Metric< T > &metric, const Tensor< T, 2 > &gamma, T chi)
template<typename T>
void compute_christoffel_3D (const Tensor< T, 2 > &gamma_tilde, const Tensor< T, 3 > &dgamma_tilde, const Tensor< T, 2 > &gamma_tilde_inv, Tensor< T, 3 > &Christoffel)
template<typename T>
void compute_christoffel_3D_Grid (const Tensor< T, 5 > &gamma_tilde, const Tensor< T, 6 > &dgamma_tilde, const Tensor< T, 5 > &gamma_tilde_inv, Tensor< T, 6 > &Christoffel)
template<typename T>
tensorium_RG::BSSN< T > setup_BSSN (const Vector< T > &X, const tensorium_RG::Metric< T > &metric, T dx, T dy, T dz, T dt)
template<typename T>
tensorium_RG::BSSN< T > setup_BSSN (const Vector< T > &X, const tensorium_RG::Metric< T > &metric, T dx, T dy, T dz)

Function Documentation

◆ add_mat()

template<typename T>
Matrix< T > tensorium::add_mat ( const Matrix< T > & A,
const Matrix< T > & B )

References tensorium::Matrix< K, RowMajor >::add().

Here is the call graph for this function:

◆ add_vec()

template<typename T>
Vector< T > tensorium::add_vec ( const Vector< T > & a,
const Vector< T > & b )

◆ backwardFFP()

template<typename T>
void tensorium::backwardFFP ( tensorium::Vector< std::complex< T > > & data)
inline

References tensorium::SpectralFFT< T >::backward().

Here is the call graph for this function:

◆ backwardFFT()

template<typename T>
void tensorium::backwardFFT ( tensorium::Vector< std::complex< T > > & data)
inline

References tensorium::SpectralFFT< T >::backward().

Here is the call graph for this function:

◆ centered_derivative() [1/2]

template<typename K>
void tensorium::centered_derivative ( const Derivate< K > & input,
Derivate< K > & output,
size_t axis,
K dx )
inline

◆ centered_derivative() [2/2]

template<typename K, size_t Rank>
void tensorium::centered_derivative ( const DerivateND< K, Rank > & input,
DerivateND< K, Rank > & output,
size_t axis,
K dx )
inline

◆ centered_derivative_order4() [1/2]

template<typename K>
void tensorium::centered_derivative_order4 ( const Derivate< K > & input,
Derivate< K > & output,
size_t axis,
K dx )
inline

References centered_derivative_order4().

Referenced by centered_derivative_order4().

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

◆ centered_derivative_order4() [2/2]

template<typename K, size_t Rank>
void tensorium::centered_derivative_order4 ( const DerivateND< K, Rank > & input,
DerivateND< K, Rank > & output,
size_t axis,
K dx )
inline

◆ compute_christoffel()

template<typename T, typename MetricFunc>
tensorium_RG::ChristoffelSym< T > tensorium::compute_christoffel ( const tensorium::Vector< T > & X,
T h,
const tensorium::Tensor< T, 2 > & g,
const tensorium::Tensor< T, 2 > & g_inv,
MetricFunc && metric_generator )

References X().

Here is the call graph for this function:

◆ compute_christoffel_3D()

template<typename T>
void tensorium::compute_christoffel_3D ( const Tensor< T, 2 > & gamma_tilde,
const Tensor< T, 3 > & dgamma_tilde,
const Tensor< T, 2 > & gamma_tilde_inv,
Tensor< T, 3 > & Christoffel )
inline

References tensorium_RG::BSSNChristoffel< T >::compute().

Here is the call graph for this function:

◆ compute_christoffel_3D_Grid()

template<typename T>
void tensorium::compute_christoffel_3D_Grid ( const Tensor< T, 5 > & gamma_tilde,
const Tensor< T, 6 > & dgamma_tilde,
const Tensor< T, 5 > & gamma_tilde_inv,
Tensor< T, 6 > & Christoffel )
inline

References tensorium_RG::BSSNChristoffel< T >::compute3D().

Here is the call graph for this function:

◆ compute_conformal_factor()

template<typename T>
T tensorium::compute_conformal_factor ( const tensorium_RG::Metric< T > & metric,
const Tensor< T, 2 > & gamma )
inline

References tensorium_RG::Metric< T >::compute_conformal_factor().

Referenced by tensorium_RG::ChiContext< T >::compute(), and tensorium_RG::RicciTildeTensor< T >::compute_laplacian_term().

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

◆ compute_conformal_metric()

template<typename T>
Tensor< T, 2 > tensorium::compute_conformal_metric ( const tensorium_RG::Metric< T > & metric,
const Tensor< T, 2 > & gamma,
T chi )
inline

References tensorium_RG::Metric< T >::compute_conformal_metric().

Referenced by tensorium_RG::RicciTildeTensor< T >::compute_laplacian_term().

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

◆ compute_ricci_scalar()

template<typename T>
T tensorium::compute_ricci_scalar ( const Tensor< T, 2 > & Ricci,
const Tensor< T, 2 > & ginv )
inline

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

Here is the call graph for this function:

◆ compute_riemann_tensor()

template<typename T>
tensorium::Tensor< T, 4 > tensorium::compute_riemann_tensor ( const tensorium::Vector< T > & X,
T h,
const tensorium_RG::Metric< T > & metric )
inline

References tensorium_RG::RiemannTensor< T >::compute(), and X().

Here is the call graph for this function:

◆ contract_riemann_to_ricci()

template<typename T>
Tensor< T, 2 > tensorium::contract_riemann_to_ricci ( const Tensor< T, 4 > & R,
const Tensor< T, 2 > & ginv )
inline

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

Here is the call graph for this function:

◆ contract_tensor()

template<size_t I, size_t J, typename K, std::size_t Rank>
Tensor< K, Rank - 2 > tensorium::contract_tensor ( const Tensor< K, Rank > & T)

References contract_tensor().

Referenced by contract_tensor().

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

◆ cosine_vec()

template<typename T>
T tensorium::cosine_vec ( const Vector< T > & a,
const Vector< T > & b )

◆ cross_vec()

template<typename T>
Vector< T > tensorium::cross_vec ( const Vector< T > & a,
const Vector< T > & b )

◆ det_mat()

template<typename T>
T tensorium::det_mat ( const Matrix< T > & A)

References tensorium::Matrix< K, RowMajor >::det().

Here is the call graph for this function:

◆ dot_vec()

template<typename T>
T tensorium::dot_vec ( const Vector< T > & a,
const Vector< T > & b )

◆ forwardFFT()

template<typename T>
void tensorium::forwardFFT ( tensorium::Vector< std::complex< T > > & data)
inline

References tensorium::SpectralFFT< T >::forward().

Here is the call graph for this function:

◆ gauss_solve()

template<typename T>
Vector< T > tensorium::gauss_solve ( const Matrix< T > & A,
const Vector< T > & b )

◆ generate_metric()

template<typename T>
void tensorium::generate_metric ( const tensorium_RG::Metric< T > & metric,
const Vector< T > & X,
Tensor< T, 2 > & g )

References X().

Here is the call graph for this function:

◆ inv_mat_tensor()

template<typename T>
tensorium::Tensor< T, 2 > tensorium::inv_mat_tensor ( const tensorium::Tensor< T, 2 > & g)

References tensorium::Matrix< K, RowMajor >::inverse(), matrix_to_tensor(), and tensor_to_matrix().

Here is the call graph for this function:

◆ inverse_mat()

template<typename T>
Matrix< T > tensorium::inverse_mat ( const Matrix< T > & A)

References tensorium::Matrix< K, RowMajor >::inverse().

Here is the call graph for this function:

◆ jacobi_solve()

template<typename T>
Vector< T > tensorium::jacobi_solve ( const Matrix< T > & A,
const Vector< T > & b,
T tol = 1e-6,
int max_iter = 1000 )

References tensorium::solver::Jacobi< K >::solve().

Here is the call graph for this function:

◆ lerp_mat()

template<typename T>
Matrix< T > tensorium::lerp_mat ( const Matrix< T > & A,
const Matrix< T > & B,
T t )

References tensorium::Matrix< K, RowMajor >::cols, tensorium::Matrix< K, RowMajor >::lerp(), and tensorium::Matrix< K, RowMajor >::rows.

Here is the call graph for this function:

◆ lerp_vec()

template<typename T>
Vector< T > tensorium::lerp_vec ( const Vector< T > & a,
const Vector< T > & b,
T t )

◆ linear_combination_vec()

template<typename T>
Vector< T > tensorium::linear_combination_vec ( const std::vector< Vector< T > > & u,
const std::vector< T > & coef )

◆ matrix_to_tensor()

template<typename T>
Tensor< T, 2 > tensorium::matrix_to_tensor ( const Matrix< T > & mat)

References tensorium::Matrix< K, RowMajor >::cols, and tensorium::Matrix< K, RowMajor >::rows.

Referenced by inv_mat_tensor().

Here is the caller graph for this function:

◆ mul_mat()

template<typename T>
Matrix< T > tensorium::mul_mat ( const Matrix< T > & A,
const Matrix< T > & B )

◆ mul_tensor()

template<typename K, size_t R1, size_t R2>
Tensor< K, R1+R2 > tensorium::mul_tensor ( const Tensor< K, R1 > & A,
const Tensor< K, R2 > & B )
inline

◆ mul_vec()

template<typename T>
Vector< T > tensorium::mul_vec ( const Matrix< T > & A,
const Vector< T > & x )

References tensorium::Matrix< K, RowMajor >::mul_vec().

Here is the call graph for this function:

◆ norm1_vec()

template<typename T>
T tensorium::norm1_vec ( const Vector< T > & a)

◆ norm2_vec()

template<typename T>
T tensorium::norm2_vec ( const Vector< T > & a)

◆ normInf_vec()

template<typename T>
T tensorium::normInf_vec ( const Vector< T > & a)

◆ operator*() [1/3]

template<typename K, bool RM>
Matrix< K, RM > tensorium::operator* ( const Matrix< K, RM > & a,
const Matrix< K, RM > & b )

References tensorium::Matrix< K, RowMajor >::_mul_mat().

Here is the call graph for this function:

◆ operator*() [2/3]

template<typename K, bool RM>
Matrix< K, RM > tensorium::operator* ( const Matrix< K, RM > & m,
K alpha )

References tensorium::Matrix< K, RowMajor >::scl().

Here is the call graph for this function:

◆ operator*() [3/3]

template<typename K, bool RM>
Matrix< K, RM > tensorium::operator* ( K alpha,
const Matrix< K, RM > & m )

◆ operator+() [1/2]

template<typename K, bool RM>
Matrix< K, RM > tensorium::operator+ ( const Matrix< K, RM > & a,
const Matrix< K, RM > & b )

References tensorium::Matrix< K, RowMajor >::add().

Here is the call graph for this function:

◆ operator+() [2/2]

template<typename K>
Vector< K > tensorium::operator+ ( const Vector< K > & a,
const Vector< K > & b )
inline

References tensorium::Vector< K >::size().

Here is the call graph for this function:

◆ operator-() [1/2]

template<typename K, bool RM>
Matrix< K, RM > tensorium::operator- ( const Matrix< K, RM > & a,
const Matrix< K, RM > & b )

References tensorium::Matrix< K, RowMajor >::sub().

Here is the call graph for this function:

◆ operator-() [2/2]

template<typename K>
Vector< K > tensorium::operator- ( const Vector< K > & a,
const Vector< K > & b )
inline

References tensorium::Vector< K >::size().

Here is the call graph for this function:

◆ print_ricci_scalar()

template<typename T>
void tensorium::print_ricci_scalar ( const Tensor< T, 2 > & Ricci,
const Tensor< T, 2 > & g_inv )
inline

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

Here is the call graph for this function:

◆ print_ricci_tensor()

template<typename T>
void tensorium::print_ricci_tensor ( const Tensor< T, 2 > & R)
inline

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

Here is the call graph for this function:

◆ print_riemann_tensor()

template<typename T>
void tensorium::print_riemann_tensor ( const tensorium::Tensor< T, 4 > & R)
inline

References tensorium_RG::RiemannTensor< T >::print_componentwise().

Here is the call graph for this function:

◆ rank_mat()

template<typename T>
size_t tensorium::rank_mat ( const Matrix< T > & A)

References tensorium::Matrix< K, RowMajor >::rank().

Here is the call graph for this function:

◆ richardson_derivative()

template<typename T>
T tensorium::richardson_derivative ( const T & plus_h,
const T & minus_h,
const T & plus_half_h,
const T & minus_half_h,
double h )
inline

Richardson extrapolation for scalar values.

Template Parameters
TScalar type.
Parameters
plus_hf(x + h)
minus_hf(x - h)
plus_half_hf(x + h/2)
minus_half_hf(x - h/2)
hStep size.
Returns
Richardson-extrapolated scalar derivative.

Referenced by tensorium_RG::RiemannTensor< T >::compute().

Here is the caller graph for this function:

◆ richardson_derivative_container()

template<typename Container>
Container tensorium::richardson_derivative_container ( const Container & plus_h,
const Container & minus_h,
const Container & plus_half_h,
const Container & minus_half_h,
double h )
inline

Richardson extrapolation for vectors or containers.

Template Parameters
ContainerVector-like container type.
Parameters
plus_hf(x + h)
minus_hf(x - h)
plus_half_hf(x + h/2)
minus_half_hf(x - h/2)
hStep size.
Returns
Richardson-extrapolated derivative.

◆ row_echelon()

template<typename T>
void tensorium::row_echelon ( Matrix< T > & A,
Vector< T > * b = nullptr,
T eps = T(1e-12) )
inline

References tensorium::solver::Gauss< K >::raw_row_echelon().

Here is the call graph for this function:

◆ scl_mat()

template<typename T>
Matrix< T > tensorium::scl_mat ( const Matrix< T > & A,
T scalar )

References tensorium::Matrix< K, RowMajor >::scl().

Here is the call graph for this function:

◆ scl_vec()

template<typename T>
Vector< T > tensorium::scl_vec ( const Vector< T > & a,
T scalar )

◆ setup_BSSN() [1/2]

template<typename T>
tensorium_RG::BSSN< T > tensorium::setup_BSSN ( const Vector< T > & X,
const tensorium_RG::Metric< T > & metric,
T dx,
T dy,
T dz )
inline

References setup_BSSN(), and X().

Here is the call graph for this function:

◆ setup_BSSN() [2/2]

template<typename T>
tensorium_RG::BSSN< T > tensorium::setup_BSSN ( const Vector< T > & X,
const tensorium_RG::Metric< T > & metric,
T dx,
T dy,
T dz,
T dt )
inline

References tensorium_RG::BSSN< T >::init_BSSN(), and X().

Referenced by setup_BSSN().

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

◆ sub_mat()

template<typename T>
Matrix< T > tensorium::sub_mat ( const Matrix< T > & A,
const Matrix< T > & B )

References tensorium::Matrix< K, RowMajor >::sub().

Here is the call graph for this function:

◆ sub_vec()

template<typename T>
Vector< T > tensorium::sub_vec ( const Vector< T > & a,
const Vector< T > & b )

◆ tensor_to_matrix()

template<typename T>
Matrix< T > tensorium::tensor_to_matrix ( const Tensor< T, 2 > & tensor)

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

Referenced by inv_mat_tensor().

Here is the caller graph for this function:

◆ trace_mat()

template<typename T>
Matrix< T > tensorium::trace_mat ( const Matrix< T > & A)

References tensorium::Matrix< K, RowMajor >::trace().

Here is the call graph for this function:

◆ transpose_mat()

template<typename T>
Matrix< T > tensorium::transpose_mat ( const Matrix< T > & A)

References tensorium::Matrix< K, RowMajor >::transpose().

Here is the call graph for this function:

◆ transpose_tensor()

template<typename K, std::size_t Rank>
Tensor< K, Rank > tensorium::transpose_tensor ( const Tensor< K, Rank > & T)

References tensorium::Tensor< K, Rank >::transpose_simd().

Here is the call graph for this function: