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

Sparse matrix partitioned in an unknown and a prescribed part. More...

#include <GooseFEM/MatrixPartitioned.h>

Inheritance diagram for GooseFEM::MatrixPartitioned:
GooseFEM::MatrixPartitionedBase< MatrixPartitioned > GooseFEM::MatrixBase< D >

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.
 
- Public Member Functions inherited from GooseFEM::MatrixPartitionedBase< MatrixPartitioned >
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.
 
- Public Member Functions inherited from GooseFEM::MatrixBase< D >
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< doublem_Auu
 The matrix.
 
Eigen::SparseMatrix< doublem_Aup
 The matrix.
 
Eigen::SparseMatrix< doublem_Apu
 The matrix.
 
Eigen::SparseMatrix< doublem_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.
 
- Protected Attributes inherited from GooseFEM::MatrixPartitionedBase< MatrixPartitioned >
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.
 
- Protected Attributes inherited from GooseFEM::MatrixBase< D >
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

- Public Types inherited from GooseFEM::MatrixPartitionedBase< MatrixPartitioned >
using derived_type
 Underlying type.
 
- Public Types inherited from GooseFEM::MatrixBase< D >
using derived_type = D
 Underlying type.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MatrixPartitioned()

GooseFEM::MatrixPartitioned::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 )
inline

Constructor.

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

Definition at line 87 of file MatrixPartitioned.h.

Member Function Documentation

◆ add()

void GooseFEM::MatrixPartitioned::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 271 of file MatrixPartitioned.h.

◆ data_pp()

const Eigen::SparseMatrix< double > & GooseFEM::MatrixPartitioned::data_pp ( ) const
inline

Pointer to data.

Definition at line 150 of file MatrixPartitioned.h.

◆ data_pu()

const Eigen::SparseMatrix< double > & GooseFEM::MatrixPartitioned::data_pu ( ) const
inline

Pointer to data.

Definition at line 142 of file MatrixPartitioned.h.

◆ data_up()

const Eigen::SparseMatrix< double > & GooseFEM::MatrixPartitioned::data_up ( ) const
inline

Pointer to data.

Definition at line 134 of file MatrixPartitioned.h.

◆ data_uu()

const Eigen::SparseMatrix< double > & GooseFEM::MatrixPartitioned::data_uu ( ) const
inline

Pointer to data.

Definition at line 126 of file MatrixPartitioned.h.

◆ set()

void GooseFEM::MatrixPartitioned::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 221 of file MatrixPartitioned.h.

Friends And Related Symbol Documentation

◆ MatrixPartitionedSolver

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

Definition at line 75 of file MatrixPartitioned.h.

Member Data Documentation

◆ m_App

Eigen::SparseMatrix<double> GooseFEM::MatrixPartitioned::m_App
protected

The matrix.

Definition at line 43 of file MatrixPartitioned.h.

◆ m_Apu

Eigen::SparseMatrix<double> GooseFEM::MatrixPartitioned::m_Apu
protected

The matrix.

Definition at line 42 of file MatrixPartitioned.h.

◆ m_Aup

Eigen::SparseMatrix<double> GooseFEM::MatrixPartitioned::m_Aup
protected

The matrix.

Definition at line 41 of file MatrixPartitioned.h.

◆ m_Auu

Eigen::SparseMatrix<double> GooseFEM::MatrixPartitioned::m_Auu
protected

The matrix.

Definition at line 40 of file MatrixPartitioned.h.

◆ m_part

array_type::tensor<size_t, 2> GooseFEM::MatrixPartitioned::m_part
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.

◆ m_part1d

array_type::tensor<size_t, 1> GooseFEM::MatrixPartitioned::m_part1d
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.

◆ m_Tpp

std::vector<Eigen::Triplet<double> > GooseFEM::MatrixPartitioned::m_Tpp
protected

Matrix entries.

Definition at line 48 of file MatrixPartitioned.h.

◆ m_Tpu

std::vector<Eigen::Triplet<double> > GooseFEM::MatrixPartitioned::m_Tpu
protected

Matrix entries.

Definition at line 47 of file MatrixPartitioned.h.

◆ m_Tup

std::vector<Eigen::Triplet<double> > GooseFEM::MatrixPartitioned::m_Tup
protected

Matrix entries.

Definition at line 46 of file MatrixPartitioned.h.

◆ m_Tuu

std::vector<Eigen::Triplet<double> > GooseFEM::MatrixPartitioned::m_Tuu
protected

Matrix entries.

Definition at line 45 of file MatrixPartitioned.h.


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