43 static constexpr size_t rank = 4;
62 const T &
operator()(
size_t i,
size_t j,
size_t k,
size_t l)
const {
76 for (
size_t l = 0; l <
dim; ++l) {
79 std::cout <<
"Γ^" << l <<
"_{μν} :\n";
80 for (
size_t i = 0; i <
dim; ++i) {
81 for (
size_t j = 0; j <
dim; ++j) {
82 std::cout << std::setw(12) << std::setprecision(6) << std::fixed
83 << (*this)(l, i, j, 0) <<
" ";
107 const size_t dim =
X.size();
122 metric_generator(Xh, gh);
123 metric_generator(Xl, gl);
126 for (
size_t lam = 0; lam <
dim; ++lam)
127 d_metric(lam,
nu,
mu, 0) = (gh(lam,
nu) - gl(lam,
nu)) / (T(2) * h);
132 for (
size_t lam = 0; lam <
dim; ++lam)
135 tmp(lam,
nu,
mu, 0) =
136 T(0.5) * (d_metric(
nu, lam,
mu, 0) + d_metric(
mu, lam,
nu, 0) -
137 d_metric(
mu,
nu, lam, 0));
139 for (
size_t lam = 0; lam <
dim; ++lam)
143 for (
size_t kap = 0; kap <
dim; ++kap)
144 sum += g_inv(lam, kap) * tmp(kap,
nu,
mu, 0);
167 for (
size_t i = 0; i < d0; ++i)
168 for (
size_t j = 0; j < d1; ++j)
174 for (
size_t i = 0; i < d0; ++i)
175 for (
size_t j = 0; j < d1; ++j)
176 out(i, j) = inv(i, j);
202 X_offset(direction) += offset;
205 g_inv = tensorium_RG::inv_mat_tensor_local(g);
std::vector< K, AlignedAllocator< K, ALIGN > > aligned_vector
Type alias for a std::vector with aligned memory allocation.
Definition Allocator.hpp:111
static FrontendPluginRegistry::Add< TensoriumPluginAction > X("tensorium-dispatch", "Handle #pragma tensorium directives")
Register the plugin under the name "tensorium-dispatch".
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition Tensor.hpp:25
std::array< size_t, Rank > dimensions
Dimensions of the tensor (e.g., {4,4,4,4})
Definition Tensor.hpp:29
Stores and computes Christoffel symbols .
Definition ChristoffelSymbol.hpp:40
size_t dim
Definition ChristoffelSymbol.hpp:44
__attribute__((always_inline, hot, flatten)) static inline ChristoffelSym< T > compute_christoffel(const tensorium
Compute Christoffel symbols numerically from a metric.
Definition ChristoffelSymbol.hpp:102
T & operator()(size_t i, size_t j, size_t k, size_t l)
Mutable access to component .
Definition ChristoffelSymbol.hpp:54
aligned_vector< T > data
Definition ChristoffelSymbol.hpp:42
ChristoffelSym(size_t dim)
Construct a Christoffel symbol tensor.
Definition ChristoffelSymbol.hpp:49
const T & operator()(size_t i, size_t j, size_t k, size_t l) const
Const access to component .
Definition ChristoffelSymbol.hpp:62
void fill(T value)
Fill all components with a constant value.
Definition ChristoffelSymbol.hpp:69
void print() const
Print all non-zero Christoffel components to stdout.
Definition ChristoffelSymbol.hpp:75
static constexpr size_t rank
Definition ChristoffelSymbol.hpp:43
A callable 4D metric class for general relativity (Minkowski, Schwarzschild, Kerr,...
Definition Metric.hpp:27
Definition BSSNAtildeTensor.hpp:10
__attribute__((always_inline, hot, flatten)) inline tensorium
Compute the inverse of a 2D metric tensor using local matrix inversion.
Definition ChristoffelSymbol.hpp:161