From 6a8779d3db8f64fc60b302a4c5cc9f62460bb294 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 29 Mar 2000 14:14:49 +0000 Subject: [PATCH] Add a function that asks for the maximum number of dof indirections. git-svn-id: https://svn.dealii.org/trunk@2638 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/dofs/dof_constraints.h | 22 +++++++++++++++++++ .../deal.II/source/dofs/dof_constraints.cc | 13 +++++++++++ 2 files changed, 35 insertions(+) diff --git a/deal.II/deal.II/include/dofs/dof_constraints.h b/deal.II/deal.II/include/dofs/dof_constraints.h index 6ad1c3995c..1c6b88f5d1 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.h @@ -178,6 +178,28 @@ class ConstraintMatrix : public Subscriptor * through all entries. */ bool is_constrained (const unsigned int index) const; + + /** + * Return the maximum number of + * other dofs that one dof is + * constrained to. For example, + * in 2d a hanging node is + * constrained only to its two + * neighbors, so the returned + * value would be #2#. However, + * for higher order elements + * and/or higher dimensions, or + * other types of constraints, + * this number is no more + * obvious. + * + * The name indicates that within + * the system matrix, references + * to a constrained node are + * indirected to the nodes it is + * constrained to. + */ + unsigned int max_constraint_indirections () const; /** * Condense a given sparsity pattern. This diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index 0c259e9811..b1f2afbedc 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -370,6 +370,19 @@ bool ConstraintMatrix::is_constrained (const unsigned int index) const }; + +unsigned int ConstraintMatrix::max_constraint_indirections () const +{ + unsigned int return_value = 0; + for (vector::const_iterator i=lines.begin(); + i!=lines.end(); ++i) + return_value = max(return_value, i->entries.size()); + + return return_value; +}; + + + void ConstraintMatrix::print (ostream &out) const { for (unsigned int i=0; i!=lines.size(); ++i) for (unsigned int j=0; j!=lines[i].entries.size(); ++j) -- 2.39.5