A Matrix with an Epetra_CrsMatrix interface. More...
#include <EpetraMatrixData.h>

Public Member Functions | |
| template<class TYPE > | |
| void | addValuesByGlobalID (size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const TYPE *values) |
| Add values to those in the matrix. | |
| 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. | |
| virtual size_t | beginCol () const |
| Get the global id of first column in diagonal block. | |
| virtual size_t | beginRow () const |
| Get the global id of the beginning row. | |
| std::shared_ptr< MatrixData > | cloneMatrixData () const override |
| Clone the data. | |
| std::shared_ptr< Vector > | createInputVector () const |
| std::shared_ptr< Vector > | createOutputVector () const |
| void | createValuesByGlobalID (size_t, const std::vector< size_t > &) |
| virtual size_t | endCol () const |
| Get the global id of last column in diagonal block. | |
| virtual size_t | endRow () const |
| Get the global id of the ending row. | |
| EpetraMatrixData (const EpetraMatrixData &rhs) | |
| EpetraMatrixData (Epetra_CrsMatrix *inMatrix, bool dele=false) | |
| Constructor. | |
| EpetraMatrixData (std::shared_ptr< MatrixParametersBase > params) | |
| void | fillComplete () |
| A call-through to Epetra_CrsMatrix fillComplete. | |
| virtual AMP::Utilities::Backend | getBackend () const |
| Get the backend. | |
| typeID | getCoeffType () const override |
| Return the typeid of the matrix coeffs. | |
| 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. | |
| AMP::AMP_MPI | getComm () const override |
| Get the comm. | |
| virtual Epetra_CrsMatrix & | getEpetra_CrsMatrix () |
| Return an Epetra_CrsMatrix. | |
| virtual const Epetra_CrsMatrix & | getEpetra_CrsMatrix () const |
| Return an Epetra_CrsMatrix. | |
| uint64_t | getID () const |
| Get a unique id hash for the vector. | |
| std::shared_ptr< Discretization::DOFManager > | getLeftDOFManager () const override |
| Get the DOFManager associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector ) | |
| virtual std::shared_ptr< Variable > | getLeftVariable () const |
| Get the variable associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector ) | |
| std::shared_ptr< Discretization::DOFManager > | getRightDOFManager () const override |
| Get the DOFManager associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector ) | |
| virtual std::shared_ptr< Variable > | getRightVariable () const |
| Get the variable associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector ) | |
| 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. | |
| template<class TYPE > | |
| void | getValuesByGlobalID (size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, TYPE *values) const |
| Get values in the matrix. | |
| 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. | |
| void | makeConsistent (AMP::LinearAlgebra::ScatterType t) override |
| Perform communication to ensure values in the matrix are the same across cores. | |
| virtual std::uint16_t | mode () const |
| Return CSR mode of the matrix. | |
| 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. | |
| size_t | numGlobalRows () const override |
| Get the number of global rows in the matrix. | |
| size_t | numLocalColumns () const override |
| Get the number of local columns in the matrix. | |
| size_t | numLocalRows () const override |
| Get the number of local rows in the matrix. | |
| EpetraMatrixData & | operator= (const EpetraMatrixData &)=delete |
| virtual void | registerChildObjects (AMP::IO::RestartManager *manager) const |
| Register any child objects. | |
| void | removeRange (AMP::Scalar, AMP::Scalar) override |
| Remove matrix entries within given range. | |
| virtual void | setBackend (AMP::Utilities::Backend backend) |
| void | setEpetraMaps (std::shared_ptr< Vector > range, std::shared_ptr< Vector > domain) |
| Change the EpetraMaps for the matrix. | |
| template<class TYPE > | |
| void | setValuesByGlobalID (size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const TYPE *values) |
| Set values in the matrix. | |
| 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. | |
| std::shared_ptr< MatrixData > | shared_from_this () |
| std::shared_ptr< const MatrixData > | shared_from_this () const |
| std::shared_ptr< MatrixData > | transpose () const override |
| Transpose. | |
| std::string | type () const override |
| Return the type of the matrix. | |
| virtual void | writeRestart (int64_t fid) const |
| Write restart data to file. | |
| virtual | ~EpetraMatrixData () |
| Destructor. | |
Static Public Member Functions | |
| static std::shared_ptr< EpetraMatrixData > | createView (std::shared_ptr< MatrixData > p) |
| Create an EpetraMatrixData view of an AMP::LinearAlgebra::Matrix. | |
Protected Member Functions | |
| void | setOtherData () |
| Update data off-core. | |
| void | VerifyEpetraReturn (int err, const char *func) const |
| Ensure Epetra methods return correctly. | |
Protected Attributes | |
| bool | d_DeleteMatrix |
| Indicates if the destructor calls delete. | |
| std::shared_ptr< Epetra_Map > | d_DomainMap |
| Domain map for the Epetra_CrsMatrix. | |
| Epetra_CrsMatrix * | d_epetraMatrix |
| Bare pointer to an Epetra_CrsMatrix. | |
| uint64_t | d_hash = 0 |
| std::map< int, std::map< int, double > > | d_OtherData |
| \(A_{i,j}\) storage of off-core data | |
| std::shared_ptr< MatrixParametersBase > | d_pParameters |
| std::shared_ptr< Epetra_Map > | d_RangeMap |
| Range map for the Epetra_CrsMatrix. | |
| std::weak_ptr< MatrixData > | weak_ptr_ |
Private Member Functions | |
| EpetraMatrixData ()=delete | |
A Matrix with an Epetra_CrsMatrix interface.
An EpetraMatrixData presents an Epetra_Matrix class. Given an AMP::LinearAlgebra::Matrix, this class can create an Epetra view without copying the data. As such, this class serves three purposes:
Definition at line 27 of file EpetraMatrixData.h.
|
privatedelete |
|
explicit |
| AMP::LinearAlgebra::EpetraMatrixData::EpetraMatrixData | ( | const EpetraMatrixData & | rhs | ) |
|
explicit |
Constructor.
| [in] | inMatrix | Matrix to wrap |
| [in] | dele | If true, then this class will delete the Epetra_CrsMatrix |
|
virtual |
Destructor.
|
inherited |
Add values to those in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to add to the matrix (row-major ordering) |
This method may fail if the matrix has not allocated a particular (row,col) specified, depending on the actual subclass of matrix used.
|
overridevirtual |
Add values to those in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to add to the matrix (row-major ordering) |
| [in] | id | typeID of raw data |
This method may fail if the matrix has not allocated a particular (row,col) specified, depending on the actual subclass of matrix used.
Implements AMP::LinearAlgebra::MatrixData.
|
virtualinherited |
Get the global id of first column in diagonal block.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
virtualinherited |
Get the global id of the beginning row.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
overridevirtual |
Clone the data.
Implements AMP::LinearAlgebra::MatrixData.
| std::shared_ptr< Vector > AMP::LinearAlgebra::EpetraMatrixData::createInputVector | ( | ) | const |
| std::shared_ptr< Vector > AMP::LinearAlgebra::EpetraMatrixData::createOutputVector | ( | ) | const |
| void AMP::LinearAlgebra::EpetraMatrixData::createValuesByGlobalID | ( | size_t | , |
| const std::vector< size_t > & | |||
| ) |
|
static |
Create an EpetraMatrixData view of an AMP::LinearAlgebra::Matrix.
| [in] | p | The matrix to view |
|
virtualinherited |
Get the global id of last column in diagonal block.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
virtualinherited |
Get the global id of the ending row.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
| void AMP::LinearAlgebra::EpetraMatrixData::fillComplete | ( | ) |
A call-through to Epetra_CrsMatrix fillComplete.
|
inlinevirtualinherited |
Get the backend.
Definition at line 268 of file MatrixData.h.
References AMP_ASSERT, and AMP::LinearAlgebra::MatrixData::d_pParameters.
|
inlineoverridevirtual |
Return the typeid of the matrix coeffs.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 154 of file EpetraMatrixData.h.
References type().
|
overridevirtual |
Given a row, retrieve the non-zero column indices of the matrix in compressed format.
| [in] | row | Which row |
Implements AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the comm.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
virtual |
Return an Epetra_CrsMatrix.
|
virtual |
Return an Epetra_CrsMatrix.
|
inherited |
Get a unique id hash for the vector.
|
overridevirtual |
Get the DOFManager associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector )
Implements AMP::LinearAlgebra::MatrixData.
|
inlinevirtualinherited |
Get the variable associated with a left vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{y}\) is a left vector )
Definition at line 215 of file MatrixData.h.
References AMP::LinearAlgebra::MatrixData::d_pParameters.
|
overridevirtual |
Get the DOFManager associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector )
Implements AMP::LinearAlgebra::MatrixData.
|
inlinevirtualinherited |
Get the variable associated with a right vector ( For \(\mathbf{y}^T\mathbf{Ax}\), \(\mathbf{x}\) is a right vector )
Definition at line 205 of file MatrixData.h.
References AMP::LinearAlgebra::MatrixData::d_pParameters.
|
overridevirtual |
Retrieve a row of the matrix in compressed format.
| [in] | row | Which row |
| [out] | cols | The column ids of the returned values |
| [out] | values | The values in the row |
Implements AMP::LinearAlgebra::MatrixData.
|
inherited |
Get values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [out] | values | The values to get from the matrix (row-major ordering) |
This method will return zero for any entries that have not been allocated or are not ghosts on the current processor.
|
overridevirtual |
Get values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [out] | values | The values to get from the matrix (row-major ordering) |
| [in] | id | typeID of raw data |
This method will return zero for any entries that have not been allocated or are not ghosts on the current processor.
Implements AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Perform communication to ensure values in the matrix are the same across cores.
Implements AMP::LinearAlgebra::MatrixData.
|
inlinevirtualinherited |
Return CSR mode of the matrix.
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
Definition at line 57 of file MatrixData.h.
|
overridevirtual |
Given a row, retrieve the number of non-zero column indices of the matrix.
| [in] | row | Which row |
Implements AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the number of global columns in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the number of global rows in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the number of local columns in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
overridevirtual |
Get the number of local rows in the matrix.
Reimplemented from AMP::LinearAlgebra::MatrixData.
|
delete |
|
virtualinherited |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
inlineoverridevirtual |
Remove matrix entries within given range.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 78 of file EpetraMatrixData.h.
References AMP_ERROR.
|
inlinevirtualinherited |
Definition at line 274 of file MatrixData.h.
References AMP_ASSERT, and AMP::LinearAlgebra::MatrixData::d_pParameters.
| void AMP::LinearAlgebra::EpetraMatrixData::setEpetraMaps | ( | std::shared_ptr< Vector > | range, |
| std::shared_ptr< Vector > | domain | ||
| ) |
Change the EpetraMaps for the matrix.
| [in] | range | A vector that represents the range: y in y = A*x (row map) |
| [in] | domain | A vector that represents the domain: x in y = A*x (column map) |
This does not change the matrix, just the maps stored above
|
protected |
Update data off-core.
|
inherited |
Set values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to set to the matrix (row-major ordering) |
This method may fail if the matrix has not allocated a particular (row,col) specified, depending on the actual subclass of matrix used.
|
overridevirtual |
Set values in the matrix.
| [in] | num_rows | The number of rows represented in values |
| [in] | num_cols | The number of cols represented in values |
| [in] | rows | The row ids of values |
| [in] | cols | The column ids of values |
| [in] | values | The values to set to the matrix (row-major ordering) |
| [in] | id | typeID of raw data |
This method may fail if the matrix has not allocated a particular (row,col) specified, depending on the actual subclass of matrix used.
Implements AMP::LinearAlgebra::MatrixData.
|
inlineinherited |
Definition at line 28 of file enable_shared_from_this.h.
|
inlineinherited |
Definition at line 46 of file enable_shared_from_this.h.
|
overridevirtual |
Transpose.
Implements AMP::LinearAlgebra::MatrixData.
|
inlineoverridevirtual |
Return the type of the matrix.
Implements AMP::LinearAlgebra::MatrixData.
Definition at line 95 of file EpetraMatrixData.h.
Referenced by getCoeffType().
|
protected |
Ensure Epetra methods return correctly.
| [in] | err | The return value from the method |
| [in] | func | The name of the Epetra method called |
Throws an execption if err != 0
|
virtualinherited |
Write restart data to file.
This function will write the mesh to an HDF5 file
| fid | File identifier to write |
Reimplemented in AMP::LinearAlgebra::CSRMatrixData< Config >.
|
protected |
Indicates if the destructor calls delete.
Definition at line 47 of file EpetraMatrixData.h.
|
protected |
Domain map for the Epetra_CrsMatrix.
Definition at line 43 of file EpetraMatrixData.h.
|
protected |
Bare pointer to an Epetra_CrsMatrix.
Definition at line 35 of file EpetraMatrixData.h.
|
protectedinherited |
Definition at line 311 of file MatrixData.h.
|
protected |
\(A_{i,j}\) storage of off-core data
Definition at line 50 of file EpetraMatrixData.h.
|
protectedinherited |
Definition at line 308 of file MatrixData.h.
Referenced by AMP::LinearAlgebra::MatrixData::getBackend(), AMP::LinearAlgebra::MatrixData::getComm(), AMP::LinearAlgebra::MatrixData::getLeftVariable(), AMP::LinearAlgebra::MatrixData::getRightVariable(), and AMP::LinearAlgebra::MatrixData::setBackend().
|
protected |
Range map for the Epetra_CrsMatrix.
Definition at line 39 of file EpetraMatrixData.h.
|
mutableprotectedinherited |
Definition at line 69 of file enable_shared_from_this.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |