From: bangerth Date: Sat, 13 Feb 2010 00:59:00 +0000 (+0000) Subject: Add add_lines(IndexSet). X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c45f41fa05a427a36680869ede4524762a1a1c8;p=dealii-svn.git Add add_lines(IndexSet). git-svn-id: https://svn.dealii.org/trunk@20585 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/constraint_matrix.h b/deal.II/lac/include/lac/constraint_matrix.h index 4b7f379544..26ad0c8d03 100644 --- a/deal.II/lac/include/lac/constraint_matrix.h +++ b/deal.II/lac/include/lac/constraint_matrix.h @@ -433,6 +433,28 @@ class ConstraintMatrix : public Subscriptor */ void add_lines (const std::set &lines); + /** + * Call the first add_line() function for + * every index i that + * appears in the argument. + * + * This function essentially exists to + * allow adding several constraints of + * the form $x_i=0$ all at once, where + * the set of indices $i$ for which these + * constraints should be added are given + * by the argument of this function. On + * the other hand, just as if the + * single-argument add_line() function + * were called repeatedly, the + * constraints can later be modified to + * include linear dependencies using the + * add_entry() function as well as + * inhomogeneities using + * set_inhomogeneity(). + */ + void add_lines (const IndexSet &lines); + /** * Add an entry to a given * line. The list of lines is diff --git a/deal.II/lac/source/constraint_matrix.cc b/deal.II/lac/source/constraint_matrix.cc index 493aef2ada..bb59be82f2 100644 --- a/deal.II/lac/source/constraint_matrix.cc +++ b/deal.II/lac/source/constraint_matrix.cc @@ -110,6 +110,15 @@ ConstraintMatrix::add_lines (const std::vector &lines) +void +ConstraintMatrix::add_lines (const IndexSet &lines) +{ + for (unsigned int i=0; i > &col_val_pairs)