From 24e474368c42db2ded1525f753ba054dca319f09 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 6 Aug 2009 13:44:51 +0000 Subject: [PATCH] Add a check function for information about inhomogeneities. git-svn-id: https://svn.dealii.org/trunk@19186 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/constraint_matrix.h | 11 +++++++++-- deal.II/lac/source/constraint_matrix.cc | 11 +++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) 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 -- 2.39.5