From 963df590d5ed65a0a1cd8680bb6dd3b3d1febdd9 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 28 Jul 2006 23:36:09 +0000 Subject: [PATCH] Don't make function static to avoid warnings in 1d and 3d about an unused static function. Rather, put it into an anonymous namespace git-svn-id: https://svn.dealii.org/trunk@13485 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_tools.cc | 107 ++++++++++++----------- 1 file changed, 55 insertions(+), 52 deletions(-) diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 52ce982be5..22df466c73 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1560,63 +1560,66 @@ namespace internal template class int2type {}; - - static - void - filter_constraints (const std::vector &dofs_mother, - const std::vector &dofs_child, - const FullMatrix &face_constraints, - ConstraintMatrix &constraints) + namespace { - // This method removes zero constraints - // and those, which constrain a DoF which - // was already eliminated in one of the - // previous steps of the hp hanging node - // procedure. - - Assert (face_constraints.m () == dofs_mother.size (), - ExcDimensionMismatch(dofs_mother.size (), - face_constraints.n())); - Assert (face_constraints.n () == dofs_child.size (), - ExcDimensionMismatch(dofs_child.size (), - face_constraints.m())); - - const unsigned int n_dofs_mother = dofs_mother.size (); - const unsigned int n_dofs_child = dofs_child.size (); - - Assert (n_dofs_mother <= n_dofs_child, - ExcInternalError ()); - for (unsigned int col=0; col!=n_dofs_child; ++col) - { - bool constrain = true; + void + filter_constraints (const std::vector &dofs_mother, + const std::vector &dofs_child, + const FullMatrix &face_constraints, + ConstraintMatrix &constraints) + { + // This method removes zero constraints + // and those, which constrain a DoF which + // was already eliminated in one of the + // previous steps of the hp hanging node + // procedure. + + Assert (face_constraints.m () == dofs_mother.size (), + ExcDimensionMismatch(dofs_mother.size (), + face_constraints.n())); + Assert (face_constraints.n () == dofs_child.size (), + ExcDimensionMismatch(dofs_child.size (), + face_constraints.m())); + + const unsigned int n_dofs_mother = dofs_mother.size (); + const unsigned int n_dofs_child = dofs_child.size (); + + Assert (n_dofs_mother <= n_dofs_child, + ExcInternalError ()); + + for (unsigned int col=0; col!=n_dofs_child; ++col) + { + bool constrain = true; - // Check if we have a constraint, - // which is already satisfied. - for (unsigned int i=0; i!=n_dofs_mother; ++i) - { - // Check for a value of almost exactly - // 1.0 - if (fabs (face_constraints (i,col) - 1.0) < 1.0e-15) - constrain = (dofs_mother[i] != dofs_child[col]); - } + // Check if we have a constraint, + // which is already satisfied. + for (unsigned int i=0; i!=n_dofs_mother; ++i) + { + // Check for a value of almost exactly + // 1.0 + if (fabs (face_constraints (i,col) - 1.0) < 1.0e-15) + constrain = (dofs_mother[i] != dofs_child[col]); + } - // If this constraint is not - // automatically satisfied by - // the previous step of removing - // equivalent DoFs, add this - // constraint. - if (constrain) - { - constraints.add_line (dofs_child[col]); - for (unsigned int i=0; i!=n_dofs_mother; ++i) - constraints.add_entry (dofs_child[col], - dofs_mother[i], - face_constraints (i,col)); - } - } - } + // If this constraint is not + // automatically satisfied by + // the previous step of removing + // equivalent DoFs, add this + // constraint. + if (constrain) + { + constraints.add_line (dofs_child[col]); + for (unsigned int i=0; i!=n_dofs_mother; ++i) + constraints.add_entry (dofs_child[col], + dofs_mother[i], + face_constraints (i,col)); + } + } + } + } + #if deal_II_dimension == 1 static -- 2.39.5