Tensorium
Loading...
Searching...
No Matches
BSSNextrinTensor.hpp
Go to the documentation of this file.
1
11#pragma once
12
14#include "../../Core/Matrix.hpp"
15#include "../../Core/Tensor.hpp"
16#include "../../Core/Vector.hpp"
17#include "../Metric.hpp"
18#include "BSSNSetup.hpp"
19
20namespace tensorium_RG {
46template <typename K> class ExtrinsicCurvature {
47 public:
50
71 template <typename T>
74 const tensorium::Vector<T> &beta, const tensorium::Tensor<T, 2> &partial_beta,
75 const tensorium::Tensor<T, 3> &christoffel, const T alpha) {
76 tensorium::Tensor<T, 2> Kij({3, 3});
77
78 for (size_t i = 0; i < 3; ++i) {
79 for (size_t j = 0; j < 3; ++j) {
80 T sym_grad_beta = partial_beta(i, j) + partial_beta(j, i);
81 T gamma_beta = T(0.0);
82
83 for (size_t k = 0; k < 3; ++k)
84 gamma_beta += 2.0 * christoffel(k, i, j) * beta(k);
85
86 Kij(i, j) = -0.5 / alpha * (dgt(i, j) - (sym_grad_beta - gamma_beta));
87 }
88 }
89 for (size_t i = 0; i < 3; ++i)
90 for (size_t j = i + 1; j < 3; ++j) {
91 T sym_val = 0.5 * (Kij(i, j) + Kij(j, i));
92 Kij(i, j) = Kij(j, i) = sym_val;
93 }
94
95 return Kij;
96 }
97};
98
99} // namespace tensorium_RG
Numerical differentiation operators using SIMD.
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition Tensor.hpp:25
Computes the extrinsic curvature tensor from BSSN variables.
Definition BSSNextrinTensor.hpp:46
tensorium::Tensor< T, 2 > compute_Kij(const tensorium::Tensor< T, 2 > &dgt, const tensorium::Tensor< T, 2 > &gamma, const tensorium::Vector< T > &beta, const tensorium::Tensor< T, 2 > &partial_beta, const tensorium::Tensor< T, 3 > &christoffel, const T alpha)
Computes the extrinsic curvature tensor .
Definition BSSNextrinTensor.hpp:73
Definition BSSNAtildeTensor.hpp:10