|
libMesh
|
Defines an abstract dense matrix base class for use in Finite Element-type computations. More...
#include <dense_matrix_base.h>
Public Member Functions | |
| DenseMatrixBase (DenseMatrixBase &&)=default | |
| The 5 special functions can be defaulted for this class, as it does not manage any memory itself. More... | |
| DenseMatrixBase (const DenseMatrixBase &)=default | |
| DenseMatrixBase & | operator= (const DenseMatrixBase &)=default |
| DenseMatrixBase & | operator= (DenseMatrixBase &&)=default |
| virtual | ~DenseMatrixBase ()=default |
| virtual void | zero ()=0 |
| Set every element in the matrix to 0. More... | |
| virtual T | el (const unsigned int i, const unsigned int j) const =0 |
| virtual T & | el (const unsigned int i, const unsigned int j)=0 |
| virtual void | left_multiply (const DenseMatrixBase< T > &M2)=0 |
| Performs the operation: (*this) <- M2 * (*this) More... | |
| virtual void | right_multiply (const DenseMatrixBase< T > &M3)=0 |
| Performs the operation: (*this) <- (*this) * M3. 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 | |
| DenseMatrixBase (const unsigned int new_m=0, const unsigned int new_n=0) | |
| Constructor. More... | |
| 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... | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const DenseMatrixBase< T > &m) |
| Formatted print as above but allows you to do DenseMatrix K; libMesh::out << K << std::endl;. More... | |
Defines an abstract dense matrix base class for use in Finite Element-type computations.
Specialized dense matrices, for example DenseSubMatrices, can be derived from this class.
Definition at line 46 of file dense_matrix_base.h.
|
inlineprotected |
Constructor.
Creates a dense matrix of dimension m by n. Protected so that there is no way the user can create one.
Definition at line 54 of file dense_matrix_base.h.
|
default |
The 5 special functions can be defaulted for this class, as it does not manage any memory itself.
|
default |
|
virtualdefault |
|
inline |
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().
|
protected |
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().
| DenseVector< T > libMesh::DenseMatrixBase< T >::diagonal | ( | ) | const |
Return the matrix diagonal.
Definition at line 37 of file dense_matrix_base_impl.h.
Referenced by libMesh::DiagonalMatrix< T >::add_matrix().
|
pure virtual |
(i,j) element of the matrix. Since internal data representations may differ, you must redefine this function. Implemented in libMesh::DenseMatrix< T >, libMesh::DenseMatrix< Number >, libMesh::DenseMatrix< Real >, and libMesh::DenseSubMatrix< T >.
Referenced by libMesh::DenseMatrixBase< T >::add(), and libMesh::DenseMatrixBase< T >::multiply().
|
pure virtual |
(i,j) element of the matrix as a writable reference. Since internal data representations may differ, you must redefine this function. Implemented in libMesh::DenseMatrix< T >, libMesh::DenseMatrix< Number >, libMesh::DenseMatrix< Real >, and libMesh::DenseSubMatrix< T >.
|
pure virtual |
Performs the operation: (*this) <- M2 * (*this)
Implemented in libMesh::DenseMatrix< T >, and libMesh::DenseSubMatrix< T >.
|
inline |
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< T >::add_block_matrix(), libMesh::SparseMatrix< ValOut >::add_block_matrix(), libMesh::StaticCondensation::add_matrix(), libMesh::EigenSparseMatrix< T >::add_matrix(), libMesh::LaspackMatrix< T >::add_matrix(), libMesh::DiagonalMatrix< T >::add_matrix(), libMesh::EpetraMatrix< T >::add_matrix(), libMesh::PetscMatrix< T >::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().
|
staticprotected |
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().
|
inline |
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< T >::add_block_matrix(), libMesh::SparseMatrix< ValOut >::add_block_matrix(), libMesh::StaticCondensation::add_matrix(), libMesh::EigenSparseMatrix< T >::add_matrix(), libMesh::LaspackMatrix< T >::add_matrix(), libMesh::DiagonalMatrix< T >::add_matrix(), libMesh::EpetraMatrix< T >::add_matrix(), libMesh::PetscMatrix< T >::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().
|
default |
|
default |
| void libMesh::DenseMatrixBase< T >::print | ( | std::ostream & | os = libMesh::out | ) | const |
Pretty-print the matrix, by default to libMesh::out.
Definition at line 125 of file dense_matrix_base_impl.h.
References libMesh::make_range().
| void libMesh::DenseMatrixBase< T >::print_scientific | ( | std::ostream & | os, |
| unsigned | precision = 8 |
||
| ) | const |
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().
|
pure virtual |
Performs the operation: (*this) <- (*this) * M3.
Implemented in libMesh::DenseMatrix< T >, and libMesh::DenseSubMatrix< T >.
|
pure virtual |
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.
Implemented in libMesh::DenseMatrix< T >, libMesh::DenseMatrix< Number >, libMesh::DenseMatrix< Real >, and libMesh::DenseSubMatrix< T >.
|
friend |
Formatted print as above but allows you to do DenseMatrix K; libMesh::out << K << std::endl;.
Definition at line 121 of file dense_matrix_base.h.
|
protected |
The row dimension.
Definition at line 176 of file dense_matrix_base.h.
Referenced by libMesh::DenseMatrixBase< T >::m().
|
protected |
The column dimension.
Definition at line 181 of file dense_matrix_base.h.
Referenced by libMesh::DenseMatrixBase< T >::n().
1.8.14