|
libMesh
|
Non-owning handle to one tensor entry of a Kokkos storage view. More...
#include <kokkos_linalg_base.h>
Public Types | |
| using | view_type = ViewType |
| using | value_type = detail::tensor_view_value_t< ViewType > |
Public Member Functions | |
| LIBMESH_DEVICE_INLINE | tensor_ref (ViewType view, const unsigned int index) |
Constructs a reference to entry index of view. | |
| LIBMESH_DEVICE_INLINE decltype(auto) | operator() (const unsigned int row, const unsigned int col) const |
| LIBMESH_DEVICE_INLINE decltype(auto) | operator() (const unsigned int row, const unsigned int col) |
| template<typename RightTensor > | |
| LIBMESH_DEVICE_INLINE void | assign (const RightTensor &right) |
Assigns right 's components to the referenced entry. | |
| template<typename RightTensor > | |
| LIBMESH_DEVICE_INLINE void | add (const RightTensor &right) |
Adds right to the referenced entry, in place. | |
| template<typename RightTensor > | |
| LIBMESH_DEVICE_INLINE void | add_scaled (const RightTensor &right, const value_type &factor) |
Adds factor times right to the referenced entry, in place. | |
| template<typename RightTensor > | |
| LIBMESH_DEVICE_INLINE void | subtract (const RightTensor &right) |
Subtracts right from the referenced entry, in place. | |
| template<typename RightTensor > | |
| LIBMESH_DEVICE_INLINE void | subtract_scaled (const RightTensor &right, const value_type &factor) |
Subtracts factor times right from the referenced entry, in place. | |
| LIBMESH_DEVICE_INLINE void | zero () |
| Sets every component of the referenced entry to zero. | |
| template<typename RightTensor > | |
| LIBMESH_DEVICE_INLINE auto | contract (const RightTensor &right) const |
| LIBMESH_DEVICE_INLINE auto | norm () const |
| LIBMESH_DEVICE_INLINE auto | norm_sq () const |
| LIBMESH_DEVICE_INLINE bool | is_zero () const |
| LIBMESH_DEVICE_INLINE auto | transpose () const |
| LIBMESH_DEVICE_INLINE auto | det (const unsigned int dim=LIBMESH_DIM) const |
| LIBMESH_DEVICE_INLINE auto | tr () const |
| LIBMESH_DEVICE_INLINE auto | inverse (const unsigned int dim=LIBMESH_DIM) const |
| template<typename VectorLike , typename ResultVector > | |
| LIBMESH_DEVICE_INLINE void | solve (const VectorLike &b, ResultVector &x) const |
Solves the linear system (*this)x = b for x, via the explicit inverse. | |
| LIBMESH_DEVICE_INLINE auto | row (const unsigned int i) const |
| LIBMESH_DEVICE_INLINE auto | column (const unsigned int i) const |
| template<typename VectorLike > | |
| LIBMESH_DEVICE_INLINE auto | left_multiply (const VectorLike &v) const |
| LIBMESH_DEVICE_INLINE unsigned int | index () const |
Private Attributes | |
| ViewType | _view |
| unsigned int | _index |
Non-owning handle to one tensor entry of a Kokkos storage view.
The tensor analogue of vector_ref: it pairs a view with an entry index, exposes the entry's components through operator()(row,col), and provides the TypeTensor-like arithmetic methods below (defined out-of-line in kokkos_tensor_ops.h). Component writes go directly to the underlying view.
Definition at line 340 of file kokkos_linalg_base.h.
| using libMesh::Kokkos::tensor_ref< ViewType >::value_type = detail::tensor_view_value_t<ViewType> |
Definition at line 345 of file kokkos_linalg_base.h.
| using libMesh::Kokkos::tensor_ref< ViewType >::view_type = ViewType |
Definition at line 344 of file kokkos_linalg_base.h.
|
inline |
Constructs a reference to entry index of view.
Definition at line 351 of file kokkos_linalg_base.h.
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::add | ( | const RightTensor & | right | ) |
Adds right to the referenced entry, in place.
Definition at line 623 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::operator+=().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::add_scaled | ( | const RightTensor & | right, |
| const value_type & | factor | ||
| ) |
Adds factor times right to the referenced entry, in place.
Definition at line 631 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::detail::update_tensor_components().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::assign | ( | const RightTensor & | right | ) |
Assigns right 's components to the referenced entry.
Definition at line 615 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::detail::assign_tensor_components().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::column | ( | const unsigned int | i | ) | const |
i of the referenced entry, as an owning vector. Definition at line 750 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::column().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::contract | ( | const RightTensor & | right | ) | const |
right. Definition at line 662 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::contract().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::det | ( | const unsigned int | dim = LIBMESH_DIM | ) | const |
dim x dim block of the referenced entry. Definition at line 711 of file kokkos_tensor_ops.h.
References dim, and libMesh::Kokkos::detail::leading_determinant().
|
inline |
Definition at line 499 of file kokkos_linalg_base.h.
References libMesh::Kokkos::tensor_ref< ViewType >::_index.
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::inverse | ( | const unsigned int | dim = LIBMESH_DIM | ) | const |
dim x dim block of the referenced entry, as an owning tensor. Definition at line 725 of file kokkos_tensor_ops.h.
References dim, and libMesh::Kokkos::inverse().
| LIBMESH_DEVICE_INLINE bool libMesh::Kokkos::tensor_ref< ViewType >::is_zero | ( | ) | const |
true if every component of the referenced entry is exactly zero, false otherwise. Definition at line 692 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::row().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::left_multiply | ( | const VectorLike & | v | ) | const |
v * (*this), as an owning vector. Definition at line 758 of file kokkos_tensor_ops.h.
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::norm | ( | ) | const |
Definition at line 669 of file kokkos_tensor_ops.h.
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::norm_sq | ( | ) | const |
Definition at line 677 of file kokkos_tensor_ops.h.
References libMesh::TensorTools::norm_sq(), and libMesh::Kokkos::row().
|
inline |
Definition at line 365 of file kokkos_linalg_base.h.
References libMesh::Kokkos::tensor_ref< ViewType >::_index, libMesh::Kokkos::tensor_ref< ViewType >::_view, and libMesh::Kokkos::tensor_ref< ViewType >::row().
|
inline |
row, col) component of the referenced entry, writable under the same shallow-constness rules as vector_ref::operator(). Definition at line 359 of file kokkos_linalg_base.h.
References libMesh::Kokkos::tensor_ref< ViewType >::_index, libMesh::Kokkos::tensor_ref< ViewType >::_view, and libMesh::Kokkos::tensor_ref< ViewType >::row().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::row | ( | const unsigned int | i | ) | const |
i of the referenced entry, as an owning vector. Definition at line 743 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::row().
Referenced by libMesh::Kokkos::tensor_ref< ViewType >::operator()(), and libMesh::Kokkos::tensor_ref< ViewType >::operator()().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::solve | ( | const VectorLike & | b, |
| ResultVector & | x | ||
| ) | const |
Solves the linear system (*this)x = b for x, via the explicit inverse.
Definition at line 733 of file kokkos_tensor_ops.h.
References b, and libMesh::Kokkos::inverse().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::subtract | ( | const RightTensor & | right | ) |
Subtracts right from the referenced entry, in place.
Definition at line 639 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::operator-=().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::subtract_scaled | ( | const RightTensor & | right, |
| const value_type & | factor | ||
| ) |
Subtracts factor times right from the referenced entry, in place.
Definition at line 647 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::detail::update_tensor_components().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::tr | ( | ) | const |
Definition at line 718 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::detail::tensor_trace().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::tensor_ref< ViewType >::transpose | ( | ) | const |
Definition at line 704 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::transpose().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::tensor_ref< ViewType >::zero | ( | ) |
Sets every component of the referenced entry to zero.
Definition at line 654 of file kokkos_tensor_ops.h.
References libMesh::Kokkos::detail::fill_tensor_components().
|
private |
Definition at line 506 of file kokkos_linalg_base.h.
Referenced by libMesh::Kokkos::tensor_ref< ViewType >::index(), libMesh::Kokkos::tensor_ref< ViewType >::operator()(), and libMesh::Kokkos::tensor_ref< ViewType >::operator()().
|
private |
Definition at line 505 of file kokkos_linalg_base.h.
Referenced by libMesh::Kokkos::tensor_ref< ViewType >::operator()(), and libMesh::Kokkos::tensor_ref< ViewType >::operator()().