From: Martin Kronbichler <kronbichler@lnm.mw.tum.de>
Date: Thu, 6 Aug 2009 13:44:51 +0000 (+0000)
Subject: Add a check function for information about inhomogeneities.
X-Git-Tag: v8.0.0~7381
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24e474368c42db2ded1525f753ba054dca319f09;p=dealii.git

Add a check function for information about inhomogeneities.

git-svn-id: https://svn.dealii.org/trunk@19186 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 0eabd8754b..8cb639138c 100644
--- a/deal.II/lac/include/lac/constraint_matrix.h
+++ b/deal.II/lac/include/lac/constraint_matrix.h
@@ -606,8 +606,15 @@ class ConstraintMatrix : public Subscriptor
 				      */
     unsigned int max_constraint_indirections () const;
 
-    
-    
+				     /**
+				      * Returns <tt>false</tt> if all
+				      * constraints in the ConstraintMatrix
+				      * are homogeneous ones, and
+				      * <tt>true</tt> if there is at least
+				      * one inhomogeneity.
+				      */
+    bool has_inhomogeneities () const;
+
 				     /**
 				      * Print the constraint lines. Mainly
 				      * for debugging purposes.
diff --git a/deal.II/lac/source/constraint_matrix.cc b/deal.II/lac/source/constraint_matrix.cc
index 5bd0c374fe..87d00d487c 100644
--- a/deal.II/lac/source/constraint_matrix.cc
+++ b/deal.II/lac/source/constraint_matrix.cc
@@ -2005,6 +2005,17 @@ unsigned int ConstraintMatrix::max_constraint_indirections () const
   return return_value;
 }
 
+
+
+bool ConstraintMatrix::has_inhomogeneities () const
+{
+  for (std::vector<ConstraintLine>::const_iterator i=lines.begin();
+       i!=lines.end(); ++i)
+    if (i->inhomogeneity != 0.)
+      return true;
+
+  return false;
+}
     
 
 void ConstraintMatrix::print (std::ostream &out) const