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

Diagonal matrix. More...

#include <include/GooseFEM/MatrixDiagonal.h>

Inheritance diagram for GooseFEM::MatrixDiagonal:
Collaboration diagram for GooseFEM::MatrixDiagonal:

Public Member Functions

template<class C , class D >
 MatrixDiagonal (const C &conn, const D &dofs)
 Constructor. More...
 
void set (const array_type::tensor< double, 1 > &A)
 Set all (diagonal) matrix components. More...
 
const array_type::tensor< double, 1 > & Todiagonal () const
 Copy as diagonal matrix. More...
 
const array_type::tensor< double, 1 > & data () const
 Underlying matrix. More...
 
- Public Member Functions inherited from GooseFEM::MatrixBase< MatrixDiagonal >
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...
 
- Public Member Functions inherited from GooseFEM::MatrixDiagonalBase< MatrixDiagonal >
array_type::tensor< double, 2 > Solve (const array_type::tensor< double, 2 > &b)
 Solve \( x = A^{-1} b \). More...
 
array_type::tensor< double, 1 > Solve (const array_type::tensor< double, 1 > &b)
 Solve \( x = A^{-1} b \). More...
 
void solve (const array_type::tensor< double, 2 > &b, array_type::tensor< double, 2 > &x)
 Solve \( x = A^{-1} b \). More...
 
void solve (const array_type::tensor< double, 1 > &b, array_type::tensor< double, 1 > &x)
 Solve \( x = A^{-1} b \). More...
 

Additional Inherited Members

- Public Types inherited from GooseFEM::MatrixBase< MatrixDiagonal >
using derived_type = MatrixDiagonal
 Underlying type. More...
 
- Public Types inherited from GooseFEM::MatrixDiagonalBase< MatrixDiagonal >
using derived_type = MatrixDiagonal
 Underlying type. More...
 
- Protected Attributes inherited from GooseFEM::MatrixBase< MatrixDiagonal >
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

Diagonal matrix.

Warning: assemble() ignores all off-diagonal terms.

See Vector() for bookkeeping definitions.

Definition at line 115 of file MatrixDiagonal.h.

Constructor & Destructor Documentation

◆ MatrixDiagonal()

template<class C , class D >
GooseFEM::MatrixDiagonal::MatrixDiagonal ( const C &  conn,
const D &  dofs 
)
inline

Constructor.

Template Parameters
Ce.g. array_type::tensor<size_t, 2>
De.g. array_type::tensor<size_t, 2>
Parameters
connconnectivity [nelem, nne].
dofsDOFs per node [nnode, ndim].

Definition at line 133 of file MatrixDiagonal.h.

Member Function Documentation

◆ data()

const array_type::tensor< double, 1 > & GooseFEM::MatrixDiagonal::data ( ) const
inline

Underlying matrix.

Returns
[ndof].

Definition at line 205 of file MatrixDiagonal.h.

◆ set()

void GooseFEM::MatrixDiagonal::set ( const array_type::tensor< double, 1 > &  A)
inline

Set all (diagonal) matrix components.

Parameters
AThe matrix [ndof].

Definition at line 185 of file MatrixDiagonal.h.

◆ Todiagonal()

const array_type::tensor< double, 1 > & GooseFEM::MatrixDiagonal::Todiagonal ( ) const
inline

Copy as diagonal matrix.

Returns
[ndof].

Definition at line 196 of file MatrixDiagonal.h.


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