From 442639454ca60b36c0b8fa57191b59219248c4ea Mon Sep 17 00:00:00 2001 From: oliver Date: Sat, 23 Oct 2004 14:38:21 +0000 Subject: [PATCH] Implemented a small fix, which sets near zero elements in the constraint matrix, which stem from numerical inaccuracies, to zero. git-svn-id: https://svn.dealii.org/trunk@9721 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe_q.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deal.II/deal.II/source/fe/fe_q.cc b/deal.II/deal.II/source/fe/fe_q.cc index 1ac505552c..6420c058ba 100644 --- a/deal.II/deal.II/source/fe/fe_q.cc +++ b/deal.II/deal.II/source/fe/fe_q.cc @@ -1398,6 +1398,20 @@ FE_Q<3>::initialize_constraints () interface_constraints(j,i) = poly_f->compute_value(face_index_map [i], constraint_points[j]); + + // if the value is small up + // to round-off, then + // simply set it to zero to + // avoid unwanted fill-in + // of the constraint + // matrices (which would + // then increase the number + // of other DoFs a + // constrained DoF would + // couple to) + if (std::fabs(interface_constraints(j,i)) < 1e-14) + interface_constraints(j,i) = 0; + indx++; } delete poly_f; -- 2.39.5