It is a simple wrapper for a PETSc matrix pointer (Mat). Its main purpose is to assist memory management of PETSc Mat objects.
More...
|
| Matrix (MPI_Comm comm, const SparsityPattern &sp, const std::string &type=std::string()) |
| Create holder for a PETSc Mat object from a sparsity pattern.
|
|
| Matrix (Mat A, bool inc_ref_count) |
| Create holder of a PETSc Mat object/pointer. The Mat A object should already be created. If inc_ref_count is true, the reference counter of the Mat will be increased. The Mat reference count will always be decreased upon destruction of the petsc::Matrix.
|
|
| Matrix (const Matrix &A)=delete |
|
| Matrix (Matrix &&A)=default |
| Move constructor (falls through to base class move constructor)
|
|
| ~Matrix ()=default |
| Destructor.
|
|
Matrix & | operator= (const Matrix &A)=delete |
| Assignment operator (deleted)
|
|
Matrix & | operator= (Matrix &&A)=default |
| Move assignment operator.
|
|
void | apply (AssemblyType type) |
| Finalize assembly of tensor. The following values are recognized for the mode parameter:
|
|
double | norm (Norm norm_type) const |
| Return norm of matrix.
|
|
void | set_options_prefix (std::string options_prefix) |
| Sets the prefix used by PETSc when searching the options database.
|
|
std::string | get_options_prefix () const |
| Returns the prefix used by PETSc when searching the options database.
|
|
void | set_from_options () |
| Call PETSc function MatSetFromOptions on the PETSc Mat object.
|
|
| Operator (Mat A, bool inc_ref_count) |
| Constructor.
|
|
| Operator (const Operator &A)=delete |
|
| Operator (Operator &&A) |
| Move constructor.
|
|
virtual | ~Operator () |
| Destructor.
|
|
Operator & | operator= (const Operator &A)=delete |
| Assignment operator (deleted)
|
|
Operator & | operator= (Operator &&A) |
| Move assignment operator.
|
|
std::array< std::int64_t, 2 > | size () const |
| Return number of rows and columns (num_rows, num_cols). PETSc returns -1 if size has not been set.
|
|
Vec | create_vector (std::size_t dim) const |
| Initialize vector to be compatible with the matrix-vector product y = Ax. In the parallel case, size and layout are both important.
|
|
Mat | mat () const |
| Return PETSc Mat pointer.
|
|
|
static auto | set_fn (Mat A, InsertMode mode) |
| Return a function with an interface for adding or inserting values into the matrix A (calls MatSetValuesLocal)
|
|
static auto | set_block_fn (Mat A, InsertMode mode) |
| Return a function with an interface for adding or inserting values into the matrix A using blocked indices (calls MatSetValuesBlockedLocal)
|
|
static auto | set_block_expand_fn (Mat A, int bs0, int bs1, InsertMode mode) |
| Return a function with an interface for adding or inserting blocked values to the matrix A using non-blocked insertion (calls MatSetValuesLocal). Internally it expands the blocked indices into non-blocked arrays.
|
|
It is a simple wrapper for a PETSc matrix pointer (Mat). Its main purpose is to assist memory management of PETSc Mat objects.
For advanced usage, access the PETSc Mat pointer using the function mat() and use the standard PETSc interface.