13 #ifndef __deal2__constrained_matrix_h
14 #define __deal2__constrained_matrix_h
28 DEAL_II_NAMESPACE_OPEN
30 template <
typename number>
class Vector;
44 template<
class VEC,
class MATRIX>
56 void vmult(VEC &dst,
const VEC &src)
const;
72 template<
class VEC,
class MATRIX>
75 matrix.vmult(dst, src);
76 for (
unsigned int i=0; i<dst.size(); ++i)
77 if (constraints.is_constrained(i))
80 const std::vector< std::pair < unsigned int, double > >
81 *entries = constraints.get_constraint_entries (i);
82 for (
unsigned int j=0; j< entries->size(); ++j)
83 dst(i) -= (*entries)[j].second *
84 src((*entries)[j].first);
88 template<
class VEC,
class MATRIX>
91 for (
unsigned int i=0; i<rhs.size(); ++i)
92 if (constraints.is_constrained(i))
93 rhs(i) = constraints.get_inhomogeneity(i);
97 DEAL_II_NAMESPACE_CLOSE
void distribute_rhs(VEC &rhs) const
ConstrainedOperator(const MATRIX &m, const ConstraintMatrix &c)
void vmult(VEC &dst, const VEC &src) const
const ConstraintMatrix & constraints