11AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T
dot_prod(
const T* x,
const T* y)
14 AMREX_SPACEDIM == 3,
"Vector ops only defined for AMREX_SPACEDIM == 3");
15 return (x[0] * y[0] + x[1] * y[1] + x[2] * y[2]);
11AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T
dot_prod(
const T* x,
const T* y) {
…}
21AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T
vec_mag(
const T* x)
21AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T
vec_mag(
const T* x) {
…}
32 AMREX_SPACEDIM == 3,
"Vector ops only defined for AMREX_SPACEDIM == 3");
33 const T inv_mag = 1.0 /
vec_mag(x);
40AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T
41dot_prod(
const T* x,
const T* y,
const int ndim)
44 for (
int i = 0; i < ndim; ++i) {
53AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void
57 AMREX_SPACEDIM == 3,
"Vector ops only defined for AMREX_SPACEDIM == 3");
58 c[0] = a[1] * b[2] - a[2] * b[1];
59 c[1] = a[2] * b[0] - a[0] * b[2];
60 c[2] = a[0] * b[1] - a[1] * b[0];
67 const amrex::Array2D<T, 0, AMREX_SPACEDIM, 0, AMREX_SPACEDIM>& tmat,
72 AMREX_SPACEDIM == 3,
"Vector ops only defined for AMREX_SPACEDIM == 3");
73 y[0] = tmat(0, 0) * x[0] + tmat(0, 1) * x[1] + tmat(0, 2) * x[2];
74 y[1] = tmat(1, 0) * x[0] + tmat(1, 1) * x[1] + tmat(1, 2) * x[2];
75 y[2] = tmat(2, 0) * x[0] + tmat(2, 1) * x[1] + tmat(2, 2) * x[2];
82 const amrex::Array2D<T, 0, AMREX_SPACEDIM, 0, AMREX_SPACEDIM>& tmat,
87 AMREX_SPACEDIM == 3,
"Vector ops only defined for AMREX_SPACEDIM == 3");
88 y[0] = tmat(0, 0) * x[0] + tmat(1, 0) * x[1] + tmat(2, 0) * x[2];
89 y[1] = tmat(0, 1) * x[0] + tmat(1, 1) * x[1] + tmat(2, 1) * x[2];
90 y[2] = tmat(0, 2) * x[0] + tmat(1, 2) * x[1] + tmat(2, 2) * x[2];
Definition MultiParser.H:7
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void vec_normalize(T *x)
Definition tensor_ops.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T dot_prod(const T *x, const T *y)
Definition tensor_ops.H:11
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void cross_prod(const T *a, const T *b, T *c)
Definition tensor_ops.H:54
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T vec_mag(const T *x)
Definition tensor_ops.H:21
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void transform_vec(const amrex::Array2D< T, 0, AMREX_SPACEDIM, 0, AMREX_SPACEDIM > &tmat, const T *x, T *y)
Definition tensor_ops.H:66
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void inv_transform_vec(const amrex::Array2D< T, 0, AMREX_SPACEDIM, 0, AMREX_SPACEDIM > &tmat, const T *x, T *y)
Definition tensor_ops.H:81