GooseFEM 1.4.1.dev2+g78f16df
|
Sparse matrix partitioned in an unknown and a prescribed part. More...
#include <GooseFEM/MatrixPartitioned.h>
Public Member Functions | |
MatrixPartitioned (const array_type::tensor< size_t, 2 > &conn, const array_type::tensor< size_t, 2 > &dofs, const array_type::tensor< size_t, 1 > &iip) | |
Constructor. | |
const Eigen::SparseMatrix< double > & | data_uu () const |
Pointer to data. | |
const Eigen::SparseMatrix< double > & | data_up () const |
Pointer to data. | |
const Eigen::SparseMatrix< double > & | data_pu () const |
Pointer to data. | |
const Eigen::SparseMatrix< double > & | data_pp () const |
Pointer to data. | |
void | set (const array_type::tensor< size_t, 1 > &rows, const array_type::tensor< size_t, 1 > &cols, const array_type::tensor< double, 2 > &matrix) |
Overwrite matrix. | |
void | add (const array_type::tensor< size_t, 1 > &rows, const array_type::tensor< size_t, 1 > &cols, const array_type::tensor< double, 2 > &matrix) |
Add matrix. | |
![]() | |
size_t | nnu () const |
Number of unknown DOFs. | |
size_t | nnp () const |
Number of prescribed DOFs. | |
const array_type::tensor< size_t, 1 > & | iiu () const |
Unknown DOFs. | |
const array_type::tensor< size_t, 1 > & | iip () const |
Prescribed DOFs. | |
array_type::tensor< double, 2 > | Reaction (const array_type::tensor< double, 2 > &x, const array_type::tensor< double, 2 > &b) const |
Right-hand-size for corresponding to the prescribed DOFs: | |
array_type::tensor< double, 1 > | Reaction (const array_type::tensor< double, 1 > &x, const array_type::tensor< double, 1 > &b) const |
Same as Reaction(const array_type::tensor<double, 2>&, const array_type::tensor<double, 2>&), but of "dofval" input and output. | |
void | reaction (const array_type::tensor< double, 2 > &x, array_type::tensor< double, 2 > &b) const |
Same as Reaction(const array_type::tensor<double, 2>&, const array_type::tensor<double, 2>&), but inserting in-place. | |
void | reaction (const array_type::tensor< double, 1 > &x, array_type::tensor< double, 1 > &b) const |
Same as Reaction(const array_type::tensor<double, 1>&, const array_type::tensor<double, 1>&), but inserting in-place. | |
array_type::tensor< double, 1 > | Reaction_p (const array_type::tensor< double, 1 > &x_u, const array_type::tensor< double, 1 > &x_p) const |
Same as Reaction(const array_type::tensor<double, 1>&, const array_type::tensor<double, 1>&), but with partitioned input and output. | |
void | reaction_p (const array_type::tensor< double, 1 > &x_u, const array_type::tensor< double, 1 > &x_p, array_type::tensor< double, 1 > &b_p) const |
Same as Reaction_p(const array_type::tensor<double, 1>&, const array_type::tensor<double,
1>&), but writing to preallocated output. | |
![]() | |
size_t | nelem () const |
Number of elements. | |
size_t | nne () const |
Number of nodes per element. | |
size_t | nnode () const |
Number of nodes. | |
size_t | ndim () const |
Number of dimensions. | |
size_t | ndof () const |
Number of DOFs. | |
const array_type::tensor< size_t, 2 > & | dofs () const |
DOFs per node. | |
const array_type::tensor< size_t, 2 > & | conn () const |
Connectivity. | |
std::array< size_t, 1 > | shape_dofval () const |
Shape of "dofval". | |
std::array< size_t, 2 > | shape_nodevec () const |
Shape of "nodevec". | |
std::array< size_t, 3 > | shape_elemmat () const |
Shape of "elemmat". | |
template<class T > | |
void | assemble (const T &elemmat) |
Assemble from "elemmat". | |
array_type::tensor< double, 2 > | Todense () const |
Copy as dense matrix. | |
template<class T > | |
void | todense (T &ret) const |
Copy to dense matrix. | |
array_type::tensor< double, 2 > | Dot (const array_type::tensor< double, 2 > &x) const |
Dot-product \( b_i = A_{ij} x_j \). | |
array_type::tensor< double, 1 > | Dot (const array_type::tensor< double, 1 > &x) const |
Dot-product \( b_i = A_{ij} x_j \). | |
void | dot (const array_type::tensor< double, 2 > &x, array_type::tensor< double, 2 > &b) const |
Dot-product \( b_i = A_{ij} x_j \). | |
void | dot (const array_type::tensor< double, 1 > &x, array_type::tensor< double, 1 > &b) const |
Dot-product \( b_i = A_{ij} x_j \). | |
Protected Attributes | |
Eigen::SparseMatrix< double > | m_Auu |
The matrix. | |
Eigen::SparseMatrix< double > | m_Aup |
The matrix. | |
Eigen::SparseMatrix< double > | m_Apu |
The matrix. | |
Eigen::SparseMatrix< double > | m_App |
The matrix. | |
std::vector< Eigen::Triplet< double > > | m_Tuu |
Matrix entries. | |
std::vector< Eigen::Triplet< double > > | m_Tup |
Matrix entries. | |
std::vector< Eigen::Triplet< double > > | m_Tpu |
Matrix entries. | |
std::vector< Eigen::Triplet< double > > | m_Tpp |
Matrix entries. | |
array_type::tensor< size_t, 2 > | m_part |
Renumbered DOFs per node, such that: | |
array_type::tensor< size_t, 1 > | m_part1d |
Map real DOF to DOF in partitioned system. | |
![]() | |
array_type::tensor< size_t, 1 > | m_iiu |
See iiu() | |
array_type::tensor< size_t, 1 > | m_iip |
See iip() | |
size_t | m_nnu |
See nnu. | |
size_t | m_nnp |
See nnp. | |
![]() | |
array_type::tensor< size_t, 2 > | m_conn |
Connectivity [nelem, nne]. | |
array_type::tensor< size_t, 2 > | m_dofs |
DOF-numbers per node [nnode, ndim]. | |
size_t | m_nelem |
See nelem(). | |
size_t | m_nne |
See nne(). | |
size_t | m_nnode |
See nnode(). | |
size_t | m_ndim |
See ndim(). | |
size_t | m_ndof |
See ndof(). | |
bool | m_changed = true |
Signal changes to data. | |
Friends | |
template<class > | |
class | MatrixPartitionedSolver |
Class to solve the system (allowing single factorisation for multiple right-hand-sides). | |
Additional Inherited Members | |
![]() | |
using | derived_type |
Underlying type. | |
![]() | |
using | derived_type = D |
Underlying type. | |
Sparse matrix partitioned in an unknown and a prescribed part.
In particular: \( \begin{bmatrix} A_{uu} & A_{up} \\ A_{pu} & A_{pp} \end{bmatrix} \)
See VectorPartitioned() for bookkeeping definitions.
Definition at line 34 of file MatrixPartitioned.h.
|
inline |
|
inline |
Add matrix.
rows | Row numbers [m]. |
cols | Column numbers [n]. |
matrix | Data entries matrix(i, j) for rows(i), cols(j) [m, n]. |
Definition at line 271 of file MatrixPartitioned.h.
Pointer to data.
Definition at line 150 of file MatrixPartitioned.h.
Pointer to data.
Definition at line 142 of file MatrixPartitioned.h.
Pointer to data.
Definition at line 134 of file MatrixPartitioned.h.
Pointer to data.
Definition at line 126 of file MatrixPartitioned.h.
|
inline |
Overwrite matrix.
rows | Row numbers [m]. |
cols | Column numbers [n]. |
matrix | Data entries matrix(i, j) for rows(i), cols(j) [m, n]. |
Definition at line 221 of file MatrixPartitioned.h.
|
friend |
Class to solve the system (allowing single factorisation for multiple right-hand-sides).
Definition at line 75 of file MatrixPartitioned.h.
|
protected |
The matrix.
Definition at line 43 of file MatrixPartitioned.h.
|
protected |
The matrix.
Definition at line 42 of file MatrixPartitioned.h.
|
protected |
The matrix.
Definition at line 41 of file MatrixPartitioned.h.
|
protected |
The matrix.
Definition at line 40 of file MatrixPartitioned.h.
|
protected |
Renumbered DOFs per node, such that:
iiu = arange(nnu) iip = nnu + arange(nnp)
making is much simpler to slice.
Definition at line 58 of file MatrixPartitioned.h.
|
protected |
Map real DOF to DOF in partitioned system.
The partitioned system is defined as:
iiu = arange(nnu) iip = nnu + arange(nnp)
Similar to m_part
but for a 1d sequential list of DOFs.
Definition at line 69 of file MatrixPartitioned.h.
|
protected |
Matrix entries.
Definition at line 48 of file MatrixPartitioned.h.
|
protected |
Matrix entries.
Definition at line 47 of file MatrixPartitioned.h.
|
protected |
Matrix entries.
Definition at line 46 of file MatrixPartitioned.h.
|
protected |
Matrix entries.
Definition at line 45 of file MatrixPartitioned.h.