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

Diagonal matrix. More...

#include <GooseFEM/MatrixDiagonal.h>

Inheritance diagram for GooseFEM::MatrixDiagonal:
GooseFEM::MatrixBase< MatrixDiagonal > GooseFEM::MatrixDiagonalBase< MatrixDiagonal >

Public Member Functions

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

Additional Inherited Members

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

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 206 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 197 of file MatrixDiagonal.h.


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