https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosTypes.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://www.mooseframework.org
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "KokkosThread.h"
13#include "KokkosScalar.h"
14#include "KokkosJaggedArray.h"
15
16#ifdef MOOSE_KOKKOS_SCOPE
17#include "KokkosADReal.h"
18#endif
19
20#include "MooseError.h"
21#include "MooseUtils.h"
22
23#include "libmesh/tensor_tools.h"
24#include "libmesh/tensor_value.h"
25
26namespace Moose::Kokkos
27{
28
29template <typename T>
30struct Vector3;
31
34
35struct Real33;
36
37template <typename T>
38struct Vector3
39{
40 T v[3];
41
42#ifdef MOOSE_KOKKOS_SCOPE
44 KOKKOS_INLINE_FUNCTION Vector3() { *this = T{}; }
45 KOKKOS_INLINE_FUNCTION Vector3(const T & scalar) { *this = scalar; }
46 KOKKOS_INLINE_FUNCTION Vector3(const Vector3<T> & vector) = default;
47 KOKKOS_INLINE_FUNCTION Vector3(const T & x, const T & y, const T & z);
48
49 KOKKOS_INLINE_FUNCTION Vector3<T> operator-() const;
50 KOKKOS_INLINE_FUNCTION T & operator()(unsigned int i) { return v[i]; }
51 KOKKOS_INLINE_FUNCTION const T & operator()(unsigned int i) const { return v[i]; }
52
54
55 template <typename U>
56 KOKKOS_INLINE_FUNCTION Vector3<T> & operator=(const Vector3<U> & vector);
57 KOKKOS_INLINE_FUNCTION Vector3<T> & operator=(const Vector3<T> & vector);
58 KOKKOS_INLINE_FUNCTION Vector3<T> & operator=(const T & scalar);
59
60 template <typename U>
61 KOKKOS_INLINE_FUNCTION void operator+=(const Vector3<U> & vector);
62 KOKKOS_INLINE_FUNCTION void operator+=(const T & scalar);
63 template <typename U>
64 KOKKOS_INLINE_FUNCTION void operator-=(const Vector3<U> & vector);
65 KOKKOS_INLINE_FUNCTION void operator-=(const T & scalar);
66 KOKKOS_INLINE_FUNCTION void operator*=(const T & scalar);
67
68 KOKKOS_INLINE_FUNCTION Real norm() const;
69 KOKKOS_INLINE_FUNCTION Real dot_product(const Real3 vector) const;
70 KOKKOS_INLINE_FUNCTION Real3 cross_product(const Real3 vector) const;
71 KOKKOS_INLINE_FUNCTION Real33 cartesian_product(const Real3 vector) const;
72#endif
73};
74
75struct Real33
76{
77 Real a[3][3];
78
79#ifdef MOOSE_KOKKOS_SCOPE
80 KOKKOS_INLINE_FUNCTION Real33() { *this = 0; }
81 KOKKOS_INLINE_FUNCTION Real33(const Real scalar) { *this = scalar; }
82 KOKKOS_INLINE_FUNCTION Real33(const Real33 & tensor) = default;
83 Real33(const libMesh::TypeTensor<Real> & tensor) { *this = tensor; }
84
85 KOKKOS_INLINE_FUNCTION Real & operator()(unsigned int i, unsigned int j) { return a[i][j]; }
86 KOKKOS_INLINE_FUNCTION Real operator()(unsigned int i, unsigned int j) const { return a[i][j]; }
87
89 KOKKOS_INLINE_FUNCTION Real33 & operator=(const Real33 & tensor);
90 KOKKOS_INLINE_FUNCTION Real33 & operator=(const Real scalar);
91 KOKKOS_INLINE_FUNCTION void operator+=(const Real33 tensor);
92 KOKKOS_INLINE_FUNCTION void operator*=(const Real scalar);
93
94 KOKKOS_INLINE_FUNCTION Real contract(const Real33 tensor) const;
95 KOKKOS_INLINE_FUNCTION void identity(const unsigned int dim = 3);
96 KOKKOS_INLINE_FUNCTION Real determinant(const unsigned int dim = 3) const;
97 KOKKOS_INLINE_FUNCTION Real33 inverse(const unsigned int dim = 3) const;
98 KOKKOS_INLINE_FUNCTION Real33 transpose() const;
99 KOKKOS_INLINE_FUNCTION Real3 row(const unsigned int i) const;
100 KOKKOS_INLINE_FUNCTION Real3 col(const unsigned int j) const;
101#endif
102};
103
104#ifdef MOOSE_KOKKOS_SCOPE
105
106template <typename T>
108{
109 v[0] = vector(0);
110 v[1] = vector(1);
111 v[2] = vector(2);
112}
113
114template <typename T>
115KOKKOS_INLINE_FUNCTION
116Vector3<T>::Vector3(const T & x, const T & y, const T & z)
117{
118 v[0] = x;
119 v[1] = y;
120 v[2] = z;
121}
122
123template <typename T>
126{
127 v[0] = vector(0);
128 v[1] = vector(1);
129 v[2] = vector(2);
130
131 return *this;
132}
133
134template <typename T>
135KOKKOS_INLINE_FUNCTION Vector3<T>
137{
138 Vector3<T> vector(*this);
139 vector *= -1;
140
141 return vector;
142}
143
144template <typename T>
145KOKKOS_INLINE_FUNCTION Vector3<T> &
147{
148 v[0] = vector.v[0];
149 v[1] = vector.v[1];
150 v[2] = vector.v[2];
151
152 return *this;
153}
154
155template <typename T>
156template <typename U>
157KOKKOS_INLINE_FUNCTION Vector3<T> &
159{
160 v[0] = vector.v[0];
161 v[1] = vector.v[1];
162 v[2] = vector.v[2];
163
164 return *this;
165}
166
167template <typename T>
168KOKKOS_INLINE_FUNCTION Vector3<T> &
169Vector3<T>::operator=(const T & scalar)
170{
171 v[0] = scalar;
172 v[1] = scalar;
173 v[2] = scalar;
174
175 return *this;
176}
177
178template <typename T>
179template <typename U>
180KOKKOS_INLINE_FUNCTION void
182{
183 v[0] += vector.v[0];
184 v[1] += vector.v[1];
185 v[2] += vector.v[2];
186}
187
188template <typename T>
189KOKKOS_INLINE_FUNCTION void
190Vector3<T>::operator+=(const T & scalar)
191{
192 v[0] += scalar;
193 v[1] += scalar;
194 v[2] += scalar;
195}
196
197template <typename T>
198template <typename U>
199KOKKOS_INLINE_FUNCTION void
201{
202 v[0] -= vector.v[0];
203 v[1] -= vector.v[1];
204 v[2] -= vector.v[2];
205}
206
207template <typename T>
208KOKKOS_INLINE_FUNCTION void
209Vector3<T>::operator-=(const T & scalar)
210{
211 v[0] -= scalar;
212 v[1] -= scalar;
213 v[2] -= scalar;
214}
215
216template <typename T>
217KOKKOS_INLINE_FUNCTION void
218Vector3<T>::operator*=(const T & scalar)
219{
220 v[0] *= scalar;
221 v[1] *= scalar;
222 v[2] *= scalar;
223}
224
225template <typename T>
226KOKKOS_INLINE_FUNCTION Vector3<T>
227operator+(const T & left, const Vector3<T> & right)
228{
229 return {left + right.v[0], left + right.v[1], left + right.v[2]};
230}
231
232template <typename T>
233KOKKOS_INLINE_FUNCTION Vector3<T>
234operator+(const Vector3<T> & left, const T & right)
235{
236 return {left.v[0] + right, left.v[1] + right, left.v[2] + right};
237}
238
239template <typename T>
240KOKKOS_INLINE_FUNCTION Vector3<T>
241operator+(const Vector3<T> & left, const Vector3<T> & right)
242{
243 return {left.v[0] + right.v[0], left.v[1] + right.v[1], left.v[2] + right.v[2]};
244}
245
246template <typename T>
247KOKKOS_INLINE_FUNCTION Vector3<T>
248operator-(const T & left, const Vector3<T> & right)
249{
250 return {left - right.v[0], left - right.v[1], left - right.v[2]};
251}
252
253template <typename T>
254KOKKOS_INLINE_FUNCTION Vector3<T>
255operator-(const Vector3<T> & left, const T & right)
256{
257 return {left.v[0] - right, left.v[1] - right, left.v[2] - right};
258}
259
260template <typename T>
261KOKKOS_INLINE_FUNCTION Vector3<T>
262operator-(const Vector3<T> & left, const Vector3<T> & right)
263{
264 return {left.v[0] - right.v[0], left.v[1] - right.v[1], left.v[2] - right.v[2]};
265}
266
267template <typename T>
268KOKKOS_INLINE_FUNCTION Vector3<T>
269operator*(const T & left, const Vector3<T> & right)
270{
271 return {left * right.v[0], left * right.v[1], left * right.v[2]};
272}
273
274template <typename T>
275KOKKOS_INLINE_FUNCTION Vector3<T>
276operator*(const Vector3<T> & left, const T & right)
277{
278 return {left.v[0] * right, left.v[1] * right, left.v[2] * right};
279}
280
281template <typename T>
282KOKKOS_INLINE_FUNCTION T
283operator*(const Vector3<T> & left, const Vector3<T> & right)
284{
285 return left.v[0] * right.v[0] + left.v[1] * right.v[1] + left.v[2] * right.v[2];
286}
287
288template <>
289KOKKOS_INLINE_FUNCTION Real
291{
292 return ::Kokkos::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
293}
294
295template <>
296KOKKOS_INLINE_FUNCTION Real
298{
299 return v[0] * vector.v[0] + v[1] * vector.v[1] + v[2] * vector.v[2];
300}
301
302template <>
303KOKKOS_INLINE_FUNCTION Real3
305{
306 Real3 cross;
307
308 cross.v[0] = v[1] * vector.v[2] - v[2] * vector.v[1];
309 cross.v[1] = v[2] * vector.v[0] - v[0] * vector.v[2];
310 cross.v[2] = v[0] * vector.v[1] - v[1] * vector.v[0];
311
312 return cross;
313}
314
315template <>
316KOKKOS_INLINE_FUNCTION Real33
318{
319 Real33 tensor;
320
321 for (unsigned int i = 0; i < Moose::dim; ++i)
322 for (unsigned int j = 0; j < Moose::dim; ++j)
323 tensor(i, j) = v[i] * vector.v[j];
324
325 return tensor;
326}
327
328inline Real33 &
330{
331 for (const auto i : make_range(Moose::dim))
332 for (const auto j : make_range(Moose::dim))
333 a[i][j] = tensor(i, j);
334
335 return *this;
336}
337
338KOKKOS_INLINE_FUNCTION Real33 &
340{
341 for (unsigned int i = 0; i < Moose::dim; ++i)
342 for (unsigned int j = 0; j < Moose::dim; ++j)
343 a[i][j] = tensor.a[i][j];
344
345 return *this;
346}
347
348KOKKOS_INLINE_FUNCTION Real33 &
349Real33::operator=(const Real scalar)
350{
351 for (unsigned int i = 0; i < Moose::dim; ++i)
352 for (unsigned int j = 0; j < Moose::dim; ++j)
353 a[i][j] = scalar;
354
355 return *this;
356}
357
358KOKKOS_INLINE_FUNCTION void
360{
361 for (unsigned int i = 0; i < Moose::dim; ++i)
362 for (unsigned int j = 0; j < Moose::dim; ++j)
363 a[i][j] += tensor.a[i][j];
364}
365
366KOKKOS_INLINE_FUNCTION void
367Real33::operator*=(const Real scalar)
368{
369 for (unsigned int i = 0; i < Moose::dim; ++i)
370 for (unsigned int j = 0; j < Moose::dim; ++j)
371 a[i][j] *= scalar;
372}
373
374KOKKOS_INLINE_FUNCTION Real
375Real33::contract(const Real33 tensor) const
376{
377 Real value = 0;
378
379 for (unsigned int i = 0; i < Moose::dim; ++i)
380 for (unsigned int j = 0; j < Moose::dim; ++j)
381 value += a[i][j] * tensor.a[i][j];
382
383 return value;
384}
385
386KOKKOS_INLINE_FUNCTION void
387Real33::identity(const unsigned int dim)
388{
389 *this = 0;
390
391 for (unsigned int i = 0; i < dim; ++i)
392 a[i][i] = 1;
393}
394
395KOKKOS_INLINE_FUNCTION Real
396Real33::determinant(const unsigned int dim) const
397{
398 Real det = 0;
399
400 if (dim == 0)
401 det = 1;
402 else if (dim == 1)
403 det = a[0][0];
404 else if (dim == 2)
405 det = a[0][0] * a[1][1] - a[0][1] * a[1][0];
406 else if (dim == 3)
407 det = a[0][0] * (a[1][1] * a[2][2] - a[1][2] * a[2][1]) -
408 a[0][1] * (a[1][0] * a[2][2] - a[1][2] * a[2][0]) +
409 a[0][2] * (a[1][0] * a[2][1] - a[1][1] * a[2][0]);
410
411 return det;
412}
413
414KOKKOS_INLINE_FUNCTION Real33
415Real33::inverse(const unsigned int dim) const
416{
417 Real inv_det = 1.0 / determinant(dim);
418 Real33 inv_mat;
419
420 if (dim == 1)
421 {
422 inv_mat(0, 0) = inv_det;
423 }
424 else if (dim == 2)
425 {
426 inv_mat(0, 0) = a[1][1] * inv_det;
427 inv_mat(0, 1) = -a[0][1] * inv_det;
428 inv_mat(1, 0) = -a[1][0] * inv_det;
429 inv_mat(1, 1) = a[0][0] * inv_det;
430 }
431 else if (dim == 3)
432 {
433 inv_mat(0, 0) = (a[1][1] * a[2][2] - a[1][2] * a[2][1]) * inv_det;
434 inv_mat(0, 1) = (a[0][2] * a[2][1] - a[0][1] * a[2][2]) * inv_det;
435 inv_mat(0, 2) = (a[0][1] * a[1][2] - a[0][2] * a[1][1]) * inv_det;
436 inv_mat(1, 0) = (a[1][2] * a[2][0] - a[1][0] * a[2][2]) * inv_det;
437 inv_mat(1, 1) = (a[0][0] * a[2][2] - a[0][2] * a[2][0]) * inv_det;
438 inv_mat(1, 2) = (a[0][2] * a[1][0] - a[0][0] * a[1][2]) * inv_det;
439 inv_mat(2, 0) = (a[1][0] * a[2][1] - a[1][1] * a[2][0]) * inv_det;
440 inv_mat(2, 1) = (a[0][1] * a[2][0] - a[0][0] * a[2][1]) * inv_det;
441 inv_mat(2, 2) = (a[0][0] * a[1][1] - a[0][1] * a[1][0]) * inv_det;
442 }
443
444 return inv_mat;
445}
446
447KOKKOS_INLINE_FUNCTION Real33
449{
450 Real33 tr_mat;
451
452 for (unsigned int i = 0; i < Moose::dim; ++i)
453 for (unsigned int j = 0; j < Moose::dim; ++j)
454 tr_mat(i, j) = a[j][i];
455
456 return tr_mat;
457}
458
459KOKKOS_INLINE_FUNCTION Real3
460Real33::row(const unsigned int i) const
461{
462 return Real3(a[i][0], a[i][1], a[i][2]);
463}
464
465KOKKOS_INLINE_FUNCTION Real3
466Real33::col(const unsigned int j) const
467{
468 return Real3(a[0][j], a[1][j], a[2][j]);
469}
470
471KOKKOS_INLINE_FUNCTION Real3
472operator*(const Real33 left, const Real3 right)
473{
474 return {left(0, 0) * right.v[0] + left(0, 1) * right.v[1] + left(0, 2) * right.v[2],
475 left(1, 0) * right.v[0] + left(1, 1) * right.v[1] + left(1, 2) * right.v[2],
476 left(2, 0) * right.v[0] + left(2, 1) * right.v[1] + left(2, 2) * right.v[2]};
477}
478
479KOKKOS_INLINE_FUNCTION ADReal3
480operator*(const Real33 left, const ADReal3 & right)
481{
482 return {left(0, 0) * right(0) + left(0, 1) * right(1) + left(0, 2) * right(2),
483 left(1, 0) * right(0) + left(1, 1) * right(1) + left(1, 2) * right(2),
484 left(2, 0) * right(0) + left(2, 1) * right(1) + left(2, 2) * right(2)};
485}
486
487KOKKOS_INLINE_FUNCTION ADReal3
488operator*(const ADReal3 & left, const Real33 right)
489{
490 return {left(0) * right(0, 0) + left(1) * right(1, 0) + left(2) * right(2, 0),
491 left(0) * right(0, 1) + left(1) * right(1, 1) + left(2) * right(2, 1),
492 left(0) * right(0, 2) + left(1) * right(1, 2) + left(2) * right(2, 2)};
493}
494
495KOKKOS_INLINE_FUNCTION Real33
496operator*(const Real33 left, const Real33 right)
497{
498 Real33 mul;
499
500 for (unsigned int i = 0; i < Moose::dim; ++i)
501 for (unsigned int j = 0; j < Moose::dim; ++j)
502 for (unsigned int k = 0; k < Moose::dim; ++k)
503 mul(i, j) += left(i, k) * right(k, j);
504
505 return mul;
506}
507
508KOKKOS_INLINE_FUNCTION Real33
509operator*(const Real left, Real33 right)
510{
511 right *= left;
512
513 return right;
514}
515
516KOKKOS_INLINE_FUNCTION Real33
517operator*(Real33 left, const Real right)
518{
519 left *= right;
520
521 return left;
522}
523
524KOKKOS_INLINE_FUNCTION Real3
525operator+(const Real left, const Real3 right)
526{
527 return {left + right.v[0], left + right.v[1], left + right.v[2]};
528}
529
530KOKKOS_INLINE_FUNCTION Real3
531operator+(const Real3 left, const Real right)
532{
533 return {left.v[0] + right, left.v[1] + right, left.v[2] + right};
534}
535
536KOKKOS_INLINE_FUNCTION Real3
537operator-(const Real left, const Real3 right)
538{
539 return {left - right.v[0], left - right.v[1], left - right.v[2]};
540}
541
542KOKKOS_INLINE_FUNCTION Real3
543operator-(const Real3 left, const Real right)
544{
545 return {left.v[0] - right, left.v[1] - right, left.v[2] - right};
546}
547
548KOKKOS_INLINE_FUNCTION Real3
549operator*(const Real left, const Real3 right)
550{
551 return {left * right.v[0], left * right.v[1], left * right.v[2]};
552}
553
554KOKKOS_INLINE_FUNCTION Real3
555operator*(const Real3 left, const Real right)
556{
557 return {left.v[0] * right, left.v[1] * right, left.v[2] * right};
558}
559
560template <typename T,
561 typename = typename std::enable_if<
562 std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
563KOKKOS_INLINE_FUNCTION ADReal3
564operator*(const Real3 left, const T & right)
565{
566 return {left(0) * right, left(1) * right, left(2) * right};
567}
568
569template <typename T,
570 typename = typename std::enable_if<
571 std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
572KOKKOS_INLINE_FUNCTION ADReal3
573operator*(const T & left, const Real3 right)
574{
575 return {left * right(0), left * right(1), left * right(2)};
576}
577
578KOKKOS_INLINE_FUNCTION ADReal
579operator*(const Real3 left, const ADReal3 & right)
580{
581 return left(0) * right(0) + left(1) * right(1) + left(2) * right(2);
582}
583
584KOKKOS_INLINE_FUNCTION ADReal
585operator*(const ADReal3 & left, const Real3 right)
586{
587 return left(0) * right(0) + left(1) * right(1) + left(2) * right(2);
588}
589
590KOKKOS_INLINE_FUNCTION Real3
591curlFromVectorGradient(const Real33 grad, const unsigned int dim)
592{
593 if (dim < 2)
594 return 0;
595 else if (dim == 2)
596 return Real3(0, 0, grad(1, 0) - grad(0, 1));
597 else
598 return Real3(grad(2, 1) - grad(1, 2), grad(0, 2) - grad(2, 0), grad(1, 0) - grad(0, 1));
599}
600
601#endif
602
603template <typename T1, typename T2>
604struct Pair
605{
608
609 template <typename T3, typename T4>
610 auto & operator=(const std::pair<T3, T4> pair)
611 {
612 first = pair.first;
613 second = pair.second;
614
615 return *this;
616 }
617};
618
619template <typename T1, typename T2>
620bool
621operator<(const Pair<T1, T2> & left, const Pair<T1, T2> & right)
622{
623 return std::make_pair(left.first, left.second) < std::make_pair(right.first, right.second);
624}
625
626} // namespace Moose::Kokkos
DualNumber< Real, DNDerivativeType, true > ADReal
Vector3< ADReal > ADReal3
Definition KokkosTypes.h:33
KOKKOS_INLINE_FUNCTION Real3 curlFromVectorGradient(const Real33 grad, const unsigned int dim)
Vector3< Real > Real3
Definition KokkosTypes.h:32
bool operator<(const Pair< T1, T2 > &left, const Pair< T1, T2 > &right)
KOKKOS_SCALAR_FUNCTION auto operator-(const T &left, const Scalar< U > &right) -> decltype(left - static_cast< const U & >(right))
KOKKOS_SCALAR_FUNCTION auto operator+(const T &left, const Scalar< U > &right) -> decltype(left+static_cast< const U & >(right))
KOKKOS_SCALAR_FUNCTION auto operator*(const T &left, const Scalar< U > &right) -> decltype(left *static_cast< const U & >(right))
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition Moose.h:165
auto & operator=(const std::pair< T3, T4 > pair)
KOKKOS_INLINE_FUNCTION Real determinant(const unsigned int dim=3) const
KOKKOS_INLINE_FUNCTION Real operator()(unsigned int i, unsigned int j) const
Definition KokkosTypes.h:86
KOKKOS_INLINE_FUNCTION void operator+=(const Real33 tensor)
KOKKOS_INLINE_FUNCTION Real33(const Real scalar)
Definition KokkosTypes.h:81
KOKKOS_INLINE_FUNCTION Real33()
Definition KokkosTypes.h:80
KOKKOS_INLINE_FUNCTION Real & operator()(unsigned int i, unsigned int j)
Definition KokkosTypes.h:85
KOKKOS_INLINE_FUNCTION Real33(const Real33 &tensor)=default
Real33(const libMesh::TypeTensor< Real > &tensor)
Definition KokkosTypes.h:83
KOKKOS_INLINE_FUNCTION Real33 inverse(const unsigned int dim=3) const
Real33 & operator=(const libMesh::TypeTensor< Real > &tensor)
KOKKOS_INLINE_FUNCTION Real33 transpose() const
KOKKOS_INLINE_FUNCTION void operator*=(const Real scalar)
KOKKOS_INLINE_FUNCTION Real contract(const Real33 tensor) const
KOKKOS_INLINE_FUNCTION Real3 row(const unsigned int i) const
KOKKOS_INLINE_FUNCTION Real3 col(const unsigned int j) const
KOKKOS_INLINE_FUNCTION void identity(const unsigned int dim=3)
KOKKOS_INLINE_FUNCTION void operator-=(const T &scalar)
KOKKOS_INLINE_FUNCTION T & operator()(unsigned int i)
Definition KokkosTypes.h:50
Vector3< T > & operator=(const libMesh::TypeVector< T > &vector)
KOKKOS_INLINE_FUNCTION Vector3(const T &x, const T &y, const T &z)
KOKKOS_INLINE_FUNCTION Vector3< T > & operator=(const T &scalar)
Vector3(const libMesh::TypeVector< T > &vector)
KOKKOS_INLINE_FUNCTION Vector3(const T &scalar)
Definition KokkosTypes.h:45
KOKKOS_INLINE_FUNCTION void operator+=(const T &scalar)
KOKKOS_INLINE_FUNCTION Vector3(const Vector3< T > &vector)=default
KOKKOS_INLINE_FUNCTION Vector3< T > & operator=(const Vector3< T > &vector)
KOKKOS_INLINE_FUNCTION Vector3< T > operator-() const
KOKKOS_INLINE_FUNCTION void operator*=(const T &scalar)
KOKKOS_INLINE_FUNCTION Real33 cartesian_product(const Real3 vector) const
KOKKOS_INLINE_FUNCTION Vector3()
Definition KokkosTypes.h:44
KOKKOS_INLINE_FUNCTION Real norm() const
KOKKOS_INLINE_FUNCTION void operator+=(const Vector3< U > &vector)
KOKKOS_INLINE_FUNCTION Real dot_product(const Real3 vector) const
KOKKOS_INLINE_FUNCTION Vector3< T > & operator=(const Vector3< U > &vector)
KOKKOS_INLINE_FUNCTION void operator-=(const Vector3< U > &vector)
KOKKOS_INLINE_FUNCTION Real3 cross_product(const Real3 vector) const
KOKKOS_INLINE_FUNCTION const T & operator()(unsigned int i) const
Definition KokkosTypes.h:51