libMesh
|
This class defines a coupling matrix. More...
#include <coupling_matrix.h>
Public Member Functions | |
CouplingMatrix (const std::size_t n=0) | |
Constructor. More... | |
bool | operator() (const std::size_t i, const std::size_t j) const |
CouplingAccessor | operator() (const std::size_t i, const std::size_t j) |
std::size_t | size () const |
void | resize (const std::size_t n) |
Resizes the matrix and initializes all entries to be 0. More... | |
void | clear () |
Clears the matrix. More... | |
bool | empty () const |
CouplingMatrix & | operator &= (const CouplingMatrix &other) |
Private Types | |
typedef std::pair< std::size_t, std::size_t > | range_type |
Coupling matrices are typically either full or very sparse, and all values are only zero or one. More... | |
typedef std::vector< range_type > | rc_type |
Private Attributes | |
rc_type | _ranges |
std::size_t | _size |
The size of the matrix. More... | |
Friends | |
class | ConstCouplingAccessor |
class | CouplingAccessor |
class | ConstCouplingRow |
class | ConstCouplingRowConstIterator |
This class defines a coupling matrix.
A coupling matrix is simply a matrix of ones and zeros describing how different components in a system couple with each other. A coupling matrix is necessarily square but not necessarily symmetric.
Definition at line 54 of file coupling_matrix.h.
|
private |
Coupling matrices are typically either full or very sparse, and all values are only zero or one.
We store non-zeros as ranges: the first entry of each range pair is the location of the first non-zero, and the second is the location of the last subsequent non-zero (not the next subsequent zero; we drop empty ranges).
We store locations (i,j) as long integers i*_size+j
Definition at line 119 of file coupling_matrix.h.
|
private |
Definition at line 120 of file coupling_matrix.h.
|
inlineexplicit |
Constructor.
Definition at line 571 of file coupling_matrix.h.
References resize().
|
inline |
Clears the matrix.
Definition at line 624 of file coupling_matrix.h.
References resize().
|
inline |
true
if the matrix is empty. Definition at line 632 of file coupling_matrix.h.
References _size.
Referenced by libMesh::DofMap::reinit(), and libMesh::DefaultCoupling::set_dof_coupling().
CouplingMatrix& libMesh::CouplingMatrix::operator&= | ( | const CouplingMatrix & | other | ) |
|
inline |
Definition at line 580 of file coupling_matrix.h.
References _size, and ConstCouplingAccessor.
|
inline |
Definition at line 595 of file coupling_matrix.h.
References _size, and CouplingAccessor.
|
inline |
Resizes the matrix and initializes all entries to be 0.
Definition at line 614 of file coupling_matrix.h.
References _ranges, and _size.
Referenced by clear(), CouplingMatrix(), main(), and CouplingMatrixTest::testSimpleAPI().
|
inline |
Definition at line 606 of file coupling_matrix.h.
References _size.
Referenced by libMesh::ConstCouplingAccessor::ConstCouplingAccessor(), libMesh::ConstCouplingRow::ConstCouplingRow(), and libMesh::ConstCouplingRowConstIterator::operator*().
|
friend |
Definition at line 103 of file coupling_matrix.h.
Referenced by operator()().
|
friend |
Definition at line 105 of file coupling_matrix.h.
|
friend |
Definition at line 106 of file coupling_matrix.h.
|
friend |
Definition at line 104 of file coupling_matrix.h.
Referenced by operator()().
|
private |
Definition at line 121 of file coupling_matrix.h.
Referenced by libMesh::ConstCouplingRow::ConstCouplingRow(), libMesh::ConstCouplingRowConstIterator::ConstCouplingRowConstIterator(), libMesh::ConstCouplingRow::end(), libMesh::ConstCouplingAccessor::operator bool(), libMesh::ConstCouplingRowConstIterator::operator++(), libMesh::CouplingAccessor::operator=(), and resize().
|
private |
The size of the matrix.
Definition at line 126 of file coupling_matrix.h.
Referenced by empty(), operator()(), resize(), and size().