// unit cell (or at least not too far
// outside). If it is, it is also checked
// that the cell has a more refined state
- if(dist <= best_distance
- && (*cell)->level() > best_level)
+ if(dist < best_distance ||
+ (dist == best_distance && (*cell)->level() > best_level))
{
best_distance = dist;
best_level = (*cell)->level();
= GridTools::find_active_cell_around_point (tria, p);
deallog << cell << std::endl;
- for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
+ for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_cell; ++v)
deallog << "<" << cell->vertex(v) << "> ";
deallog << std::endl;
- Assert (p.distance (cell->center()) < cell->diameter()/2+1e-10,
- ExcInternalError());
+ // Transform back and forth
+ Point<3> pp =
+ StaticMappingQ1<3>::mapping.transform_unit_to_real_cell
+ ( cell,
+ GeometryInfo<3>::project_to_unit_cell
+ (
+ StaticMappingQ1<3>::mapping.transform_real_to_unit_cell
+ ( cell,
+ p
+ )
+ )
+ );
+
+ Assert (p.distance (pp) < 1e-15, ExcInternalError());
}
--- /dev/null
+
+DEAL::3.72
+DEAL::<0.750000 0.00000 0.00000> <0.875000 0.00000 0.00000> <0.750000 0.125000 0.00000> <0.875000 0.125000 0.00000> <0.750000 0.00000 0.125000> <0.875000 0.00000 0.125000> <0.750000 0.125000 0.125000> <0.875000 0.125000 0.125000>
deallog << "<" << cell->vertex(v) << "> ";
deallog << std::endl;
- Assert (p.distance (cell->center()) < cell->diameter()/2+1e-10,
- ExcInternalError());
+ // Transform back and forth
+ Point<3> pp =
+ StaticMappingQ1<3>::mapping.transform_unit_to_real_cell
+ ( cell,
+ GeometryInfo<3>::project_to_unit_cell
+ (
+ StaticMappingQ1<3>::mapping.transform_real_to_unit_cell
+ ( cell,
+ p
+ )
+ )
+ );
+
+ Assert (p.distance (pp) < 1e-15, ExcInternalError());
+
}
= GridTools::find_active_cell_around_point (map, tria, p);
deallog << cell.first << std::endl;
- for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
+ for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_cell; ++v)
deallog << "<" << cell.first->vertex(v) << "> ";
deallog << "[ " << cell.second << "] ";
deallog << std::endl;
- Assert (GeometryInfo<3>::distance_to_unit_cell(cell.second) < 1e-10,
- ExcInternalError());
+ // Now transform back and check distance
+ Point<3> pp = map.transform_unit_to_real_cell(cell.first, GeometryInfo<3>::project_to_unit_cell(cell.second));
+ deallog << pp.distance(p) << std::endl;
+ Assert (pp.distance(p) < 1e-13,
+ ExcInternalError());
}
-DEAL::3.65
-DEAL::<0.625000 0.00000 0.00000> <0.750000 0.00000 0.00000> <0.625000 0.125000 0.00000> <0.750000 0.125000 0.00000> [ 1.00000 0.00000 5.55112e-17]
+DEAL::3.72
+DEAL::<0.750000 0.00000 0.00000> <0.875000 0.00000 0.00000> <0.750000 0.125000 0.00000> <0.875000 0.125000 0.00000> <0.750000 0.00000 0.125000> <0.875000 0.00000 0.125000> <0.750000 0.125000 0.125000> <0.875000 0.125000 0.125000> [ -3.33067e-16 0.00000 5.55112e-17]
+DEAL::0
#include <fstream>
-
-
void check (Triangulation<2> &tria)
{
MappingQ<2> map(5);
// Now transform back and check distance
Point<2> pp = map.transform_unit_to_real_cell(cell.first, GeometryInfo<2>::project_to_unit_cell(cell.second));
- deallog << (pp-p).square() << std::endl;
-
- Assert (GeometryInfo<2>::distance_to_unit_cell(cell.second) < 1e-10,
+ deallog << pp.distance(p) << std::endl;
+ Assert (pp.distance(p) < 1e-13,
ExcInternalError());
}
-DEAL::2.66
-DEAL::<-0.382683 0.923880> <-0.305418 0.694720> <0.00000 1.00000> <0.00000 0.768306> [ 4.31605e-08 1.00000] 0
+DEAL::2.72
+DEAL::<0.00000 1.00000> <0.00000 0.768306> <0.382683 0.923880> <0.305418 0.694720> [ 4.31603e-08 1.26953e-19] 0
DEAL::2.72
DEAL::<0.00000 1.00000> <0.00000 0.768306> <0.382683 0.923880> <0.305418 0.694720> [ 1.84097e-08 0.0800000] 0
DEAL::2.72
DEAL::<1.00000 0.00000> <0.923880 0.382683> <0.768306 0.00000> <0.694720 0.305418> [ 0.160000 3.03924e-08] 0
DEAL::2.52
DEAL::<1.00000 0.00000> <0.923880 0.382683> <0.768306 0.00000> <0.694720 0.305418> [ 0.0800000 1.84097e-08] 0
-DEAL::2.49
-DEAL::<0.923880 -0.382683> <1.00000 0.00000> <0.694720 -0.305418> <0.768306 0.00000> [ 1.00000 4.31605e-08] 0
+DEAL::2.52
+DEAL::<1.00000 0.00000> <0.923880 0.382683> <0.768306 0.00000> <0.694720 0.305418> [ 1.60129e-16 4.31603e-08] 0
DEAL::2.49
DEAL::<0.923880 -0.382683> <1.00000 0.00000> <0.694720 -0.305418> <0.768306 0.00000> [ 0.920000 1.84097e-08] 0
DEAL::2.49
DEAL::<0.707107 -0.707107> <0.923880 -0.382683> <0.603553 -0.603553> <0.694720 -0.305418> [ 0.160000 4.17686e-08] 0
DEAL::2.48
DEAL::<0.707107 -0.707107> <0.923880 -0.382683> <0.603553 -0.603553> <0.694720 -0.305418> [ 0.0800000 2.67832e-08] 0
-DEAL::2.5
-DEAL::<0.382683 -0.923880> <0.707107 -0.707107> <0.305418 -0.694720> <0.603553 -0.603553> [ 1.00000 6.82846e-08] 0
+DEAL::2.48
+DEAL::<0.707107 -0.707107> <0.923880 -0.382683> <0.603553 -0.603553> <0.694720 -0.305418> [ 2.71333e-16 6.82843e-08] 0
DEAL::2.5
DEAL::<0.382683 -0.923880> <0.707107 -0.707107> <0.305418 -0.694720> <0.603553 -0.603553> [ 0.920000 2.67832e-08] 0
DEAL::2.5
DEAL::<0.00000 -1.00000> <0.382683 -0.923880> <0.00000 -0.768306> <0.305418 -0.694720> [ 0.160000 3.03924e-08] 0
DEAL::2.4
DEAL::<0.00000 -1.00000> <0.382683 -0.923880> <0.00000 -0.768306> <0.305418 -0.694720> [ 0.0800000 1.84097e-08] 0
-DEAL::2.1
-DEAL::<-0.382683 -0.923880> <0.00000 -1.00000> <-0.305418 -0.694720> <0.00000 -0.768306> [ 1.00000 4.31605e-08] 0
+DEAL::2.4
+DEAL::<0.00000 -1.00000> <0.382683 -0.923880> <0.00000 -0.768306> <0.305418 -0.694720> [ 3.20132e-16 4.31603e-08] 0
DEAL::2.1
DEAL::<-0.382683 -0.923880> <0.00000 -1.00000> <-0.305418 -0.694720> <0.00000 -0.768306> [ 0.920000 1.84098e-08] 0
DEAL::2.1
DEAL::<-0.923880 -0.382683> <-0.694720 -0.305418> <-1.00000 0.00000> <-0.768306 0.00000> [ 3.03924e-08 0.840000] 0
DEAL::2.18
DEAL::<-0.923880 -0.382683> <-0.694720 -0.305418> <-1.00000 0.00000> <-0.768306 0.00000> [ 1.84097e-08 0.920000] 0
-DEAL::2.18
-DEAL::<-0.923880 -0.382683> <-0.694720 -0.305418> <-1.00000 0.00000> <-0.768306 0.00000> [ 4.31605e-08 1.00000] 0
+DEAL::2.24
+DEAL::<-1.00000 0.00000> <-0.768306 0.00000> <-0.923880 0.382683> <-0.694720 0.305418> [ 4.31603e-08 -4.79881e-16] 0
DEAL::2.24
DEAL::<-1.00000 0.00000> <-0.768306 0.00000> <-0.923880 0.382683> <-0.694720 0.305418> [ 1.84097e-08 0.0800000] 0
DEAL::2.24
DEAL::<-0.923880 0.382683> <-0.694720 0.305418> <-0.707107 0.707107> <-0.603553 0.603553> [ 4.17687e-08 0.840000] 0
DEAL::2.26
DEAL::<-0.923880 0.382683> <-0.694720 0.305418> <-0.707107 0.707107> <-0.603553 0.603553> [ 2.67835e-08 0.920000] 0
-DEAL::2.26
-DEAL::<-0.923880 0.382683> <-0.694720 0.305418> <-0.707107 0.707107> <-0.603553 0.603553> [ 6.82845e-08 1.00000] 0
+DEAL::2.64
+DEAL::<-0.707107 0.707107> <-0.603553 0.603553> <-0.382683 0.923880> <-0.305418 0.694720> [ 6.82843e-08 -5.24473e-16] 0
DEAL::2.64
DEAL::<-0.707107 0.707107> <-0.603553 0.603553> <-0.382683 0.923880> <-0.305418 0.694720> [ 2.67832e-08 0.0800000] 0
DEAL::2.64