]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add add_lines(IndexSet).
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 13 Feb 2010 00:59:00 +0000 (00:59 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 13 Feb 2010 00:59:00 +0000 (00:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@20585 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/constraint_matrix.h
deal.II/lac/source/constraint_matrix.cc

index 4b7f379544c382b596ff8b21748c146bce22ef10..26ad0c8d0381cdb580d9c196ce68a9b5e46a057a 100644 (file)
@@ -433,6 +433,28 @@ class ConstraintMatrix : public Subscriptor
                                      */
     void add_lines (const std::set<unsigned int> &lines);
 
+                                    /**
+                                     * Call the first add_line() function for
+                                     * every index <code>i</code> 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
index 493aef2adaf54b2c41c2859a96a036eb3d1787b3..bb59be82f22e669639c93b8a7c6cf92feef8aabe 100644 (file)
@@ -110,6 +110,15 @@ ConstraintMatrix::add_lines (const std::vector<bool> &lines)
 
 
 
+void
+ConstraintMatrix::add_lines (const IndexSet &lines)
+{
+  for (unsigned int i=0; i<lines.n_elements(); ++i)
+    add_line (lines.nth_index_in_set(i));
+}
+
+
+
 void
 ConstraintMatrix::add_entries (const unsigned int                        line,
                                const std::vector<std::pair<unsigned int,double> > &col_val_pairs)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.