GooseFEM 1.4.1.dev2+g78f16df
Loading...
Searching...
No Matches
GooseFEM::Matrix Class Reference

Sparse matrix. More...

#include <GooseFEM/Matrix.h>

Inheritance diagram for GooseFEM::Matrix:
GooseFEM::MatrixBase< Matrix >

Public Member Functions

 Matrix (const array_type::tensor< size_t, 2 > &conn, const array_type::tensor< size_t, 2 > &dofs)
 Constructor.
 
const Eigen::SparseMatrix< double > & data () 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.
 
- Public Member Functions inherited from GooseFEM::MatrixBase< Matrix >
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".
 
void assemble (const T &elemmat)
 Assemble from "elemmat".
 
array_type::tensor< double, 2 > Todense () const
 Copy as dense matrix.
 
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 \).
 

Friends

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

Additional Inherited Members

- Public Types inherited from GooseFEM::MatrixBase< Matrix >
using derived_type
 Underlying type.
 
- Protected Attributes inherited from GooseFEM::MatrixBase< Matrix >
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
 Signal changes to data.
 

Detailed Description

Sparse matrix.

See GooseFEM::Vector() for bookkeeping definitions.

Definition at line 653 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 679 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 767 of file Matrix.h.

◆ data()

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

Pointer to data.

Definition at line 698 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 738 of file Matrix.h.

Friends And Related Symbol Documentation

◆ MatrixSolver

template<class >
friend class MatrixSolver
friend

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

Definition at line 668 of file Matrix.h.


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