https://mooseframework.inl.gov
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 
26 namespace Moose::Kokkos
27 {
28 
29 template <typename T>
30 struct Vector3;
31 
34 
35 struct Real33;
36 
37 template <typename T>
38 struct Vector3
39 {
40  T v[3];
41 
42 #ifdef MOOSE_KOKKOS_SCOPE
43  Vector3(const libMesh::TypeVector<T> & vector);
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 
75 struct 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 
88  Real33 & operator=(const libMesh::TypeTensor<Real> & tensor);
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 
106 template <typename T>
108 {
109  v[0] = vector(0);
110  v[1] = vector(1);
111  v[2] = vector(2);
112 }
113 
114 template <typename T>
115 KOKKOS_INLINE_FUNCTION
116 Vector3<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 
123 template <typename T>
124 Vector3<T> &
126 {
127  v[0] = vector(0);
128  v[1] = vector(1);
129  v[2] = vector(2);
130 
131  return *this;
132 }
133 
134 template <typename T>
135 KOKKOS_INLINE_FUNCTION Vector3<T>
137 {
138  Vector3<T> vector(*this);
139  vector *= -1;
140 
141  return vector;
142 }
143 
144 template <typename T>
145 KOKKOS_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 
155 template <typename T>
156 template <typename U>
157 KOKKOS_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 
167 template <typename T>
168 KOKKOS_INLINE_FUNCTION Vector3<T> &
169 Vector3<T>::operator=(const T & scalar)
170 {
171  v[0] = scalar;
172  v[1] = scalar;
173  v[2] = scalar;
174 
175  return *this;
176 }
177 
178 template <typename T>
179 template <typename U>
180 KOKKOS_INLINE_FUNCTION void
182 {
183  v[0] += vector.v[0];
184  v[1] += vector.v[1];
185  v[2] += vector.v[2];
186 }
187 
188 template <typename T>
189 KOKKOS_INLINE_FUNCTION void
190 Vector3<T>::operator+=(const T & scalar)
191 {
192  v[0] += scalar;
193  v[1] += scalar;
194  v[2] += scalar;
195 }
196 
197 template <typename T>
198 template <typename U>
199 KOKKOS_INLINE_FUNCTION void
201 {
202  v[0] -= vector.v[0];
203  v[1] -= vector.v[1];
204  v[2] -= vector.v[2];
205 }
206 
207 template <typename T>
208 KOKKOS_INLINE_FUNCTION void
209 Vector3<T>::operator-=(const T & scalar)
210 {
211  v[0] -= scalar;
212  v[1] -= scalar;
213  v[2] -= scalar;
214 }
215 
216 template <typename T>
217 KOKKOS_INLINE_FUNCTION void
218 Vector3<T>::operator*=(const T & scalar)
219 {
220  v[0] *= scalar;
221  v[1] *= scalar;
222  v[2] *= scalar;
223 }
224 
225 template <typename T>
226 KOKKOS_INLINE_FUNCTION Vector3<T>
227 operator+(const T & left, const Vector3<T> & right)
228 {
229  return {left + right.v[0], left + right.v[1], left + right.v[2]};
230 }
231 
232 template <typename T>
233 KOKKOS_INLINE_FUNCTION Vector3<T>
234 operator+(const Vector3<T> & left, const T & right)
235 {
236  return {left.v[0] + right, left.v[1] + right, left.v[2] + right};
237 }
238 
239 template <typename T>
240 KOKKOS_INLINE_FUNCTION Vector3<T>
241 operator+(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 
246 template <typename T>
247 KOKKOS_INLINE_FUNCTION Vector3<T>
248 operator-(const T & left, const Vector3<T> & right)
249 {
250  return {left - right.v[0], left - right.v[1], left - right.v[2]};
251 }
252 
253 template <typename T>
254 KOKKOS_INLINE_FUNCTION Vector3<T>
255 operator-(const Vector3<T> & left, const T & right)
256 {
257  return {left.v[0] - right, left.v[1] - right, left.v[2] - right};
258 }
259 
260 template <typename T>
261 KOKKOS_INLINE_FUNCTION Vector3<T>
262 operator-(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 
267 template <typename T>
268 KOKKOS_INLINE_FUNCTION Vector3<T>
269 operator*(const T & left, const Vector3<T> & right)
270 {
271  return {left * right.v[0], left * right.v[1], left * right.v[2]};
272 }
273 
274 template <typename T>
275 KOKKOS_INLINE_FUNCTION Vector3<T>
276 operator*(const Vector3<T> & left, const T & right)
277 {
278  return {left.v[0] * right, left.v[1] * right, left.v[2] * right};
279 }
280 
281 template <typename T>
282 KOKKOS_INLINE_FUNCTION T
283 operator*(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 
288 template <>
289 KOKKOS_INLINE_FUNCTION Real
291 {
292  return ::Kokkos::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
293 }
294 
295 template <>
296 KOKKOS_INLINE_FUNCTION Real
298 {
299  return v[0] * vector.v[0] + v[1] * vector.v[1] + v[2] * vector.v[2];
300 }
301 
302 template <>
303 KOKKOS_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 
315 template <>
316 KOKKOS_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 
328 inline 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 
338 KOKKOS_INLINE_FUNCTION Real33 &
339 Real33::operator=(const Real33 & tensor)
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 
348 KOKKOS_INLINE_FUNCTION Real33 &
349 Real33::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 
358 KOKKOS_INLINE_FUNCTION void
359 Real33::operator+=(const Real33 tensor)
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 
366 KOKKOS_INLINE_FUNCTION void
367 Real33::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 
374 KOKKOS_INLINE_FUNCTION Real
375 Real33::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 
386 KOKKOS_INLINE_FUNCTION void
387 Real33::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 
395 KOKKOS_INLINE_FUNCTION Real
396 Real33::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 
414 KOKKOS_INLINE_FUNCTION Real33
415 Real33::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 
447 KOKKOS_INLINE_FUNCTION Real33
448 Real33::transpose() const
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 
459 KOKKOS_INLINE_FUNCTION Real3
460 Real33::row(const unsigned int i) const
461 {
462  return Real3(a[i][0], a[i][1], a[i][2]);
463 }
464 
465 KOKKOS_INLINE_FUNCTION Real3
466 Real33::col(const unsigned int j) const
467 {
468  return Real3(a[0][j], a[1][j], a[2][j]);
469 }
470 
471 KOKKOS_INLINE_FUNCTION Real3
472 operator*(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 
479 KOKKOS_INLINE_FUNCTION ADReal3
480 operator*(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 
487 KOKKOS_INLINE_FUNCTION ADReal3
488 operator*(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 
495 KOKKOS_INLINE_FUNCTION Real33
496 operator*(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 
508 KOKKOS_INLINE_FUNCTION Real33
509 operator*(const Real left, Real33 right)
510 {
511  right *= left;
512 
513  return right;
514 }
515 
516 KOKKOS_INLINE_FUNCTION Real33
517 operator*(Real33 left, const Real right)
518 {
519  left *= right;
520 
521  return left;
522 }
523 
524 KOKKOS_INLINE_FUNCTION Real3
525 operator+(const Real left, const Real3 right)
526 {
527  return {left + right.v[0], left + right.v[1], left + right.v[2]};
528 }
529 
530 KOKKOS_INLINE_FUNCTION Real3
531 operator+(const Real3 left, const Real right)
532 {
533  return {left.v[0] + right, left.v[1] + right, left.v[2] + right};
534 }
535 
536 KOKKOS_INLINE_FUNCTION Real3
537 operator-(const Real left, const Real3 right)
538 {
539  return {left - right.v[0], left - right.v[1], left - right.v[2]};
540 }
541 
542 KOKKOS_INLINE_FUNCTION Real3
543 operator-(const Real3 left, const Real right)
544 {
545  return {left.v[0] - right, left.v[1] - right, left.v[2] - right};
546 }
547 
548 KOKKOS_INLINE_FUNCTION Real3
549 operator*(const Real left, const Real3 right)
550 {
551  return {left * right.v[0], left * right.v[1], left * right.v[2]};
552 }
553 
554 KOKKOS_INLINE_FUNCTION Real3
555 operator*(const Real3 left, const Real right)
556 {
557  return {left.v[0] * right, left.v[1] * right, left.v[2] * right};
558 }
559 
560 template <typename T,
561  typename = typename std::enable_if<
562  std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
563 KOKKOS_INLINE_FUNCTION ADReal3
564 operator*(const Real3 left, const T & right)
565 {
566  return {left(0) * right, left(1) * right, left(2) * right};
567 }
568 
569 template <typename T,
570  typename = typename std::enable_if<
571  std::is_same<typename std::decay<T>::type, ADReal>::value>::type>
572 KOKKOS_INLINE_FUNCTION ADReal3
573 operator*(const T & left, const Real3 right)
574 {
575  return {left * right(0), left * right(1), left * right(2)};
576 }
577 
578 KOKKOS_INLINE_FUNCTION ADReal
579 operator*(const Real3 left, const ADReal3 & right)
580 {
581  return left(0) * right(0) + left(1) * right(1) + left(2) * right(2);
582 }
583 
584 KOKKOS_INLINE_FUNCTION ADReal
585 operator*(const ADReal3 & left, const Real3 right)
586 {
587  return left(0) * right(0) + left(1) * right(1) + left(2) * right(2);
588 }
589 
590 KOKKOS_INLINE_FUNCTION Real3
591 curlFromVectorGradient(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 
603 template <typename T1, typename T2>
604 struct Pair
605 {
606  T1 first;
607  T2 second;
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 
619 template <typename T1, typename T2>
620 bool
621 operator<(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
Vector3< Real > Real3
Definition: KokkosTypes.h:32
KOKKOS_SCALAR_FUNCTION auto operator+(const T &left, const Scalar< U > &right) -> decltype(left+static_cast< const U &>(right))
Definition: KokkosScalar.h:260
KOKKOS_INLINE_FUNCTION void operator-=(const Vector3< U > &vector)
Definition: KokkosTypes.h:200
KOKKOS_INLINE_FUNCTION const T & operator()(unsigned int i) const
Definition: KokkosTypes.h:51
KOKKOS_INLINE_FUNCTION Real operator()(unsigned int i, unsigned int j) const
Definition: KokkosTypes.h:86
Real33(const libMesh::TypeTensor< Real > &tensor)
Definition: KokkosTypes.h:83
Vector3< T > & operator=(const libMesh::TypeVector< T > &vector)
Definition: KokkosTypes.h:125
KOKKOS_INLINE_FUNCTION void identity(const unsigned int dim=3)
Definition: KokkosTypes.h:387
KOKKOS_INLINE_FUNCTION Real dot_product(const Real3 vector) const
KOKKOS_INLINE_FUNCTION Real33 inverse(const unsigned int dim=3) const
Definition: KokkosTypes.h:415
KOKKOS_SCALAR_FUNCTION auto operator*(const T &left, const Scalar< U > &right) -> decltype(left *static_cast< const U &>(right))
Definition: KokkosScalar.h:278
Real33 & operator=(const libMesh::TypeTensor< Real > &tensor)
Definition: KokkosTypes.h:329
KOKKOS_INLINE_FUNCTION Real33()
Definition: KokkosTypes.h:80
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
void inverse(const std::vector< std::vector< Real >> &m, std::vector< std::vector< Real >> &m_inv)
Inverse the dense square matrix m using LAPACK routines.
Definition: MatrixTools.C:23
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:42
KOKKOS_INLINE_FUNCTION void operator*=(const T &scalar)
Definition: KokkosTypes.h:218
KOKKOS_INLINE_FUNCTION Real3 col(const unsigned int j) const
Definition: KokkosTypes.h:466
KOKKOS_INLINE_FUNCTION Real norm() const
auto & operator=(const std::pair< T3, T4 > pair)
Definition: KokkosTypes.h:610
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
KOKKOS_INLINE_FUNCTION Real33 cartesian_product(const Real3 vector) const
KOKKOS_INLINE_FUNCTION Real3 cross_product(const Real3 vector) const
KOKKOS_INLINE_FUNCTION Real3 curlFromVectorGradient(const Real33 grad, const unsigned int dim)
Definition: KokkosTypes.h:591
KOKKOS_INLINE_FUNCTION void operator+=(const Real33 tensor)
Definition: KokkosTypes.h:359
KOKKOS_INLINE_FUNCTION Real33 transpose() const
Definition: KokkosTypes.h:448
KOKKOS_INLINE_FUNCTION void operator*=(const Real scalar)
Definition: KokkosTypes.h:367
KOKKOS_INLINE_FUNCTION T & operator()(unsigned int i)
Definition: KokkosTypes.h:50
KOKKOS_INLINE_FUNCTION Real33(const Real scalar)
Definition: KokkosTypes.h:81
KOKKOS_INLINE_FUNCTION Real determinant(const unsigned int dim=3) const
Definition: KokkosTypes.h:396
infix_ostream_iterator< T, charT, traits > & operator=(T const &item)
Definition: InfixIterator.h:47
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
KOKKOS_INLINE_FUNCTION Vector3()
Definition: KokkosTypes.h:44
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
KOKKOS_INLINE_FUNCTION Vector3< T > operator-() const
Definition: KokkosTypes.h:136
IntRange< T > make_range(T beg, T end)
KOKKOS_INLINE_FUNCTION Real & operator()(unsigned int i, unsigned int j)
Definition: KokkosTypes.h:85
Vector3< ADReal > ADReal3
Definition: KokkosTypes.h:33
KOKKOS_INLINE_FUNCTION ADReal operator*(const ADReal3 &left, const Real3 right)
Definition: KokkosTypes.h:585
KOKKOS_INLINE_FUNCTION Vector3(const T &scalar)
Definition: KokkosTypes.h:45
KOKKOS_INLINE_FUNCTION Real3 operator+(const Real3 left, const Real right)
Definition: KokkosTypes.h:531
KOKKOS_INLINE_FUNCTION Real3 row(const unsigned int i) const
Definition: KokkosTypes.h:460
KOKKOS_INLINE_FUNCTION Real contract(const Real33 tensor) const
Definition: KokkosTypes.h:375
KOKKOS_SCALAR_FUNCTION auto operator-(const T &left, const Scalar< U > &right) -> decltype(left - static_cast< const U &>(right))
Definition: KokkosScalar.h:269
Order operator-(Order o, T p)
KOKKOS_INLINE_FUNCTION void operator+=(const Vector3< U > &vector)
Definition: KokkosTypes.h:181