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

Namespaces

namespace  mpi
 
namespace  solver
 Namespace containing linear system solvers.
 

Classes

struct  ASTNode
 
struct  avx2_t
 
class  CacheInfo
 
class  Derivate
 A 2D aligned matrix for numerical derivatives. More...
 
class  DerivateND
 A multi-dimensional aligned tensor for numerical derivatives. More...
 
class  GemmKernelBig
 
class  GemmKernelBigger
 
class  Matrix
 High-performance aligned matrix class with SIMD support. More...
 
class  MatrixKernel
 MatrixKernel provides specialized SIMD-accelerated matrix multiplication routines for statically-sized square matrices. More...
 
class  Parser
 
class  SpectalChebyshev
 Placeholder Chebyshev spectral method class. More...
 
class  SpectralFFT
 Fast Fourier Transform (FFT) implementation using Cooley–Tukey algorithm. 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...
 

Enumerations

enum class  ASTNodeType {
  Number , Symbol , BinaryOp , UnaryOp ,
  FunctionCall , Subscript , Superscript , Derivative ,
  Integral , TensorSymbol
}
 

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 >
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 T >
T GemmKernelBigger< T >::blockA_packed[MC *KC__attribute__ ((aligned(64)))
 
template<typename T >
T GemmKernelBigger< T >::blockB_packed[NC *KC__attribute__ ((aligned(64)))
 
template<typename T >
Vector< Tadd_vec (const Vector< T > &a, const Vector< T > &b)
 
template<typename T >
Vector< Tsub_vec (const Vector< T > &a, const Vector< T > &b)
 
template<typename T >
Vector< Tscl_vec (const Vector< T > &a, T scalar)
 
template<typename T >
T norm1_vec (const Vector< T > &a)
 
template<typename T >
T norm2_vec (const Vector< T > &a)
 
template<typename T >
T normInf_vec (const Vector< T > &a)
 
template<typename T >
T dot_vec (const Vector< T > &a, const Vector< T > &b)
 
template<typename T >
T cosine_vec (const Vector< T > &a, const Vector< T > &b)
 
template<typename T >
Vector< Tlerp_vec (const Vector< T > &a, const Vector< T > &b, T t)
 
template<typename T >
Vector< Tlinear_combination_vec (const std::vector< Vector< T > > &u, const std::vector< T > &coef)
 
template<typename T >
Vector< Tcross_vec (const Vector< T > &a, const Vector< T > &b)
 
template<typename T >
Matrix< Tadd_mat (const Matrix< T > &A, const Matrix< T > &B)
 
template<typename T >
Matrix< Tsub_mat (const Matrix< T > &A, const Matrix< T > &B)
 
template<typename T >
Matrix< Tscl_mat (const Matrix< T > &A, T scalar)
 
template<typename T >
Matrix< Tlerp_mat (const Matrix< T > &A, const Matrix< T > &B, T t)
 
template<typename T >
Matrix< Tmul_mat (const Matrix< T > &A, const Matrix< T > &B)
 
template<typename T >
Matrix< Ttranspose_mat (const Matrix< T > &A)
 
template<typename T >
Matrix< Ttrace_mat (const Matrix< T > &A)
 
template<typename T >
Vector< Tmul_vec (const Matrix< T > &A, const Vector< T > &x)
 
template<typename T >
Matrix< Tinverse_mat (const Matrix< T > &A)
 
template<typename T >
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+R2mul_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< Tgauss_solve (const Matrix< T > &A, const Vector< T > &b)
 
template<typename T >
Vector< Tjacobi_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< Ttensor_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< Tcompute_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 >
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 >
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 >
tensorium_RG::BSSN< Tsetup_BSSN_grid (const Vector< T > &X, const tensorium_RG::Metric< T > &metric, T dx, T dy, T dz)
 
void print_ast (const std::shared_ptr< ASTNode > &node, int indent=0)
 

Enumeration Type Documentation

◆ ASTNodeType

Enumerator
Number 
Symbol 
BinaryOp 
UnaryOp 
FunctionCall 
Subscript 
Superscript 
Derivative 
Integral 
TensorSymbol 

Function Documentation

◆ __attribute__() [1/2]

template<typename T >
T GemmKernelBigger< T >::blockA_packed[MC *KC] tensorium::__attribute__ ( (aligned(64)) )

◆ __attribute__() [2/2]

template<typename T >
T GemmKernelBigger< T >::blockB_packed[NC *KC] tensorium::__attribute__ ( (aligned(64)) )

◆ add_mat()

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

◆ 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_conformal_factor()

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

References gamma.

◆ 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 chi, and gamma.

◆ 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)

◆ 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)

◆ 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 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)

◆ 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 )

◆ 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)

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 )

Referenced by main().

Here is the caller graph for this function:

◆ 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 )

◆ 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)

◆ print_ast()

void tensorium::print_ast ( const std::shared_ptr< ASTNode > & node,
int indent = 0 )
inline

References print_ast().

Referenced by print_ast().

Here is the call graph for this function:
Here is the caller 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)

◆ 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 )

◆ scl_vec()

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

◆ setup_BSSN_grid()

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

References X().

Here is the call graph for this function:

◆ sub_mat()

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

◆ 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)

◆ transpose_mat()

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

◆ 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: