20 #ifndef LIBMESH_DENSE_SUBMATRIX_H 21 #define LIBMESH_DENSE_SUBMATRIX_H 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/dense_matrix.h" 26 #include "libmesh/dense_subvector.h" 27 #include "libmesh/int_range.h" 56 const unsigned int ioff=0,
57 const unsigned int joff=0,
58 const unsigned int m=0,
59 const unsigned int n=0);
76 virtual void zero() override final;
81 T operator() (const
unsigned int i,
82 const
unsigned int j) const;
87 T & operator() (const
unsigned int i,
88 const
unsigned int j);
90 virtual T
el(const
unsigned int i,
91 const
unsigned int j) const override final
92 {
return (*
this)(i,j); }
94 virtual T &
el(
const unsigned int i,
95 const unsigned int j)
override final 96 {
return (*
this)(i,j); }
106 const unsigned int joff,
107 const unsigned int new_m,
108 const unsigned int new_n);
127 const unsigned int j,
160 const unsigned int ioff,
161 const unsigned int joff,
162 const unsigned int new_m,
163 const unsigned int new_n) :
165 _parent_matrix(new_parent)
174 const unsigned int joff,
175 const unsigned int new_m,
176 const unsigned int new_n)
184 libmesh_assert_less_equal ((this->i_off() + this->m()), _parent_matrix.m());
185 libmesh_assert_less_equal ((this->j_off() + this->n()), _parent_matrix.n());
196 _parent_matrix(i + this->i_off(),
197 j + this->j_off()) = 0.;
205 const unsigned int j)
const 207 libmesh_assert_less (i, this->m());
208 libmesh_assert_less (j, this->n());
209 libmesh_assert_less (i + this->i_off(), _parent_matrix.m());
210 libmesh_assert_less (j + this->j_off(), _parent_matrix.n());
212 return _parent_matrix (i + this->i_off(),
220 const unsigned int j)
222 libmesh_assert_less (i, this->m());
223 libmesh_assert_less (j, this->n());
224 libmesh_assert_less (i + this->i_off(), _parent_matrix.m());
225 libmesh_assert_less (j + this->j_off(), _parent_matrix.n());
227 return _parent_matrix (i + this->i_off(),
235 #endif // LIBMESH_DENSE_SUBMATRIX_H virtual void left_multiply(const DenseMatrixBase< T > &M2) override final
Performs the operation: (*this) <- M2 * (*this)
unsigned int j_off() const
The libMesh namespace provides an interface to certain functionality in the library.
unsigned int _i_off
The row offset into the parent matrix.
DenseVector< T > & parent()
virtual T & el(const unsigned int i, const unsigned int j) override final
T operator()(const unsigned int i, const unsigned int j) const
Defines a dense subvector for use in finite element computations.
DenseMatrix< T > & parent()
unsigned int _j_off
The column offset into the parent matrix.
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.
Defines a dense submatrix for use in Finite Element-type computations.
DenseSubMatrix & operator=(const DenseSubMatrix &)=default
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.
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
virtual void right_multiply(const DenseMatrixBase< T > &M3) override final
Performs the operation: (*this) <- (*this) * M3.
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.
Defines an abstract dense matrix base class for use in Finite Element-type computations.
Defines a dense matrix for use in Finite Element-type computations.
virtual T el(const unsigned int i, const unsigned int j) const override final
virtual void zero() override final
Set every element in the matrix to 0.
virtual ~DenseSubMatrix()=default
DenseMatrix< T > & _parent_matrix
The parent matrix that contains this submatrix.
unsigned int i_off() const