1#ifndef included_AMP_Petsc_MatrixData
2#define included_AMP_Petsc_MatrixData
5#include "AMP/matrices/data/MatrixData.h"
43 virtual std::string
type()
const override {
return "NativePetscMatrixData"; }
47 std::shared_ptr<MatrixData>
transpose()
const override;
52 size_t,
size_t,
const size_t *,
const size_t *,
const void *,
const typeID & )
override;
54 size_t,
size_t,
const size_t *,
const size_t *,
const void *,
const typeID & )
override;
56 size_t,
size_t,
const size_t *,
const size_t *,
void *,
const typeID & )
const override;
57 void getRowByGlobalID(
size_t, std::vector<size_t> &, std::vector<double> & )
const override;
82 constexpr auto type = getTypeID<PetscScalar>();
Provides C++ wrapper around MPI routines.
This is a thin wrapper around PETSc Mat.
typeID getCoeffType() const override
Return the typeid of the matrix coeffs.
NativePetscMatrixData(std::shared_ptr< MatrixParametersBase > params)
std::shared_ptr< MatrixData > transpose() const override
Transpose.
virtual ~NativePetscMatrixData()
Destructor.
AMP_MPI getComm() const override
Get the comm.
std::shared_ptr< Vector > createInputVector() const
void addValuesByGlobalID(size_t, size_t, const size_t *, const size_t *, const void *, const typeID &) override
Add values to those in the matrix.
std::shared_ptr< Discretization::DOFManager > getLeftDOFManager() const override
Get the DOFManager associated with a left vector ( For , is a left vector )
size_t numberColumnIDs(size_t row) const override
Given a row, retrieve the number of non-zero column indices of the matrix.
std::shared_ptr< Discretization::DOFManager > getRightDOFManager() const override
Get the DOFManager associated with a right vector ( For , is a right vector )
static std::shared_ptr< MatrixData > duplicateMat(Mat m)
Create a NativePetscMatrixData with the same non-zero structure.
NativePetscMatrixData(Mat m, bool dele=false)
Construct a matrix from a PETSc Mat.
size_t numGlobalColumns() const override
Get the number of global columns in the matrix.
void getRowByGlobalID(size_t, std::vector< size_t > &, std::vector< double > &) const override
Retrieve a row of the matrix in compressed format.
void setMat(Mat mat, bool manage=true)
std::shared_ptr< Vector > createOutputVector() const
void makeConsistent(AMP::LinearAlgebra::ScatterType t) override
Perform communication to ensure values in the matrix are the same across cores.
void copyFromMat(Mat m)
Copy data from a PETSc Mat.
void setValuesByGlobalID(size_t, size_t, const size_t *, const size_t *, const void *, const typeID &) override
Set values in the matrix.
std::vector< size_t > getColumnIDs(size_t) const override
Given a row, retrieve the non-zero column indices of the matrix in compressed format.
bool d_MatCreatedInternally
void getValuesByGlobalID(size_t, size_t, const size_t *, const size_t *, void *, const typeID &) const override
Get values in the matrix.
virtual std::string type() const override
Return the type of the matrix.
void removeRange(AMP::Scalar, AMP::Scalar) override
Remove matrix entries within given range.
std::shared_ptr< MatrixData > cloneMatrixData() const override
Clone the data.
size_t numGlobalRows() const override
Get the number of global rows in the matrix.
Scalar is a class used to store a scalar variable that may be different types/precision.
#define AMP_ERROR(MSG)
Throw error.
ScatterType
Flag to choose algorithm for makeConsistent.
Class to store type info.