]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add one more check for inhomogeneous constraints. Correct one mistake in distribute_l...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 18 Aug 2009 11:46:07 +0000 (11:46 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 18 Aug 2009 11:46:07 +0000 (11:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@19298 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/constraint_matrix.h
deal.II/lac/include/lac/constraint_matrix.templates.h

index 0a9dfa40a5ab63f79c43b110c298753e9deec010..b1e6df9e78bc9032617bd61033a6881b4e14c1d0 100644 (file)
@@ -609,6 +609,14 @@ class ConstraintMatrix : public Subscriptor
                                      */
     unsigned int max_constraint_indirections () const;
 
+                                    /**
+                                     * Returns <tt>true</tt> in case the
+                                     * dof is constrained and there is a
+                                     * non-trivial inhomogeneous valeus set
+                                     * to the dof.
+                                     */
+    bool is_inhomogeneously_constrained (const unsigned int index) const;
+
                                     /**
                                      * Returns <tt>false</tt> if all
                                      * constraints in the ConstraintMatrix
@@ -1694,6 +1702,26 @@ ConstraintMatrix::is_constrained (const unsigned int index) const
           (constraint_line_exists[index] == true));
 }
 
+
+
+inline
+bool
+ConstraintMatrix::is_inhomogeneously_constrained (const unsigned int index) const 
+{
+  if (is_constrained(index) == false)
+    return false;
+
+  ConstraintLine index_comparison;
+  index_comparison.line = index;
+
+  const std::vector<ConstraintLine>::const_iterator
+    position = std::lower_bound (lines.begin(),
+                                lines.end(),
+                                index_comparison);
+  Assert (position != lines.end(), ExcInternalError());
+  return position->inhomogeneity != 0;
+}
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif
index b0ac3ed4f80a2b2ef33ed06830eb09dfb2f2b830..2a94f08a070076437cd3f01a9db1521ebd816b71 100644 (file)
@@ -797,7 +797,7 @@ distribute_local_to_global (const Vector<double>            &local_vector,
                    {
                      Assert (is_constrained(position_j->entries[q].first) == false,
                              ExcMessage ("Tried to distribute to a fixed dof."));
-                     global_vector(position_j->entries[j].first)
+                     global_vector(position_j->entries[q].first)
                        -= val * position_j->entries[q].second * matrix_entry;
                    }
                }

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.