22#include <core/DataTypes.h>
23#include <core/cell/Cell.h>
24#include <core/math/Matrix3.h>
25#include <core/math/Vector3.h>
34template <
typename T,
typename U = T>
inline U
es2walberla(T
const &v) {
35 static_assert(std::is_arithmetic_v<T> and std::is_arithmetic_v<U>,
36 "a partial specialization of es2walberla is missing for the "
37 "type you are trying to convert");
38 return numeric_cast<U>(v);
41 return Vector3<float>{numeric_cast<float>(v[0]), numeric_cast<float>(v[1]),
42 numeric_cast<float>(v[2])};
45 return Vector3<double>{v[0], v[1], v[2]};
48template <
typename T>
auto to_vector3d(Vector3<T>
const &v)
noexcept {
50 double_c(v[0]), double_c(v[1]), double_c(v[2])}};
54 return {v[0], v[1], v[2]};
58 return {v.x(), v.y(), v.z()};
62 return Vector3<T>{numeric_cast<T>(v[0]), numeric_cast<T>(v[1]),
63 numeric_cast<T>(v[2])};
66template <
typename T>
auto to_vector9d(Matrix3<T>
const &m)
noexcept {
68 double_c(m[0]), double_c(m[1]), double_c(m[2]), double_c(m[3]),
69 double_c(m[4]), double_c(m[5]), double_c(m[6]), double_c(m[7]),
73template <
typename Function>
75 Utils::Interpolation::bspline_3d<2>(
Vector implementation and trait types for boost qvm interoperability.
static DEVICE_QUALIFIER constexpr Vector< T, N > broadcast(typename Base::value_type const &value) noexcept
Create a vector that has all entries set to the same value.
\file PackInfoPdfDoublePrecision.cpp \author pystencils
auto to_vector3d(Vector3< T > const &v) noexcept
void interpolate_bspline_at_pos(Utils::Vector3d const &pos, Function const &f)
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)