libMesh
|
Defines a dense submatrix for use in Finite Element-type computations. More...
#include <dense_submatrix.h>
Public Member Functions | |
DenseSubMatrix (DenseMatrix< T > &new_parent, const unsigned int ioff=0, const unsigned int joff=0, const unsigned int m=0, const unsigned int n=0) | |
Constructor. More... | |
DenseSubMatrix (DenseSubMatrix &&)=default | |
The 5 special functions can be defaulted for this class, as it does not manage any memory itself. More... | |
DenseSubMatrix (const DenseSubMatrix &)=default | |
DenseSubMatrix & | operator= (const DenseSubMatrix &)=default |
DenseSubMatrix & | operator= (DenseSubMatrix &&)=default |
virtual | ~DenseSubMatrix ()=default |
DenseMatrix< T > & | parent () |
virtual void | zero () override final |
Set every element in the matrix to 0. More... | |
T | operator() (const unsigned int i, const unsigned int j) const |
T & | operator() (const unsigned int i, const unsigned int j) |
virtual T | el (const unsigned int i, const unsigned int j) const override final |
virtual T & | el (const unsigned int i, const unsigned int j) override final |
virtual void | left_multiply (const DenseMatrixBase< T > &M2) override final |
Performs the operation: (*this) <- M2 * (*this) More... | |
virtual void | right_multiply (const DenseMatrixBase< T > &M3) override final |
Performs the operation: (*this) <- (*this) * M3. More... | |
void | reposition (const unsigned int ioff, const unsigned int joff, const unsigned int new_m, const unsigned int new_n) |
Changes the location of the submatrix in the parent matrix. More... | |
unsigned int | i_off () const |
unsigned int | j_off () const |
void | condense (const unsigned int i, const unsigned int j, const T val, DenseSubVector< T > &rhs) |
Condense-out the (i,j) entry of the matrix, forcing it to take on the value val . More... | |
unsigned int | m () const |
unsigned int | n () const |
void | print (std::ostream &os=libMesh::out) const |
Pretty-print the matrix, by default to libMesh::out . More... | |
void | print_scientific (std::ostream &os, unsigned precision=8) const |
Prints the matrix entries with more decimal places in scientific notation. More... | |
template<typename T2 , typename T3 > | |
boostcopy::enable_if_c< ScalarTraits< T2 >::value, void >::type | add (const T2 factor, const DenseMatrixBase< T3 > &mat) |
Adds factor to every element in the matrix. More... | |
DenseVector< T > | diagonal () const |
Return the matrix diagonal. More... | |
Protected Member Functions | |
void | condense (const unsigned int i, const unsigned int j, const T val, DenseVectorBase< T > &rhs) |
Condense-out the (i,j) entry of the matrix, forcing it to take on the value val . More... | |
Static Protected Member Functions | |
static void | multiply (DenseMatrixBase< T > &M1, const DenseMatrixBase< T > &M2, const DenseMatrixBase< T > &M3) |
Helper function - Performs the computation M1 = M2 * M3 where: M1 = (m x n) M2 = (m x p) M3 = (p x n) More... | |
Protected Attributes | |
unsigned int | _m |
The row dimension. More... | |
unsigned int | _n |
The column dimension. More... | |
Private Attributes | |
DenseMatrix< T > & | _parent_matrix |
The parent matrix that contains this submatrix. More... | |
unsigned int | _i_off |
The row offset into the parent matrix. More... | |
unsigned int | _j_off |
The column offset into the parent matrix. More... | |
Defines a dense submatrix for use in Finite Element-type computations.
Useful for storing element stiffness matrices before summation into a global matrix, particularly when you have systems of equations. All overridden virtual functions are documented in dense_matrix_base.h.
Definition at line 45 of file dense_submatrix.h.
|
inline |
Constructor.
Creates a dense submatrix of the matrix parent
. The submatrix has dimensions \((m \times n)\), and the \((0,0)\) entry of the submatrix is located at the \((ioff,joff)\) location in the parent matrix.
Definition at line 159 of file dense_submatrix.h.
References libMesh::DenseSubMatrix< T >::reposition().
|
default |
The 5 special functions can be defaulted for this class, as it does not manage any memory itself.
|
default |
|
virtualdefault |
|
inlineinherited |
Adds factor
to every element in the matrix.
This should only work if T += T2 * T3 is valid C++ and if T2 is scalar. Return type is void
Definition at line 195 of file dense_matrix_base.h.
References libMesh::DenseMatrixBase< T >::el(), libMesh::DenseMatrixBase< T >::m(), libMesh::make_range(), and libMesh::DenseMatrixBase< T >::n().
|
inline |
Condense-out the (i,j) entry of the matrix, forcing it to take on the value
val
.
This is useful in numerical simulations for applying boundary conditions. Preserves the symmetry of the matrix.
Definition at line 126 of file dense_submatrix.h.
References libMesh::DenseSubMatrix< T >::i_off(), libMesh::DenseSubMatrix< T >::j_off(), libMesh::DenseSubVector< T >::parent(), and libMesh::DenseSubMatrix< T >::parent().
|
protectedinherited |
Condense-out the (i,j) entry of the matrix, forcing it to take on the value
val
.
This is useful in numerical simulations for applying boundary conditions. Preserves the symmetry of the matrix.
Definition at line 73 of file dense_matrix_base_impl.h.
References libMesh::DenseVectorBase< T >::el(), libMesh::make_range(), and libMesh::DenseVectorBase< T >::size().
Referenced by libMesh::DenseMatrix< Real >::condense().
|
inherited |
Return the matrix diagonal.
Definition at line 37 of file dense_matrix_base_impl.h.
Referenced by libMesh::DiagonalMatrix< T >::add_matrix().
|
inlinefinaloverridevirtual |
(i,j) element of the matrix. Since internal data representations may differ, you must redefine this function. Implements libMesh::DenseMatrixBase< T >.
Definition at line 90 of file dense_submatrix.h.
|
inlinefinaloverridevirtual |
(i,j) element of the matrix as a writable reference. Since internal data representations may differ, you must redefine this function. Implements libMesh::DenseMatrixBase< T >.
Definition at line 94 of file dense_submatrix.h.
|
inline |
Definition at line 113 of file dense_submatrix.h.
References libMesh::DenseSubMatrix< T >::_i_off.
Referenced by libMesh::DenseSubMatrix< T >::condense().
|
inline |
Definition at line 118 of file dense_submatrix.h.
References libMesh::DenseSubMatrix< T >::_j_off.
Referenced by libMesh::DenseSubMatrix< T >::condense().
|
finaloverridevirtual |
Performs the operation: (*this) <- M2 * (*this)
Implements libMesh::DenseMatrixBase< T >.
Definition at line 31 of file dense_submatrix.C.
|
inlineinherited |
Definition at line 104 of file dense_matrix_base.h.
References libMesh::DenseMatrixBase< T >::_m.
Referenced by libMesh::DenseMatrix< Real >::_left_multiply_transpose(), libMesh::DenseMatrix< Real >::_multiply_blas(), libMesh::DenseMatrix< Real >::_right_multiply_transpose(), libMesh::DenseMatrix< Real >::_svd_solve_lapack(), libMesh::DenseMatrixBase< T >::add(), libMesh::PetscMatrix< libMesh::Number >::add_block_matrix(), libMesh::SparseMatrix< ValOut >::add_block_matrix(), libMesh::EigenSparseMatrix< T >::add_matrix(), libMesh::DiagonalMatrix< T >::add_matrix(), libMesh::LaspackMatrix< T >::add_matrix(), libMesh::EpetraMatrix< T >::add_matrix(), libMesh::PetscMatrix< libMesh::Number >::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::DofMap::build_constraint_matrix(), libMesh::DofMap::build_constraint_matrix_and_vector(), libMesh::DofMap::extract_local_vector(), libMesh::DenseMatrix< Real >::get_transpose(), libMesh::DofMap::heterogeneously_constrain_element_jacobian_and_residual(), libMesh::DofMap::heterogeneously_constrain_element_residual(), libMesh::DenseMatrix< Real >::left_multiply(), libMesh::DofMap::max_constraint_error(), libMesh::DenseMatrixBase< T >::multiply(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::DenseMatrix< Real >::right_multiply(), libMesh::RBEIMEvaluation::set_interpolation_matrix_entry(), DualShapeTest::testEdge2Lagrange(), DenseMatrixTest::testEVD_helper(), DenseMatrixTest::testSVD(), and MetaPhysicL::RawType< libMesh::DenseMatrix< T > >::value().
|
staticprotectedinherited |
Helper function - Performs the computation M1 = M2 * M3 where: M1 = (m x n) M2 = (m x p) M3 = (p x n)
Definition at line 46 of file dense_matrix_base_impl.h.
References libMesh::DenseMatrixBase< T >::el(), libMesh::DenseMatrixBase< T >::m(), and libMesh::DenseMatrixBase< T >::n().
|
inlineinherited |
Definition at line 109 of file dense_matrix_base.h.
References libMesh::DenseMatrixBase< T >::_n.
Referenced by libMesh::DenseMatrix< Real >::_left_multiply_transpose(), libMesh::DenseMatrix< Real >::_multiply_blas(), libMesh::DenseMatrix< Real >::_right_multiply_transpose(), libMesh::DenseMatrix< Real >::_svd_solve_lapack(), libMesh::DenseMatrixBase< T >::add(), libMesh::PetscMatrix< libMesh::Number >::add_block_matrix(), libMesh::SparseMatrix< ValOut >::add_block_matrix(), libMesh::EigenSparseMatrix< T >::add_matrix(), libMesh::DiagonalMatrix< T >::add_matrix(), libMesh::LaspackMatrix< T >::add_matrix(), libMesh::EpetraMatrix< T >::add_matrix(), libMesh::PetscMatrix< libMesh::Number >::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::DofMap::build_constraint_matrix(), libMesh::DofMap::build_constraint_matrix_and_vector(), libMesh::DofMap::constrain_element_residual(), libMesh::DofMap::extract_local_vector(), libMesh::DenseMatrix< Real >::get_transpose(), libMesh::DofMap::heterogeneously_constrain_element_jacobian_and_residual(), libMesh::DofMap::heterogeneously_constrain_element_residual(), libMesh::DenseMatrix< Real >::left_multiply(), libMesh::DofMap::max_constraint_error(), libMesh::DenseMatrixBase< T >::multiply(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::DenseMatrix< Real >::right_multiply(), libMesh::RBEIMEvaluation::set_interpolation_matrix_entry(), DualShapeTest::testEdge2Lagrange(), DenseMatrixTest::testSVD(), and MetaPhysicL::RawType< libMesh::DenseMatrix< T > >::value().
|
inline |
(i,j) element of the submatrix. Definition at line 204 of file dense_submatrix.h.
|
inline |
(i,j) element of the submatrix as a writable reference. Definition at line 219 of file dense_submatrix.h.
|
default |
|
default |
|
inline |
Definition at line 74 of file dense_submatrix.h.
References libMesh::DenseSubMatrix< T >::_parent_matrix.
Referenced by libMesh::DenseSubMatrix< T >::condense().
|
inherited |
Pretty-print the matrix, by default to libMesh::out
.
Definition at line 125 of file dense_matrix_base_impl.h.
References libMesh::make_range().
|
inherited |
Prints the matrix entries with more decimal places in scientific notation.
Definition at line 101 of file dense_matrix_base_impl.h.
References libMesh::make_range().
|
inline |
Changes the location of the submatrix in the parent matrix.
Definition at line 173 of file dense_submatrix.h.
Referenced by assemble_elasticity(), assemble_laplace(), assemble_shell(), assemble_stokes(), and libMesh::DenseSubMatrix< T >::DenseSubMatrix().
|
finaloverridevirtual |
Performs the operation: (*this) <- (*this) * M3.
Implements libMesh::DenseMatrixBase< T >.
Definition at line 49 of file dense_submatrix.C.
|
inlinefinaloverridevirtual |
Set every element in the matrix to 0.
You must redefine what you mean by zeroing the matrix since it depends on how your values are stored.
Implements libMesh::DenseMatrixBase< T >.
Definition at line 192 of file dense_submatrix.h.
References libMesh::make_range().
|
private |
The row offset into the parent matrix.
Definition at line 146 of file dense_submatrix.h.
Referenced by libMesh::DenseSubMatrix< T >::i_off().
|
private |
The column offset into the parent matrix.
Definition at line 151 of file dense_submatrix.h.
Referenced by libMesh::DenseSubMatrix< T >::j_off().
|
protectedinherited |
The row dimension.
Definition at line 176 of file dense_matrix_base.h.
Referenced by libMesh::DenseMatrixBase< T >::m().
|
protectedinherited |
The column dimension.
Definition at line 181 of file dense_matrix_base.h.
Referenced by libMesh::DenseMatrixBase< T >::n().
|
private |
The parent matrix that contains this submatrix.
Definition at line 141 of file dense_submatrix.h.
Referenced by libMesh::DenseSubMatrix< T >::parent().