FrictionQPotFEM 0.23.3
Loading...
Searching...
No Matches
GooseFEM::Matrix Class Reference

Sparse matrix. More...

#include <include/GooseFEM/Matrix.h>

Inheritance diagram for GooseFEM::Matrix:
Collaboration diagram for GooseFEM::Matrix:

Public Member Functions

 Matrix (const array_type::tensor< size_t, 2 > &conn, const array_type::tensor< size_t, 2 > &dofs)
 Constructor. More...
 
const Eigen::SparseMatrix< double > & data () const
 Pointer to data. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from GooseFEM::MatrixBase< Matrix >
size_t nelem () const
 Number of elements. More...
 
size_t nne () const
 Number of nodes per element. More...
 
size_t nnode () const
 Number of nodes. More...
 
size_t ndim () const
 Number of dimensions. More...
 
size_t ndof () const
 Number of DOFs. More...
 
const array_type::tensor< size_t, 2 > & dofs () const
 DOFs per node. More...
 
const array_type::tensor< size_t, 2 > & conn () const
 Connectivity. More...
 
std::array< size_t, 1 > shape_dofval () const
 Shape of "dofval". More...
 
std::array< size_t, 2 > shape_nodevec () const
 Shape of "nodevec". More...
 
std::array< size_t, 3 > shape_elemmat () const
 Shape of "elemmat". More...
 
void assemble (const T &elemmat)
 Assemble from "elemmat". More...
 
array_type::tensor< double, 2 > Todense () const
 Copy as dense matrix. More...
 
void todense (T &ret) const
 Copy to dense matrix. More...
 
array_type::tensor< double, 2 > Dot (const array_type::tensor< double, 2 > &x) const
 Dot-product \( b_i = A_{ij} x_j \). More...
 
array_type::tensor< double, 1 > Dot (const array_type::tensor< double, 1 > &x) const
 Dot-product \( b_i = A_{ij} x_j \). More...
 
void dot (const array_type::tensor< double, 2 > &x, array_type::tensor< double, 2 > &b) const
 Dot-product \( b_i = A_{ij} x_j \). More...
 
void dot (const array_type::tensor< double, 1 > &x, array_type::tensor< double, 1 > &b) const
 Dot-product \( b_i = A_{ij} x_j \). More...
 

Friends

template<class >
class MatrixSolver
 Class to solve the system (allowing single factorisation for multiple right-hand-sides). More...
 

Additional Inherited Members

- Public Types inherited from GooseFEM::MatrixBase< Matrix >
using derived_type = Matrix
 Underlying type. More...
 
- Protected Attributes inherited from GooseFEM::MatrixBase< Matrix >
array_type::tensor< size_t, 2 > m_conn
 Connectivity [#nelem, #nne]. More...
 
array_type::tensor< size_t, 2 > m_dofs
 DOF-numbers per node [#nnode, #ndim]. More...
 
size_t m_nelem
 See nelem(). More...
 
size_t m_nne
 See nne(). More...
 
size_t m_nnode
 See nnode(). More...
 
size_t m_ndim
 See ndim(). More...
 
size_t m_ndof
 See ndof(). More...
 
bool m_changed
 Signal changes to data. More...
 

Detailed Description

Sparse matrix.

See GooseFEM::Vector() for bookkeeping definitions.

Definition at line 650 of file Matrix.h.

Constructor & Destructor Documentation

◆ Matrix()

GooseFEM::Matrix::Matrix ( const array_type::tensor< size_t, 2 > &  conn,
const array_type::tensor< size_t, 2 > &  dofs 
)
inline

Constructor.

Parameters
connconnectivity [nelem, nne].
dofsDOFs per node [nnode, ndim].

Definition at line 676 of file Matrix.h.

Member Function Documentation

◆ add()

void GooseFEM::Matrix::add ( const array_type::tensor< size_t, 1 > &  rows,
const array_type::tensor< size_t, 1 > &  cols,
const array_type::tensor< double, 2 > &  matrix 
)
inline

Add matrix.

Parameters
rowsRow numbers [m].
colsColumn numbers [n].
matrixData entries matrix(i, j) for rows(i), cols(j) [m, n].

Definition at line 763 of file Matrix.h.

◆ data()

const Eigen::SparseMatrix< double > & GooseFEM::Matrix::data ( ) const
inline

Pointer to data.

Definition at line 695 of file Matrix.h.

◆ set()

void GooseFEM::Matrix::set ( const array_type::tensor< size_t, 1 > &  rows,
const array_type::tensor< size_t, 1 > &  cols,
const array_type::tensor< double, 2 > &  matrix 
)
inline

Overwrite matrix.

Parameters
rowsRow numbers [m].
colsColumn numbers [n].
matrixData entries matrix(i, j) for rows(i), cols(j) [m, n].

Definition at line 734 of file Matrix.h.

Friends And Related Function Documentation

◆ MatrixSolver

template<class >
friend class MatrixSolver
friend

Class to solve the system (allowing single factorisation for multiple right-hand-sides).

Definition at line 665 of file Matrix.h.


The documentation for this class was generated from the following file: