Tensorium
Loading...
Searching...
No Matches
BSSNPrintDebug.hpp
Go to the documentation of this file.
1#pragma once
2
5#include "../Metric.hpp"
6#include "BSSNSetup.hpp"
7
8namespace tensorium_RG {
9
10template <typename T>
11inline void print_tensor2(const std::string &name, const tensorium::Tensor<T, 2> &tensor) {
12 std::cout << "--- " << name << " ---\n";
13 for (size_t i = 0; i < 3; ++i) {
14 for (size_t j = 0; j < 3; ++j)
15 std::cout << std::setw(12) << tensor(i, j) << " ";
16 std::cout << "\n";
17 }
18}
19
20template <typename T>
21inline void print_tensor3(const std::string &name, const tensorium::Tensor<T, 3> &tensor) {
22 std::cout << "--- " << name << " ---\n";
23 for (size_t d = 0; d < 3; ++d) {
24 std::cout << "∂_" << "xyz"[d] << ":\n";
25 for (size_t i = 0; i < 3; ++i) {
26 for (size_t j = 0; j < 3; ++j)
27 std::cout << std::setw(12) << tensor(d, i, j) << " ";
28 std::cout << "\n";
29 }
30 }
31}
32
33template <typename T>
34inline void print_vector(const std::string &name, const tensorium::Vector<T> &vec) {
35 std::cout << "--- " << name << " ---\n";
36 for (size_t i = 0; i < vec.size(); ++i)
37 std::cout << std::setw(12) << vec(i) << " ";
38 std::cout << "\n";
39}
40
41} // namespace tensorium_RG
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition Tensor.hpp:25
Definition BSSNAtildeTensor.hpp:10
void print_tensor3(const std::string &name, const tensorium::Tensor< T, 3 > &tensor)
Definition BSSNPrintDebug.hpp:21
void print_vector(const std::string &name, const tensorium::Vector< T > &vec)
Definition BSSNPrintDebug.hpp:34
void print_tensor2(const std::string &name, const tensorium::Tensor< T, 2 > &tensor)
Definition BSSNPrintDebug.hpp:11