From: kronbichler Date: Wed, 11 Mar 2009 12:05:41 +0000 (+0000) Subject: Change the tolerances for when considering a cell a translation of the previous one... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=269c78ee74e96c40f8eb2cbb4b772721f38c266a;p=dealii-svn.git Change the tolerances for when considering a cell a translation of the previous one in the CellSimilarity concept. The old tolerance was not really achievable. git-svn-id: https://svn.dealii.org/trunk@18479 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index f358211857..8fc34eea09 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -3269,18 +3269,27 @@ FEValuesBase::check_cell_similarity // test for translation { - // otherwise, go through the vertices and - // check... The cell is a translation of - // the previous one in case the distance - // between the individual vertices in the - // two cell is the same for all the + // otherwise, go through the vertices + // and check... The cell is a + // translation of the previous one in + // case the distance between the + // individual vertices in the two + // cell is the same for all the // vertices. So do the check by first // getting the distance on the first - // vertex, and then checking whether all - // others have the same. + // vertex, and then checking whether + // all others have the same down to + // rounding errors (we have to be + // careful here because the + // calculation of the displacement + // between one cell and the next can + // already result in the loss of one + // or two digits), so we choose 1e-12 + // times the distance between the + // zeroth vertices here. bool is_translation = true; const Point dist = cell->vertex(0) - present_cell->vertex(0); - const double tolerance = 1e-30 * dist.norm_square(); + const double tolerance = 1e-24 * dist.norm_square(); for (unsigned int i=1; i::vertices_per_cell; ++i) { Point dist_new = cell->vertex(i) - present_cell->vertex(i) - dist;