1#ifndef included_AMP_EpetraMatrixData
2#define included_AMP_EpetraMatrixData
4#include "AMP/matrices/data/MatrixData.h"
76 std::shared_ptr<MatrixData>
transpose()
const override;
86 void setEpetraMaps( std::shared_ptr<Vector> range, std::shared_ptr<Vector> domain );
95 std::string
type()
const override {
return "EpetraMatrixData"; }
111 static std::shared_ptr<EpetraMatrixData>
createView( std::shared_ptr<MatrixData> p );
123 const typeID &
id )
override;
129 const typeID &
id )
override;
135 const typeID &
id )
const override;
137 std::vector<size_t> &cols,
138 std::vector<double> &values )
const override;
157 constexpr auto type = getTypeID<double>();
Provides C++ wrapper around MPI routines.
A Matrix with an Epetra_CrsMatrix interface.
void getValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, void *values, const typeID &id) const override
Get values in the matrix.
std::shared_ptr< Discretization::DOFManager > getRightDOFManager() const override
Get the DOFManager associated with a right vector ( For , is a right vector )
void setOtherData()
Update data off-core.
std::vector< size_t > getColumnIDs(size_t row) const override
Given a row, retrieve the non-zero column indices of the matrix in compressed format.
std::string type() const override
Return the type of the matrix.
void VerifyEpetraReturn(int err, const char *func) const
Ensure Epetra methods return correctly.
virtual Epetra_CrsMatrix & getEpetra_CrsMatrix()
Return an Epetra_CrsMatrix.
bool d_DeleteMatrix
Indicates if the destructor calls delete.
std::shared_ptr< Vector > createInputVector() const
size_t numLocalRows() const override
Get the number of local rows in the matrix.
virtual const Epetra_CrsMatrix & getEpetra_CrsMatrix() const
Return an Epetra_CrsMatrix.
void getRowByGlobalID(size_t row, std::vector< size_t > &cols, std::vector< double > &values) const override
Retrieve a row of the matrix in compressed format.
typeID getCoeffType() const override
Return the typeid of the matrix coeffs.
std::shared_ptr< Epetra_Map > d_RangeMap
Range map for the Epetra_CrsMatrix.
size_t numberColumnIDs(size_t row) const override
Given a row, retrieve the number of non-zero column indices of the matrix.
size_t numGlobalColumns() const override
Get the number of global columns 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 numLocalColumns() const override
Get the number of local columns in the matrix.
std::shared_ptr< MatrixData > cloneMatrixData() const override
Clone the data.
void addValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const void *values, const typeID &id) override
Add values to those in the matrix.
EpetraMatrixData(std::shared_ptr< MatrixParametersBase > params)
virtual ~EpetraMatrixData()
Destructor.
void setEpetraMaps(std::shared_ptr< Vector > range, std::shared_ptr< Vector > domain)
Change the EpetraMaps for the matrix.
std::shared_ptr< Epetra_Map > d_DomainMap
Domain map for the Epetra_CrsMatrix.
void makeConsistent(AMP::LinearAlgebra::ScatterType t) override
Perform communication to ensure values in the matrix are the same across cores.
static std::shared_ptr< EpetraMatrixData > createView(std::shared_ptr< MatrixData > p)
Create an EpetraMatrixData view of an AMP::LinearAlgebra::Matrix.
std::map< int, std::map< int, double > > d_OtherData
storage of off-core data
EpetraMatrixData(const EpetraMatrixData &rhs)
EpetraMatrixData()=delete
void setValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const void *values, const typeID &id) override
Set values in the matrix.
void createValuesByGlobalID(size_t, const std::vector< size_t > &)
void removeRange(AMP::Scalar, AMP::Scalar) override
Remove matrix entries within given range.
EpetraMatrixData(Epetra_CrsMatrix *inMatrix, bool dele=false)
Constructor.
size_t numGlobalRows() const override
Get the number of global rows in the matrix.
std::shared_ptr< MatrixData > transpose() const override
Transpose.
std::shared_ptr< Vector > createOutputVector() const
Epetra_CrsMatrix * d_epetraMatrix
Bare pointer to an Epetra_CrsMatrix.
AMP::AMP_MPI getComm() const override
Get the comm.
EpetraMatrixData & operator=(const EpetraMatrixData &)=delete
void fillComplete()
A call-through to Epetra_CrsMatrix fillComplete.
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.