From: wolf Date: Wed, 17 Nov 2004 04:05:28 +0000 (+0000) Subject: Another small clean-up. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=518417d826bf73c126281a21e288079e5c3cdf66;p=dealii-svn.git Another small clean-up. git-svn-id: https://svn.dealii.org/trunk@9785 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_q.cc b/deal.II/deal.II/source/fe/fe_q.cc index 075a2121ea..b275f532e8 100644 --- a/deal.II/deal.II/source/fe/fe_q.cc +++ b/deal.II/deal.II/source/fe/fe_q.cc @@ -1397,28 +1397,25 @@ FE_Q<3>::initialize_constraints () bool mirror[dim - 1]; Point constraint_point; + // Eliminate FP errors in constraint + // points. Due to their origin, they + // must all be fractions of the unit + // interval. If we have polynomial + // degree 4, the refined element has 8 + // intervals. Hence the coordinates + // must be 0, 0.125, 0.25, 0.375 etc. + // Now the coordinates of the + // constraint points will be multiplied + // by the inverse of the interval size + // (in the example by 8). After that + // the coordinates must be integral + // numbers. Hence a normal truncation + // is performed and the coordinates + // will be scaled back. The equal + // treatment of all coordinates should + // eliminate any FP errors. for (unsigned int k = 0; k < dim - 1; ++k) { - // Eliminate FP errors in - // constraint points. Due to their - // origin, they must all be - // fractions of the unit - // interval. If we have polynomial - // degree 4, the refined element - // has 8 intervals. Hence the - // coordinates must be 0, 0.125, - // 0.25, 0.375 etc. Now the - // coordinates of the constraint - // points will be multiplied by the - // inverse of the interval size (in - // the example by 8). After that - // the coordinates must be integral - // numbers. Hence a normal - // truncation is performed and the - // coordinates will be scaled - // back. The equal treatment of all - // coordinates should eliminate any - // FP errors. const int coord_int = static_cast (constraint_points[j](k) * interval + 0.25); constraint_point(k) = 1.*coord_int / interval; @@ -1473,7 +1470,7 @@ FE_Q<3>::initialize_constraints () = { face_index_map[i] % (this->degree + 1), face_index_map[i] / (this->degree + 1) }; - for (unsigned int k = 0; k < dim - 1; ++k) + for (unsigned int k = 0; k<2; ++k) if (mirror[k]) indices[k] = this->degree - indices[k];