From: kronbichler Date: Thu, 6 Aug 2009 13:44:51 +0000 (+0000) Subject: Add a check function for information about inhomogeneities. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=164da9a6776dece7c8f353589cbc9f9146b5551b;p=dealii-svn.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 false if all + * constraints in the ConstraintMatrix + * are homogeneous ones, and + * true 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::const_iterator i=lines.begin(); + i!=lines.end(); ++i) + if (i->inhomogeneity != 0.) + return true; + + return false; +} void ConstraintMatrix::print (std::ostream &out) const