Defines the coupling between variables of a System. More...
#include <coupling_matrix.h>
Public Member Functions | |
CouplingMatrix (const unsigned int n=0) | |
bool | operator() (const unsigned int i, const unsigned int j) const |
CouplingAccessor | operator() (const unsigned int i, const unsigned int j) |
unsigned int | size () const |
void | resize (const unsigned int n) |
void | clear () |
bool | empty () const |
CouplingMatrix & | operator &= (const CouplingMatrix &other) |
Private Types | |
typedef std::pair< std::size_t, std::size_t > | range_type |
typedef std::vector< range_type > | rc_type |
Private Attributes | |
rc_type | _ranges |
unsigned int | _size |
Friends | |
class | ConstCouplingAccessor |
class | CouplingAccessor |
class | ConstCouplingRow |
class | ConstCouplingRowConstIterator |
Defines the coupling between variables of a System.
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 |
|
inline |
|
inline |
true
if the matrix is empty. Definition at line 631 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 579 of file coupling_matrix.h.
References _size, and ConstCouplingAccessor.
|
inline |
Definition at line 594 of file coupling_matrix.h.
References _size, and CouplingAccessor.
|
inline |
Resizes the matrix and initializes all entries to be 0.
Definition at line 613 of file coupling_matrix.h.
References _ranges, and _size.
Referenced by clear(), and CouplingMatrix().
|
inline |
Definition at line 605 of file coupling_matrix.h.
References _size.
Referenced by libMesh::ConstCouplingAccessor::ConstCouplingAccessor(), libMesh::ConstCouplingRow::ConstCouplingRow(), libMesh::SparsityPattern::Build::operator()(), 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().