Go to the documentation of this file.
   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;
 
   82                 const unsigned int j) 
const;
 
   88                   const unsigned int j);
 
   90   virtual T 
el(
const unsigned int i,
 
   91                const unsigned int j)
 const override 
   92   { 
return (*
this)(i,j); }
 
   94   virtual T & 
el(
const unsigned int i,
 
   95                  const unsigned int j)
 override 
   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 
  
DenseMatrix< T > & _parent_matrix
The parent matrix that contains this submatrix.
 
Defines a dense submatrix for use in Finite Element-type computations.
 
The libMesh namespace provides an interface to certain functionality in the library.
 
virtual T el(const unsigned int i, const unsigned int j) const override
 
unsigned int _i_off
The row offset into the parent matrix.
 
Defines a dense matrix for use in Finite Element-type computations.
 
virtual void zero() override
Set every element in the matrix to 0.
 
unsigned int i_off() const
 
unsigned int j_off() const
 
The IntRange templated class is intended to make it easy to loop over integers which are indices of a...
 
DenseSubMatrix & operator=(const DenseSubMatrix &)=default
 
Defines an abstract dense matrix base class for use in Finite Element-type computations.
 
virtual void right_multiply(const DenseMatrixBase< T > &M3) override
Performs the operation: (*this) <- (*this) * M3.
 
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.
 
virtual T & el(const unsigned int i, const unsigned int j) override
 
Defines a dense subvector for use in finite element computations.
 
virtual ~DenseSubMatrix()=default
 
DenseVector< T > & parent()
 
unsigned int _j_off
The column offset into the parent matrix.
 
T operator()(const unsigned int i, const unsigned int j) const
 
virtual void left_multiply(const DenseMatrixBase< T > &M2) override
Performs the operation: (*this) <- M2 * (*this)
 
DenseMatrix< T > & parent()
 
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.
 
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.