Tensorium
Loading...
Searching...
No Matches
BSSNAtildeTensor.hpp
Go to the documentation of this file.
1#pragma once
2
7#include "../Metric.hpp"
8#include "BSSNSetup.hpp"
9
10namespace tensorium_RG {
26template <typename K> class BSSNAtildeTensor {
27 public:
46 const tensorium::Tensor<K, 2> &gamma_inv,
48 K trace_K = K(0);
49 for (size_t i = 0; i < 3; ++i)
50 for (size_t j = 0; j < 3; ++j)
51 trace_K += gamma_inv(i, j) * Kij(i, j);
52
53 tensorium::Tensor<K, 2> Atilde({3, 3});
54 for (size_t i = 0; i < 3; ++i)
55 for (size_t j = 0; j < 3; ++j)
56 Atilde(i, j) = chi * (Kij(i, j) - (1. / 3.) * gamma(i, j) * trace_K);
57
58 // Ensure symmetry: \f$ \tilde{A}_{ij} = \tilde{A}_{ji} \f$
59 for (size_t i = 0; i < 3; ++i)
60 for (size_t j = i + 1; j < 3; ++j) {
61 K sym = (Atilde(i, j) + Atilde(j, i)) * 0.5;
62 Atilde(i, j) = Atilde(j, i) = sym;
63 }
64
65 return Atilde;
66 }
67};
68
69} // namespace tensorium_RG
Numerical differentiation operators using SIMD.
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition Tensor.hpp:25
Computes the trace-free conformal extrinsic curvature tensor in the BSSN formalism.
Definition BSSNAtildeTensor.hpp:26
tensorium::Tensor< K, 2 > compute_Atilde_tensor(const tensorium::Tensor< K, 2 > &Kij, const tensorium::Tensor< K, 2 > &gamma_inv, const tensorium::Tensor< K, 2 > &gamma, K chi)
Computes from , , and .
Definition BSSNAtildeTensor.hpp:45
Definition BSSNAtildeTensor.hpp:10