File MatrixDiagonalPartitioned.h#

Diagonal matrix that is partitioned in:

  • unknown DOFs

  • prescribed DOFs

Copyright

Copyright 2017. Tom de Geus. All rights reserved.

License: This project is released under the GNU Public License (GPLv3).

namespace GooseFEM

Toolbox to perform finite element computations.

class MatrixDiagonalPartitioned : public GooseFEM::MatrixPartitionedBase<MatrixDiagonalPartitioned>, public GooseFEM::MatrixDiagonalBase<MatrixDiagonalPartitioned>
#include <GooseFEM/MatrixDiagonalPartitioned.h>

Diagonal and partitioned matrix.

See Vector() for bookkeeping definitions.

Public Functions

MatrixDiagonalPartitioned() = default#
inline MatrixDiagonalPartitioned(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.

Parameters
  • conn – connectivity [nelem, nne].

  • dofs – DOFs per node [nnode, ndim].

  • iip – prescribed DOFs [nnp].

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

Set all (diagonal) matrix components.

Parameters

A – The matrix [ndof].

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

Assemble to diagonal matrix (involves copies).

Returns

[ndof].

inline const array_type::tensor<double, 1> &data_uu() const

Pointer to data.

Returns

[nnu].

inline const array_type::tensor<double, 1> &data_pp() const

Pointer to data.

Returns

[nnu].

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

Pointer to data.

Returns

[nnu].

inline array_type::tensor<double, 1> Dot_u(const array_type::tensor<double, 1> &x_u, const array_type::tensor<double, 1> &x_p) const

Todo:

Decide if this function should be kept.

Parameters
  • x_u – dofval [nnu].

  • x_p – dofval [nnp].

Returns

b_u dofval [nnu].

inline void dot_u(const array_type::tensor<double, 1> &x_u, const array_type::tensor<double, 1> &x_p, array_type::tensor<double, 1> &b_u) const

Todo:

Decide if this function should be kept.

Parameters
  • x_u – dofval [nnu].

  • x_p – dofval [nnp].

  • b_u – (overwritten) dofval [nnu].

inline array_type::tensor<double, 1> Dot_p(const array_type::tensor<double, 1> &x_u, const array_type::tensor<double, 1> &x_p) const

Todo:

Decide if this function should be kept.

Parameters
  • x_u – dofval [nnu].

  • x_p – dofval [nnp].

Returns

b_p dofval [nnp].

inline void dot_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

Todo:

Decide if this function should be kept.

Parameters
  • x_u – dofval [nnu].

  • x_p – dofval [nnp].

  • b_p – (overwritten) dofval [nnp].

inline array_type::tensor<double, 1> Solve_u(const array_type::tensor<double, 1> &b_u, const array_type::tensor<double, 1> &x_p)
Parameters
  • b_u – dofval [nnu].

  • x_p – dofval [nnp].

Returns

x_u dofval [nnu].

inline void solve_u(const array_type::tensor<double, 1> &b_u, const array_type::tensor<double, 1> &x_p, array_type::tensor<double, 1> &x_u)
Parameters
  • b_u – dofval [nnu].

  • x_p – dofval [nnp].

  • x_u – (overwritten) dofval [nnu].

Private Functions

template<class T>
inline void assemble_impl(const T &elemmat)#
template<class T>
inline void todense_impl(T &ret) const#
template<class T>
inline void dot_nodevec_impl(const T &x, T &b) const#
template<class T>
inline void dot_dofval_impl(const T &x, T &b) const#
template<class T>
inline void solve_nodevec_impl(const T &b, T &x)#
template<class T>
inline void solve_dofval_impl(const T &b, T &x)#
template<class T>
inline void reaction_nodevec_impl(const T &x, T &b) const#
template<class T>
inline void reaction_dofval_impl(const T &x, T &b) const#
inline void reaction_p_impl(const array_type::tensor<double, 1> &x_u, const array_type::tensor<double, 1> &x_p, array_type::tensor<double, 1> &b_p) const#
inline void factorize()#

Private Members

friend MatrixBase< MatrixDiagonalPartitioned >
friend MatrixPartitionedBase< MatrixDiagonalPartitioned >
friend MatrixDiagonalBase< MatrixDiagonalPartitioned >
array_type::tensor<double, 1> m_Auu#
array_type::tensor<double, 1> m_App#
array_type::tensor<double, 1> m_inv_uu#
array_type::tensor<size_t, 2> m_part#
array_type::tensor<size_t, 1> m_iiu#
array_type::tensor<size_t, 1> m_iip#
size_t m_nnu#
size_t m_nnp#