From fd56eff257d78aefa3206f4d69037255119347c1 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 26 Feb 2003 19:18:14 +0000 Subject: [PATCH] Fix a really hard to find error in a code path that is only taken in 3d by Nedelec elements... git-svn-id: https://svn.dealii.org/trunk@7250 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe.cc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc index 861e0a8ef6..e1c8164b62 100644 --- a/deal.II/deal.II/source/fe/fe.cc +++ b/deal.II/deal.II/source/fe/fe.cc @@ -523,9 +523,28 @@ compute_2nd (const Mapping &mapping, // nonzero // compoment unsigned int component=0; - for (unsigned int k=0; k<=n; ++k) - while (nonzero_components[shape_index][component] == false) - ++component; + for (unsigned int nonzero_comp=0; componentn_components(); + ++component) + if (nonzero_components[shape_index][component] == true) + { + ++nonzero_comp; + // check + // whether we + // have found + // the + // component + // we are + // looking + // for. note + // that + // nonzero_comp + // is 1-based + // by the way + // we compute + // it + if (nonzero_comp == n+1) + break; + } Assert (component < this->n_components(), ExcInternalError()); -- 2.39.5