|
MiniTensor Version of the Day
|
Tensor inversion, row/column manipulation, rank-one updates, preconditioners and small dense linear solves. More...
Enumerations | |
| enum class | minitensor::PreconditionerType { minitensor::PreconditionerType::UNDEFINED = 0 , minitensor::PreconditionerType::IDENTITY = 1 , minitensor::PreconditionerType::DIAGONAL = 2 , minitensor::PreconditionerType::MAX_ABS_ROW = 3 } |
Functions | |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION Tensor< T, N > | minitensor::inverse (Tensor< T, N > const &A) |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION Tensor< T, N > | minitensor::inverse_fast23 (Tensor< T, N > const &A) |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION Tensor< T, N > | minitensor::inverse_full_pivot (Tensor< T, N > const &A) |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION void | minitensor::swap_row (Tensor< T, N > &A, Index const i, Index const j) |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION void | minitensor::swap_col (Tensor< T, N > &A, Index const i, Index const j) |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION void | minitensor::rank_one_left (T const &beta, Vector< T, N > const &v, Tensor< T, N > &A) |
| template<typename T , Index N> | |
| KOKKOS_INLINE_FUNCTION void | minitensor::rank_one_right (T const &beta, Vector< T, N > const &v, Tensor< T, N > &A) |
| template<typename T , Index N, typename RHS > | |
| std::pair< Tensor< T, N >, RHS > | minitensor::precon (PreconditionerType const pt, Tensor< T, N > const &A, RHS const &B) |
| template<typename T , Index N, typename RHS > | |
| RHS | minitensor::solve (Tensor< T, N > const &A, RHS const &b, PreconditionerType const pt=PreconditionerType::IDENTITY) |
| template<typename T , Index N, typename RHS > | |
| KOKKOS_INLINE_FUNCTION RHS | minitensor::solve_full_pivot (Tensor< T, N > const &A, RHS const &b) |
Tensor inversion, row/column manipulation, rank-one updates, preconditioners and small dense linear solves.
|
strong |
Preconditioner types
| Enumerator | |
|---|---|
| UNDEFINED | |
| IDENTITY | |
| DIAGONAL | |
| MAX_ABS_ROW | |
Definition at line 94 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, N > minitensor::inverse | ( | Tensor< T, N > const & | A | ) |
2nd-order tensor inverse
| A | nonsingular tensor |
Definition at line 182 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, N > minitensor::inverse_fast23 | ( | Tensor< T, N > const & | A | ) |
2nd-order tensor inverse using analitical expression for 2 and 3 dimensions
| A | nonsingular tensor |
Definition at line 217 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, N > minitensor::inverse_full_pivot | ( | Tensor< T, N > const & | A | ) |
2nd-order tensor inverse using full pivoting, very accurate
| A | nonsingular tensor |
Definition at line 197 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION void minitensor::swap_row | ( | Tensor< T, N > & | A, |
| Index const | i, | ||
| Index const | j | ||
| ) |
Swap row. Echange rows i and j in place
| A | tensor |
| i | index |
| j | index |
Definition at line 140 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION void minitensor::swap_col | ( | Tensor< T, N > & | A, |
| Index const | i, | ||
| Index const | j | ||
| ) |
Swap column. Echange columns i and j in place
| A | tensor |
| i | index |
| j | index |
Definition at line 162 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION void minitensor::rank_one_left | ( | T const & | beta, |
| Vector< T, N > const & | v, | ||
| Tensor< T, N > & | A | ||
| ) |
Apply rank-one update on the left in place \( A = (I - beta v v^T) A \)
Definition at line 399 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION void minitensor::rank_one_right | ( | T const & | beta, |
| Vector< T, N > const & | v, | ||
| Tensor< T, N > & | A | ||
| ) |
Apply rank-one update on the right in place \( A = A (I - beta v v^T) \)
Definition at line 411 of file MiniTensor_Inverse.h.
| std::pair< Tensor< T, N >, RHS > minitensor::precon | ( | PreconditionerType const | pt, |
| Tensor< T, N > const & | A, | ||
| RHS const & | B | ||
| ) |
Compute a preconditioner for improving the conditioning of a linear system.
Definition at line 471 of file MiniTensor_Inverse.h.
| RHS minitensor::solve | ( | Tensor< T, N > const & | A, |
| RHS const & | b, | ||
| PreconditionerType const | pt = PreconditionerType::IDENTITY |
||
| ) |
Solve linear system of equations. This is meant for the solution of small linear systems of equations typically found in constitutive updates. Right now the implementation is very inefficient (but accurate) as it just uses the inverse function. It is intended to be used in conjunction with Kokkos to take advantage of thread parallelism.
| A | assumed non-singular tensor |
| b | rhs of the system Ax=b |
| pt | preconditioner type |
Definition at line 500 of file MiniTensor_Inverse.h.
| KOKKOS_INLINE_FUNCTION RHS minitensor::solve_full_pivot | ( | Tensor< T, N > const & | A, |
| RHS const & | b | ||
| ) |
Solve linear system A x = b via Gauss-Jordan elimination with full pivoting.
Definition at line 274 of file MiniTensor_Inverse.h.