20 #ifndef GEOS_LINEARALGEBRA_INTERFACES_PETSCEXPORT_HPP_
21 #define GEOS_LINEARALGEBRA_INTERFACES_PETSCEXPORT_HPP_
26 extern "C" struct _p_IS;
29 extern "C" struct _p_VecScatter;
80 template<
typename OFFSET_TYPE,
typename COLUMN_TYPE >
119 using IS =
struct _p_IS *;
122 using VecScatter =
struct _p_VecScatter *;
131 VecScatter m_scatter{};
Facilitates exporting Petsc matrix and associated vector objects (either in parallel or serial).
void importVector(arrayView1d< const real64 > const &values, PetscVector &vec) const
Import the target vector from an array provided by the user.
~PetscExport()
Destructor.
PetscExport()
Parallel export constructor.
PetscExport(PetscMatrix const &mat, integer targetRank)
Single-rank export constructor.
void exportVector(PetscVector const &vec, arrayView1d< real64 > const &values) const
Export the target vector into an array provided by the user.
void exportCRS(PetscMatrix const &mat, arrayView1d< OFFSET_TYPE > const &rowOffsets, arrayView1d< COLUMN_TYPE > const &colIndices, arrayView1d< real64 > const &values) const
Export the matrix into CRS arrays provided by the user.
This class creates and provides basic support for the Mat matrix object type used in PETSc.
This class creates and provides basic support for Vec vector object type used in PETSc.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
std::int32_t integer
Signed integer type.