]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid running into an assertion for very high order.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 May 2013 15:01:54 +0000 (15:01 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 May 2013 15:01:54 +0000 (15:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@29511 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/fe/fe_q_base.cc

index bb320f8a4ca2754a9f18050da438e4530d37fb9d..331131daf36c75972ca04201635b4b5f9bbd5e97 100644 (file)
@@ -185,14 +185,15 @@ struct FE_Q_Base<POLY,xdim,xspacedim>::Implementation
     const std::vector<unsigned int> &index_map_inverse =
       fe.poly_space.get_numbering_inverse();
     const std::vector<unsigned int> face_index_map =
-      FE_Q_Helper::face_lexicographic_to_hierarchic_numbering<2>(fe.degree);
-    Assert(fe.poly_space.compute_value(index_map_inverse[0],Point<2>()) == 1.,
+      FE_Q_Helper::face_lexicographic_to_hierarchic_numbering<dim>(fe.degree);
+    Assert(std::abs(fe.poly_space.compute_value(index_map_inverse[0],Point<dim>())
+                    - 1.) < 1e-14,
            ExcInternalError());
 
     for (unsigned int i=0; i<constraint_points.size(); ++i)
       for (unsigned int j=0; j<fe.degree+1; ++j)
         {
-          Point<2> p;
+          Point<dim> p;
           p[0] = constraint_points[i](0);
           fe.interface_constraints(i,face_index_map[j]) =
             fe.poly_space.compute_value(index_map_inverse[j], p);
@@ -304,8 +305,9 @@ struct FE_Q_Base<POLY,xdim,xspacedim>::Implementation
     const std::vector<unsigned int> &index_map_inverse =
       fe.poly_space.get_numbering_inverse();
     const std::vector<unsigned int> face_index_map =
-      FE_Q_Helper::face_lexicographic_to_hierarchic_numbering<3>(fe.degree);
-    Assert(fe.poly_space.compute_value(index_map_inverse[0],Point<3>()) == 1.,
+      FE_Q_Helper::face_lexicographic_to_hierarchic_numbering<dim>(fe.degree);
+    Assert(std::abs(fe.poly_space.compute_value(index_map_inverse[0],Point<dim>())
+                    - 1.) < 1e-14,
            ExcInternalError());
 
     fe.interface_constraints

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.