|
preCICE v3.3.0
|
#include <Petsc.hpp>
Public Member Functions | |
| Matrix (const Matrix &)=delete | |
| Delete copy and assignment constructor. | |
| Matrix & | operator= (const Matrix &)=delete |
| Matrix (std::string name="") | |
| Matrix (Matrix &&)=default | |
| Move constructor, use the implicitly declared. | |
| Matrix & | operator= (Matrix &&)=default |
| ~Matrix () | |
| operator Mat & () | |
| Enables implicit conversion into a reference to a PETSc Mat type. | |
| void | assemble (MatAssemblyType type=MAT_FINAL_ASSEMBLY) |
| void | init (PetscInt localRows, PetscInt localCols, PetscInt globalRows, PetscInt globalCols, MatType type=nullptr, bool doSetup=true) |
| Initializes matrix of given size and type. | |
| void | reset () |
| Destroys and recreates the matrix on the same communicator. | |
| MatInfo | getInfo (MatInfoType flag) const |
| Get the MatInfo struct for the matrix. | |
| void | setValue (PetscInt row, PetscInt col, PetscScalar value) |
| void | fillWithRandoms () |
| void | setColumn (Vector &v, PetscInt col) |
| std::pair< PetscInt, PetscInt > | getSize () const |
| Returns (rows, cols) global size. | |
| std::pair< PetscInt, PetscInt > | getLocalSize () const |
| Returns (rows, cols) local size. | |
| std::pair< PetscInt, PetscInt > | ownerRange () const |
| Returns a pair that mark the beginning and end of the matrix' ownership range. | |
| std::pair< PetscInt, PetscInt > | ownerRangeColumn () const |
| Returns a pair that mark the beginning and end of the matrix' column ownership range. | |
| PetscInt | blockSize () const |
| Returns the block size of the matrix. | |
| void | write (const std::string &filename, VIEWERFORMAT format=ASCII) const |
| Writes the matrix to file. | |
| void | read (const std::string &filename) |
| Reads the matrix from file, stored in PETSc binary format. | |
| void | view () const |
| Prints the matrix. | |
| void | viewDraw () const |
| Graphically draws the matrix structure. | |
Public Attributes | |
| Mat | matrix = nullptr |
|
delete |
Delete copy and assignment constructor.
Copying and assignment of this class would involve copying the pointer to the PETSc object and finally cause double destruction of it.
|
explicit |
|
default |
Move constructor, use the implicitly declared.
| void precice::utils::petsc::Matrix::assemble | ( | MatAssemblyType | type = MAT_FINAL_ASSEMBLY | ) |
| PetscInt precice::utils::petsc::Matrix::blockSize | ( | ) | const |
| void precice::utils::petsc::Matrix::fillWithRandoms | ( | ) |
| MatInfo precice::utils::petsc::Matrix::getInfo | ( | MatInfoType | flag | ) | const |
Get the MatInfo struct for the matrix.
See http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatInfo.html for description of fields.
| std::pair< PetscInt, PetscInt > precice::utils::petsc::Matrix::getLocalSize | ( | ) | const |
| std::pair< PetscInt, PetscInt > precice::utils::petsc::Matrix::getSize | ( | ) | const |
| void precice::utils::petsc::Matrix::init | ( | PetscInt | localRows, |
| PetscInt | localCols, | ||
| PetscInt | globalRows, | ||
| PetscInt | globalCols, | ||
| MatType | type = nullptr, | ||
| bool | doSetup = true ) |
Initializes matrix of given size and type.
| [in] | localRows,localCols | The number of rows/cols that are local to the processor |
| [in] | globalRows,globalCols | The number of global rows/cols. |
| [in] | type | PETSc type of the matrix |
| [in] | doSetup | Call MatSetup(). Not calling MatSetup can have performance gains when using preallocation |
| precice::utils::petsc::Matrix::operator Mat & | ( | ) |
| std::pair< PetscInt, PetscInt > precice::utils::petsc::Matrix::ownerRange | ( | ) | const |
| std::pair< PetscInt, PetscInt > precice::utils::petsc::Matrix::ownerRangeColumn | ( | ) | const |
| void precice::utils::petsc::Matrix::read | ( | const std::string & | filename | ) |
| void precice::utils::petsc::Matrix::reset | ( | ) |
| void precice::utils::petsc::Matrix::setColumn | ( | Vector & | v, |
| PetscInt | col ) |
| void precice::utils::petsc::Matrix::setValue | ( | PetscInt | row, |
| PetscInt | col, | ||
| PetscScalar | value ) |
| void precice::utils::petsc::Matrix::view | ( | ) | const |
| void precice::utils::petsc::Matrix::viewDraw | ( | ) | const |
| void precice::utils::petsc::Matrix::write | ( | const std::string & | filename, |
| VIEWERFORMAT | format = ASCII ) const |