14 #ifdef MOOSE_KOKKOS_SCOPE 18 #include "libmesh/petsc_matrix.h" 46 #ifdef MOOSE_KOKKOS_SCOPE 67 KOKKOS_FUNCTION
void zero(PetscInt i)
78 KOKKOS_FUNCTION PetscScalar &
operator()(PetscInt i, PetscInt j)
const 82 KOKKOS_ASSERT(
idx != -1)
99 #ifdef MOOSE_KOKKOS_SCOPE 106 KOKKOS_FUNCTION PetscInt
find(PetscInt i, PetscInt j)
const;
136 #ifdef MOOSE_KOKKOS_SCOPE 137 KOKKOS_FUNCTION
inline PetscInt
140 KOKKOS_ASSERT(i <
_nr);
KOKKOS_FUNCTION void zero(PetscInt i)
Zero a row.
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
Matrix()=default
Default constructor.
Array< PetscScalar > _val
The Kokkos wrapper class for PETSc matrix.
bool _is_alloc
Flag whether the matrix was allocated.
KOKKOS_FUNCTION PetscScalar & operator()(PetscInt i, PetscInt j) const
Get an entry with given row and column indices.
Array< PetscInt > _col_idx
CSR vectors on device.
bool isAlloc() const
Get whether the matrix was allocated.
Array< PetscInt > _row_ptr
Array< PetscInt > _row_idx
bool _is_host
Flag whether the PETSc matrix is a host matrix.
void destroy()
Free all data and reset.
void close()
Assemble the underlying PETSc matrix.
KOKKOS_FUNCTION PetscInt find(PetscInt i, PetscInt j) const
Get the index of given row and column indices.
void create(libMesh::SparseMatrix< PetscScalar > &matrix, const System &system)
Create the matrix from a libMesh PetscMatrix.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
auto & operator=(PetscScalar scalar)
Assign a scalar value uniformly.
PetscCount _nr
Number of rows local to this process.