Tensorium
Loading...
Searching...
No Matches
BSSNAtildeTensor.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
../../Core/Derivate.hpp
"
4
#include "
../../Core/Matrix.hpp
"
5
#include "
../../Core/Tensor.hpp
"
6
#include "
../../Core/Vector.hpp
"
7
#include "
../Metric.hpp
"
8
#include "
BSSNSetup.hpp
"
9
10
namespace
tensorium_RG
{
26
template
<
typename
K>
class
BSSNAtildeTensor
{
27
public
:
28
using
Vec
=
tensorium::Vector<K>
;
29
using
Mat
=
tensorium::Tensor<K, 2>
;
45
tensorium::Tensor<K, 2>
compute_Atilde_tensor
(
const
tensorium::Tensor<K, 2>
&Kij,
46
const
tensorium::Tensor<K, 2>
&gamma_inv,
47
const
tensorium::Tensor<K, 2>
&
gamma
, K
chi
) {
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
BSSNSetup.hpp
Derivate.hpp
Numerical differentiation operators using SIMD.
GreekSymbolminus::gamma
@ gamma
GreekSymbolminus::chi
@ chi
Matrix.hpp
Metric.hpp
Tensor.hpp
Vector.hpp
tensorium::Tensor
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition
Tensor.hpp:25
tensorium_RG::BSSNAtildeTensor
Computes the trace-free conformal extrinsic curvature tensor in the BSSN formalism.
Definition
BSSNAtildeTensor.hpp:26
tensorium_RG::BSSNAtildeTensor::compute_Atilde_tensor
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
tensorium_RG
Definition
BSSNAtildeTensor.hpp:10
includes
Tensorium
DiffGeometry
BSSN
BSSNAtildeTensor.hpp
Generated by
1.10.0