DOLFINx 0.8.0
DOLFINx C++ interface
|
#include <petsc.h>
Public Types | |
enum class | AssemblyType : std::int32_t { FINAL , FLUSH } |
Public Member Functions | |
Matrix (MPI_Comm comm, const SparsityPattern &sp, std::string type=std::string()) | |
Create holder for a PETSc Mat object from a sparsity pattern. | |
Matrix (Mat A, bool inc_ref_count) | |
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) |
double | norm (Norm norm_type) const |
Return norm of matrix. | |
void | set_options_prefix (std::string options_prefix) |
std::string | get_options_prefix () const |
void | set_from_options () |
Call PETSc function MatSetFromOptions on the PETSc Mat object. | |
Public Member Functions inherited from Operator | |
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 |
Vec | create_vector (std::size_t dim) const |
Mat | mat () const |
Return PETSc Mat pointer. | |
Static Public Member Functions | |
static auto | set_fn (Mat A, InsertMode mode) |
static auto | set_block_fn (Mat A, InsertMode mode) |
static auto | set_block_expand_fn (Mat A, int bs0, int bs1, InsertMode mode) |
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.
|
strong |
Assembly type FINAL - corresponds to PETSc MAT_FINAL_ASSEMBLY FLUSH - corresponds to PETSc MAT_FLUSH_ASSEMBLY
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.
void apply | ( | AssemblyType | type | ) |
Finalize assembly of tensor. The following values are recognized for the mode parameter:
type | FINAL - corresponds to PETSc MatAssemblyBegin+End(MAT_FINAL_ASSEMBLY) FLUSH - corresponds to PETSc MatAssemblyBegin+End(MAT_FLUSH_ASSEMBLY) |
std::string get_options_prefix | ( | ) | const |
Returns the prefix used by PETSc when searching the options database
|
inlinestatic |
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.
[in] | A | The matrix to set values in |
[in] | bs0 | Block size for the matrix rows |
[in] | bs1 | Block size for the matrix columns |
[in] | mode | The PETSc insert mode (ADD_VALUES, INSERT_VALUES, ...) |
|
inlinestatic |
Return a function with an interface for adding or inserting values into the matrix A using blocked indices (calls MatSetValuesBlockedLocal)
[in] | A | The matrix to set values in |
[in] | mode | The PETSc insert mode (ADD_VALUES, INSERT_VALUES, ...) |
|
inlinestatic |
Return a function with an interface for adding or inserting values into the matrix A (calls MatSetValuesLocal)
[in] | A | The matrix to set values in |
[in] | mode | The PETSc insert mode (ADD_VALUES, INSERT_VALUES, ...) |
void set_options_prefix | ( | std::string | options_prefix | ) |
Sets the prefix used by PETSc when searching the options database