|
DOLFINx 0.12.0.0
DOLFINx C++
|
Linear algebra interface. More...
Namespaces | |
| namespace | impl |
| Fetch the rows of B that correspond to the ghost columns of A. | |
| namespace | petsc |
| PETSc linear algebra functions. | |
Classes | |
| class | MatrixCSR |
| Distributed sparse matrix using compressed sparse row storage. More... | |
| class | SLEPcEigenSolver |
| This class provides an eigenvalue solver for PETSc matrices. It is a wrapper for the SLEPc eigenvalue solver. More... | |
| class | SparsityPattern |
| class | SuperLUDistStructs |
| Forward declare structs to avoid exposing SuperLU_DIST headers. More... | |
| struct | SuperMatrixDeleter |
| class | SuperLUDistMatrix |
| struct | GridInfoDeleter |
| struct | ScalePermStructDeleter |
| struct | LUStructDeleter |
| struct | SolveStructDeleter |
| class | SuperLUDistSolver |
| class | Vector |
| A vector that can be distributed across processes. More... | |
Concepts | |
| concept | MatSet |
| Matrix accumulate/set concept for functions that can be used in assemblers to accumulate or set values in a matrix. | |
| concept | VectorPackKernel |
| la::Vector scatter pack/unpack function concept. | |
| concept | GetPtrConcept |
| Access to pointer function concept. | |
Typedefs | |
| template<typename T> | |
| using | map_t = impl::map<T> |
| Map scalar type to SuperLU_DIST 'typed' structs. | |
Enumerations | |
| enum class | BlockMode : int { compact = 0 , expanded = 1 } |
| Modes for representing block structured matrices. More... | |
| enum class | Norm : std::int8_t { l1 , l2 , linf , frobenius } |
| Norm types. | |
Functions | |
| template<typename T, int BS = -1> | |
| dolfinx::la::MatrixCSR< T > | matmul (const dolfinx::la::MatrixCSR< T > &A, const dolfinx::la::MatrixCSR< T > &B) |
| Compute C = A*B as a distributed MatrixCSR. | |
| template<typename T, int BS0 = -1, int BS1 = -1> | |
| dolfinx::la::MatrixCSR< T > | transpose (const dolfinx::la::MatrixCSR< T > &A) |
| Compute the distributed transpose of a MatrixCSR. | |
| template<dolfinx::scalar T> | |
| void | set_diagonal (MatSet< T > auto &&set_fn, const common::LocalIndexRange auto &rows, T diagonal=T(1)) |
| Set a value on the diagonal of a matrix for specified rows. | |
| template<dolfinx::scalar T> | |
| void | set_diagonal (MatSet< T > auto &&set_fn, const common::LocalIndexRange auto &rows, std::span< const T > diagonals) |
| Set values on the diagonal of a matrix for specified rows, with a value per row. | |
| template<class V> | |
| auto | inner_product (const V &a, const V &b) |
| Compute the inner product of two vectors. | |
| template<class V> | |
| auto | squared_norm (const V &a) |
| Compute the squared L2 norm of vector. | |
| template<class V> | |
| auto | norm (const V &x, Norm type=Norm::l2) |
| Compute the norm of the vector. | |
| template<class V> | |
| void | orthonormalize (std::vector< std::reference_wrapper< V > > basis) |
| Orthonormalize a set of vectors. | |
| template<class V> | |
| bool | is_orthonormal (std::vector< std::reference_wrapper< const V > > basis, dolfinx::scalar_value_t< typename V::value_type > eps=std::numeric_limits< dolfinx::scalar_value_t< typename V::value_type > >::epsilon()) |
| Test if basis is orthonormal. | |
Linear algebra interface.
Interface to linear algebra data structures and solvers.
|
strong |
| auto inner_product | ( | const V & | a, |
| const V & | b ) |
| bool is_orthonormal | ( | std::vector< std::reference_wrapper< const V > > | basis, |
| dolfinx::scalar_value_t< typename V::value_type > | eps = std::numeric_limits< dolfinx::scalar_value_t<typename V::value_type>>::epsilon() ) |
Test if basis is orthonormal.
Returns true if ||x_i - x_j|| - delta_{ij} < eps for all i, j, and otherwise false.
| [in] | basis | Set of vectors to check. |
| [in] | eps | Tolerance. |
| dolfinx::la::MatrixCSR< T > matmul | ( | const dolfinx::la::MatrixCSR< T > & | A, |
| const dolfinx::la::MatrixCSR< T > & | B ) |
Compute C = A*B as a distributed MatrixCSR.
Both A and B must have square block size {BS, BS}. Passing the compile-time block size as the template argument enables compile-time loop unrolling in the inner GEMM.
| T | Scalar type. |
| BS | Square block size, or -1 for runtime dispatch (non-optimised). When >= 1, A and B must have block_size() == {BS, BS}. |
| A | Left matrix. |
| B | Right matrix. |
| auto norm | ( | const V & | x, |
| Norm | type = Norm::l2 ) |
| void orthonormalize | ( | std::vector< std::reference_wrapper< V > > | basis | ) |
Orthonormalize a set of vectors.
| V | dolfinx::la::Vector |
| [in,out] | basis | The set of vectors to orthonormalise. The vectors must have identical parallel layouts. The vectors are modified in-place. |
| void set_diagonal | ( | MatSet< T > auto && | set_fn, |
| const common::LocalIndexRange auto & | rows, | ||
| std::span< const T > | diagonals ) |
Set values on the diagonal of a matrix for specified rows, with a value per row.
See the single-value set_diagonal for usage.
| [in] | set_fn | The function for setting values to a matrix. |
| [in] | rows | Row blocks, in local indices, whose diagonal to set. May have static or dynamic extent. |
| [in] | diagonals | Diagonal values, with diagonals[i] the value for rows[i]. Must have the same length as rows. |
| void set_diagonal | ( | MatSet< T > auto && | set_fn, |
| const common::LocalIndexRange auto & | rows, | ||
| T | diagonal = T(1) ) |
Set a value on the diagonal of a matrix for specified rows.
This function is typically called after assembly. The assembly function zeroes Dirichlet rows and columns. For block matrices, this function should normally be called only on the diagonal blocks, i.e. blocks for which the test and trial spaces are the same.
| [in] | set_fn | The function for setting values to a matrix. |
| [in] | rows | Row blocks, in local indices, whose diagonal to set. May have static or dynamic extent. |
| [in] | diagonal | Value for the diagonal of each row in rows. |
| auto squared_norm | ( | const V & | a | ) |
Compute the squared L2 norm of vector.
| dolfinx::la::MatrixCSR< T > transpose | ( | const dolfinx::la::MatrixCSR< T > & | A | ) |
Compute the distributed transpose of a MatrixCSR.
Given A with row map R (n_row owned rows) and column map C (n_col owned columns plus any ghost columns from remote ranks), returns Aᵀ with: row map = ghost-free column map of A (n_col owned rows, no ghosts) col map = row map of A extended with any ghost row indices that appear as nonzeros contributed by remote ranks.
Communication strategy:
| A | Input matrix. |
| T | Scalar type |
| BS0 | Row block size of A, or -1 for unoptimized. |
| BS1 | Col block size of A, or -1 for unoptimized. |