22#include <core/DataTypes.h>
23#include <core/cell/Cell.h>
24#include <core/math/Matrix3.h>
25#include <core/math/Vector3.h>
33template <
typename T,
typename U = T>
inline U
es2walberla(T
const &v) {
34 static_assert(std::is_arithmetic_v<T> and std::is_arithmetic_v<U>,
35 "a partial specialization of es2walberla is missing for the "
36 "type you are trying to convert");
37 return numeric_cast<U>(v);
40 return Vector3<float>{numeric_cast<float>(v[0]), numeric_cast<float>(v[1]),
41 numeric_cast<float>(v[2])};
44 return Vector3<double>{v[0], v[1], v[2]};
47template <
typename T>
auto to_vector3d(Vector3<T>
const &v)
noexcept {
49 static_cast<double>(v[0]),
static_cast<double>(v[1]),
50 static_cast<double>(v[2])}};
55 Utils::detail::carray_alias<int, 3u>{v[0], v[1], v[2]}};
60 Utils::detail::carray_alias<int, 3u>{v.x(), v.y(), v.z()}};
64 return Vector3<T>{
static_cast<T
>(v[0]),
static_cast<T
>(v[1]),
65 static_cast<T
>(v[2])};
68template <
typename T>
auto to_vector9d(Matrix3<T>
const &m)
noexcept {
70 static_cast<double>(m[0]),
static_cast<double>(m[1]),
71 static_cast<double>(m[2]),
static_cast<double>(m[3]),
72 static_cast<double>(m[4]),
static_cast<double>(m[5]),
73 static_cast<double>(m[6]),
static_cast<double>(m[7]),
74 static_cast<double>(m[8])}};
Vector implementation and trait types for boost qvm interoperability.
Vector< double, N > VectorXd
\file PackInfoPdfDoublePrecision.cpp \author pystencils
auto to_vector3d(Vector3< T > const &v) noexcept
auto to_vector3(Utils::Vector3d const &v) noexcept
Utils::Vector3i to_vector3i(Vector3< int > const &v) noexcept
auto to_vector9d(Matrix3< T > const &m) noexcept
U es2walberla(T const &v)