14#include "libmesh/petsc_vector.h"
15#include "libmesh/dof_map.h"
41#ifdef MOOSE_KOKKOS_SCOPE
76 KOKKOS_FUNCTION PetscScalar &
operator()(dof_id_type i)
const
85 KOKKOS_FUNCTION PetscScalar &
operator[](dof_id_type i)
const
KOKKOS_FUNCTION index_type size() const
Get the total array size.
The Kokkos base system class.
The Kokkos wrapper class for PETSc vector.
void destroy()
Free all data and reset.
void copyToDevice()
Copy from the host libMesh PetscVector.
KOKKOS_FUNCTION PetscScalar & operator()(dof_id_type i) const
Get an entry with a given index.
Array< PetscScalar > _local
Data vectors on device.
void copyToHost()
Copy to the host libMesh PetscVector.
bool _is_ghosted
Flag whether the PETSc vector is ghosted.
KOKKOS_FUNCTION void operator()(PackBuffer, const PetscCount tid) const
void close()
Assemble the underlying PETSc vector.
KOKKOS_FUNCTION PetscScalar & operator[](dof_id_type i) const
Get an entry with a given index.
unsigned int _current_proc
Vec _global_vector
PETSc vectors.
bool isAlloc() const
Get whether the vector was allocated.
KOKKOS_FUNCTION void operator()(UnpackBuffer, const PetscCount tid) const
PetscScalar * _array
Raw data of local PETSc vector.
bool _is_host
Flag whether the PETSc vector is a host vector.
bool _is_alloc
Flag whether the vector was allocated.
void create(libMesh::NumericVector< PetscScalar > &vector, const System &system, bool assemble)
Create the vector from a libMesh PetscVector.
auto & operator=(PetscScalar scalar)
Assign a scalar value uniformly.
Array< PetscScalar > _ghost
const libMesh::Parallel::Communicator * _comm
Pointer to the libMesh communicator.
void restore()
Restore the underlying PETSc vector.
bool _assemble
Flag whether the vector will be assembled.
Vector()=default
Default constructor.
const System * _system
Pointer to the Kokkos system.
Data for direct assembly on device.
Array< PetscScalar > buffer
Communication buffer.
Array< int > count
Number of DOFs to send/receive for each process.
void create(const Array< Array< libMesh::dof_id_type > > &list)
Allocate data.
Array< int > offset
Starting offset of each process into the communication buffer.
Array< Array< libMesh::dof_id_type > > list
List of DOFs to send/receive for each process.
Kokkos functions for direct assembly on device.