The Kokkos wrapper class for PETSc matrix.
More...
#include <KokkosMatrix.h>
|
| KOKKOS_FUNCTION PetscInt | find (PetscInt i, PetscInt j) const |
| | Get the index of given row and column indices. More...
|
| |
The Kokkos wrapper class for PETSc matrix.
Definition at line 30 of file KokkosMatrix.h.
◆ Matrix()
| Moose::Kokkos::Matrix::Matrix |
( |
| ) |
|
|
default |
◆ ~Matrix()
| Moose::Kokkos::Matrix::~Matrix |
( |
| ) |
|
|
inline |
Destructor.
Definition at line 40 of file KokkosMatrix.h.
void destroy()
Free all data and reset.
◆ close()
| void Moose::Kokkos::Matrix::close |
( |
| ) |
|
Assemble the underlying PETSc matrix.
◆ create()
Create the matrix from a libMesh PetscMatrix.
- Parameters
-
◆ destroy()
| void Moose::Kokkos::Matrix::destroy |
( |
| ) |
|
Free all data and reset.
Referenced by ~Matrix().
◆ find()
| KOKKOS_FUNCTION PetscInt Moose::Kokkos::Matrix::find |
( |
PetscInt |
i, |
|
|
PetscInt |
j |
|
) |
| const |
|
inlineprivate |
Get the index of given row and column indices.
- Parameters
-
| i | The row index local to this process |
| j | The global column index |
- Returns
- The index into the nonzero vector, and -1 if not found
Definition at line 138 of file KokkosMatrix.h.
Referenced by operator()().
140 KOKKOS_ASSERT(i <
_nr);
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
Array< PetscInt > _col_idx
CSR vectors on device.
Array< PetscInt > _row_ptr
PetscCount _nr
Number of rows local to this process.
◆ isAlloc()
| bool Moose::Kokkos::Matrix::isAlloc |
( |
| ) |
const |
|
inline |
Get whether the matrix was allocated.
- Returns
- Whether the matrix was allocated
Definition at line 51 of file KokkosMatrix.h.
bool _is_alloc
Flag whether the matrix was allocated.
◆ operator()()
| KOKKOS_FUNCTION PetscScalar& Moose::Kokkos::Matrix::operator() |
( |
PetscInt |
i, |
|
|
PetscInt |
j |
|
) |
| const |
|
inline |
Get an entry with given row and column indices.
- Parameters
-
| i | The row index local to this process |
| j | The global column index |
- Returns
- The reference of the element
Definition at line 78 of file KokkosMatrix.h.
82 KOKKOS_ASSERT(idx != -1)
Array< PetscScalar > _val
KOKKOS_FUNCTION PetscInt find(PetscInt i, PetscInt j) const
Get the index of given row and column indices.
◆ operator=()
| auto& Moose::Kokkos::Matrix::operator= |
( |
PetscScalar |
scalar | ) |
|
|
inline |
Assign a scalar value uniformly.
- Parameters
-
| scalar | The scalar value to be assigned |
Definition at line 90 of file KokkosMatrix.h.
Array< PetscScalar > _val
◆ zero()
| KOKKOS_FUNCTION void Moose::Kokkos::Matrix::zero |
( |
PetscInt |
i | ) |
|
|
inline |
Zero a row.
- Parameters
-
| i | The row index local to this process to be zeroed |
Definition at line 67 of file KokkosMatrix.h.
Array< PetscScalar > _val
Array< PetscInt > _row_ptr
◆ _col_idx
| Array<PetscInt> Moose::Kokkos::Matrix::_col_idx |
|
private |
◆ _is_alloc
| bool Moose::Kokkos::Matrix::_is_alloc = false |
|
private |
◆ _is_host
| bool Moose::Kokkos::Matrix::_is_host = false |
|
private |
Flag whether the PETSc matrix is a host matrix.
Definition at line 129 of file KokkosMatrix.h.
◆ _matrix
| Mat Moose::Kokkos::Matrix::_matrix = PETSC_NULLPTR |
|
private |
◆ _nr
| PetscCount Moose::Kokkos::Matrix::_nr = 0 |
|
private |
◆ _row_idx
| Array<PetscInt> Moose::Kokkos::Matrix::_row_idx |
|
private |
◆ _row_ptr
| Array<PetscInt> Moose::Kokkos::Matrix::_row_ptr |
|
private |
◆ _val
| Array<PetscScalar> Moose::Kokkos::Matrix::_val |
|
private |
The documentation for this class was generated from the following file: