Tensorium
Loading...
Searching...
No Matches
BSSNGridSetupUtils.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tensorium_RG {
6
7template <typename T, typename TensorFunc>
8tensorium::Tensor<T, 3> populate_tensor3D_component(size_t i, size_t j, TensorFunc &&func, T dx,
9 T dy, T dz, size_t NX, size_t NY, size_t NZ) {
10 using namespace tensorium;
11 Tensor<T, 3> output({NX, NY, NZ});
12
13 for (size_t x = 0; x < NX; ++x) {
14 for (size_t y = 0; y < NY; ++y) {
15 for (size_t z = 0; z < NZ; ++z) {
16 Vector<T> X(4);
17 X(0) = 0.0;
18 X(1) = x * dx;
19 X(2) = y * dy;
20 X(3) = z * dz;
21
23 output(x, y, z) = gamma(i, j);
24 }
25 }
26 }
27 return output;
28}
29
30} // namespace tensorium_RG
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
Definition BSSNAtildeTensor.hpp:10
tensorium::Tensor< T, 3 > populate_tensor3D_component(size_t i, size_t j, TensorFunc &&func, T dx, T dy, T dz, size_t NX, size_t NY, size_t NZ)
Definition BSSNGridSetupUtils.hpp:8
Definition Derivate.hpp:24