From: Martin Kronbichler Date: Mon, 28 May 2018 18:58:45 +0000 (+0200) Subject: Return empty vector if point not found. X-Git-Tag: v9.1.0-rc1~1066^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8838fc78c94db6d455193df951e24cc9e5293920;p=dealii.git Return empty vector if point not found. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 7a961e9f96..8258bdf239 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -1693,8 +1693,13 @@ namespace GridTools std::pair::active_cell_iterator, Point>> cells_and_points; - cells_and_points.push_back(find_active_cell_around_point_tolerance( - mapping, mesh, p, marked_vertices, tolerance)); + try + { + cells_and_points.push_back(find_active_cell_around_point_tolerance( + mapping, mesh, p, marked_vertices, tolerance)); + } + catch (ExcPointNotFound &) + {} if (!cells_and_points.empty()) { diff --git a/tests/grid/find_all_active_cells_around_point_02.cc b/tests/grid/find_all_active_cells_around_point_02.cc index 544c9194e2..5a8a6e966b 100644 --- a/tests/grid/find_all_active_cells_around_point_02.cc +++ b/tests/grid/find_all_active_cells_around_point_02.cc @@ -82,6 +82,7 @@ test(unsigned int n_ref) if (dim == 3) p[2] = std::cos(theta) * r; print_result(mapping, tria, p, 1e-8); + print_result(mapping, tria, p, 1e-12); } } { diff --git a/tests/grid/find_all_active_cells_around_point_02.output b/tests/grid/find_all_active_cells_around_point_02.output index f5c3ab01a4..6f7dcc99b1 100644 --- a/tests/grid/find_all_active_cells_around_point_02.output +++ b/tests/grid/find_all_active_cells_around_point_02.output @@ -24,19 +24,33 @@ DEAL:: DEAL::Testing 2D with point 0.5656854249 0.5656854249 tolerance 1.000000000e-08 DEAL::Cell: 0_1:2 unit point 0.7500000000 1.000000000 DEAL:: +DEAL::Testing 2D with point 0.5656854249 0.5656854249 tolerance 1.000000000e-12 +DEAL:: DEAL::Testing 2D with point 0.6010407640 0.6010407640 tolerance 1.000000000e-08 DEAL::Cell: 0_1:2 unit point 0.7500000000 0.5000000001 DEAL:: +DEAL::Testing 2D with point 0.6010407640 0.6010407640 tolerance 1.000000000e-12 +DEAL::Cell: 0_1:2 unit point 0.7500000000 0.5000000001 +DEAL:: DEAL::Testing 2D with point 0.6363961031 0.6363961031 tolerance 1.000000000e-08 DEAL::Cell: 0_1:0 unit point 0.7500000000 1.000000000 DEAL::Cell: 0_1:2 unit point 0.7500000000 8.799456528e-11 DEAL:: +DEAL::Testing 2D with point 0.6363961031 0.6363961031 tolerance 1.000000000e-12 +DEAL::Cell: 0_1:2 unit point 0.7500000000 8.799456528e-11 +DEAL:: DEAL::Testing 2D with point 0.6717514421 0.6717514421 tolerance 1.000000000e-08 DEAL::Cell: 0_1:0 unit point 0.7500000000 0.5000000001 DEAL:: +DEAL::Testing 2D with point 0.6717514421 0.6717514421 tolerance 1.000000000e-12 +DEAL::Cell: 0_1:0 unit point 0.7500000000 0.5000000001 +DEAL:: DEAL::Testing 2D with point 0.7071067812 0.7071067812 tolerance 1.000000000e-08 DEAL::Cell: 0_1:0 unit point 0.7500000000 9.776992135e-11 DEAL:: +DEAL::Testing 2D with point 0.7071067812 0.7071067812 tolerance 1.000000000e-12 +DEAL::Cell: 0_1:0 unit point 0.7500000000 9.776992135e-11 +DEAL:: DEAL::Testing 2D with point 0.4702282018 0.6472135955 tolerance 1.000000000e-08 DEAL::Cell: 0_1:2 unit point 0.9000000000 0.9999999999 DEAL:: @@ -114,21 +128,39 @@ DEAL:: DEAL::Testing 2D with point 0.5656854249 0.5656854249 tolerance 1.000000000e-08 DEAL::Cell: 0_2:23 unit point 0.5000000000 1.000000000 DEAL:: +DEAL::Testing 2D with point 0.5656854249 0.5656854249 tolerance 1.000000000e-12 +DEAL::Cell: 0_2:23 unit point 0.5000000000 1.000000000 +DEAL:: DEAL::Testing 2D with point 0.6010407640 0.6010407640 tolerance 1.000000000e-08 DEAL::Cell: 0_2:21 unit point 0.5000000000 1.000000000 DEAL::Cell: 0_2:23 unit point 0.5000000000 0.000000000 DEAL:: +DEAL::Testing 2D with point 0.6010407640 0.6010407640 tolerance 1.000000000e-12 +DEAL::Cell: 0_2:21 unit point 0.5000000000 1.000000000 +DEAL::Cell: 0_2:23 unit point 0.5000000000 0.000000000 +DEAL:: DEAL::Testing 2D with point 0.6363961031 0.6363961031 tolerance 1.000000000e-08 DEAL::Cell: 0_2:03 unit point 0.5000000000 1.000000000 DEAL::Cell: 0_2:21 unit point 0.5000000000 0.000000000 DEAL:: +DEAL::Testing 2D with point 0.6363961031 0.6363961031 tolerance 1.000000000e-12 +DEAL::Cell: 0_2:03 unit point 0.5000000000 1.000000000 +DEAL::Cell: 0_2:21 unit point 0.5000000000 0.000000000 +DEAL:: DEAL::Testing 2D with point 0.6717514421 0.6717514421 tolerance 1.000000000e-08 DEAL::Cell: 0_2:01 unit point 0.5000000000 1.000000000 DEAL::Cell: 0_2:03 unit point 0.5000000000 0.000000000 DEAL:: +DEAL::Testing 2D with point 0.6717514421 0.6717514421 tolerance 1.000000000e-12 +DEAL::Cell: 0_2:01 unit point 0.5000000000 1.000000000 +DEAL::Cell: 0_2:03 unit point 0.5000000000 0.000000000 +DEAL:: DEAL::Testing 2D with point 0.7071067812 0.7071067812 tolerance 1.000000000e-08 DEAL::Cell: 0_2:01 unit point 0.5000000000 0.000000000 DEAL:: +DEAL::Testing 2D with point 0.7071067812 0.7071067812 tolerance 1.000000000e-12 +DEAL::Cell: 0_2:01 unit point 0.5000000000 0.000000000 +DEAL:: DEAL::Testing 2D with point 0.4702282018 0.6472135955 tolerance 1.000000000e-08 DEAL::Cell: 0_2:23 unit point 0.8000000000 1.000000000 DEAL:: @@ -231,12 +263,24 @@ DEAL::Cell: 1_1:7 unit point 1.000000000 1.000000000 4.276252452e-17 DEAL::Cell: 5_1:3 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 5_1:7 unit point 1.000000000 1.000000000 4.276232599e-17 DEAL:: +DEAL::Testing 3D with point 0.5656854249 0.5656854249 4.898587197e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_1:3 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 1_1:7 unit point 1.000000000 1.000000000 4.276252452e-17 +DEAL::Cell: 5_1:3 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_1:7 unit point 1.000000000 1.000000000 4.276232599e-17 +DEAL:: DEAL::Testing 3D with point 0.6010407640 0.6010407640 5.204748896e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_1:3 unit point 1.000000000 0.5000000000 1.000000000 DEAL::Cell: 1_1:7 unit point 1.000000000 0.5000000000 -2.320031823e-13 DEAL::Cell: 5_1:3 unit point 0.5000000000 1.000000000 1.000000000 DEAL::Cell: 5_1:7 unit point 0.5000000000 1.000000000 -2.320437623e-13 DEAL:: +DEAL::Testing 3D with point 0.6010407640 0.6010407640 5.204748896e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_1:3 unit point 1.000000000 0.5000000000 1.000000000 +DEAL::Cell: 1_1:7 unit point 1.000000000 0.5000000000 -2.320031823e-13 +DEAL::Cell: 5_1:3 unit point 0.5000000000 1.000000000 1.000000000 +DEAL::Cell: 5_1:7 unit point 0.5000000000 1.000000000 -2.320437623e-13 +DEAL:: DEAL::Testing 3D with point 0.6363961031 0.6363961031 5.510910596e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_1:1 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 1_1:3 unit point 1.000000000 9.017311099e-14 1.000000000 @@ -247,18 +291,40 @@ DEAL::Cell: 5_1:3 unit point 8.598570907e-14 1.000000000 1.000000000 DEAL::Cell: 5_1:6 unit point 1.000000000 1.000000000 1.235816173e-16 DEAL::Cell: 5_1:7 unit point 8.533583225e-14 1.000000000 -2.042607414e-14 DEAL:: +DEAL::Testing 3D with point 0.6363961031 0.6363961031 5.510910596e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_1:1 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 1_1:3 unit point 1.000000000 9.017311099e-14 1.000000000 +DEAL::Cell: 1_1:5 unit point 1.000000000 1.000000000 1.235815776e-16 +DEAL::Cell: 1_1:7 unit point 1.000000000 8.198972229e-14 -2.042607279e-14 +DEAL::Cell: 5_1:2 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_1:3 unit point 8.598570907e-14 1.000000000 1.000000000 +DEAL::Cell: 5_1:6 unit point 1.000000000 1.000000000 1.235816173e-16 +DEAL::Cell: 5_1:7 unit point 8.533583225e-14 1.000000000 -2.042607414e-14 +DEAL:: DEAL::Testing 3D with point 0.6717514421 0.6717514421 5.817072296e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_1:1 unit point 1.000000000 0.5000000000 1.000000000 DEAL::Cell: 1_1:5 unit point 1.000000000 0.5000000000 -2.319986659e-13 DEAL::Cell: 5_1:2 unit point 0.5000000000 1.000000000 1.000000000 DEAL::Cell: 5_1:6 unit point 0.5000000000 1.000000000 -2.319986632e-13 DEAL:: +DEAL::Testing 3D with point 0.6717514421 0.6717514421 5.817072296e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_1:1 unit point 1.000000000 0.5000000000 1.000000000 +DEAL::Cell: 1_1:5 unit point 1.000000000 0.5000000000 -2.319986659e-13 +DEAL::Cell: 5_1:2 unit point 0.5000000000 1.000000000 1.000000000 +DEAL::Cell: 5_1:6 unit point 0.5000000000 1.000000000 -2.319986632e-13 +DEAL:: DEAL::Testing 3D with point 0.7071067812 0.7071067812 6.123233996e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_1:1 unit point 1.000000000 1.299125740e-13 1.000000000 DEAL::Cell: 1_1:5 unit point 1.000000000 1.314985210e-13 -2.818294969e-14 DEAL::Cell: 5_1:2 unit point 1.242078213e-13 1.000000000 1.000000000 DEAL::Cell: 5_1:6 unit point 1.311862348e-13 1.000000000 -2.818294900e-14 DEAL:: +DEAL::Testing 3D with point 0.7071067812 0.7071067812 6.123233996e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_1:1 unit point 1.000000000 1.299125740e-13 1.000000000 +DEAL::Cell: 1_1:5 unit point 1.000000000 1.314985210e-13 -2.818294969e-14 +DEAL::Cell: 5_1:2 unit point 1.242078213e-13 1.000000000 1.000000000 +DEAL::Cell: 5_1:6 unit point 1.311862348e-13 1.000000000 -2.818294900e-14 +DEAL:: DEAL::Testing 3D with point 0.4702282018 0.6472135955 4.898587197e-17 tolerance 1.000000000e-08 DEAL::Cell: 5_1:3 unit point 1.000000000 0.8000000000 1.000000000 DEAL::Cell: 5_1:7 unit point 1.000000000 0.8000000000 4.637380246e-13 @@ -453,6 +519,12 @@ DEAL::Cell: 1_2:73 unit point 1.000000000 1.000000000 1.859145936e-17 DEAL::Cell: 5_2:37 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 5_2:73 unit point 1.000000000 1.000000000 1.859146040e-17 DEAL:: +DEAL::Testing 3D with point 0.5656854249 0.5656854249 4.898587197e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_2:37 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 1_2:73 unit point 1.000000000 1.000000000 1.859145936e-17 +DEAL::Cell: 5_2:37 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_2:73 unit point 1.000000000 1.000000000 1.859146040e-17 +DEAL:: DEAL::Testing 3D with point 0.6010407640 0.6010407640 5.204748896e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_2:35 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 1_2:37 unit point 1.000000000 1.035237010e-15 1.000000000 @@ -463,6 +535,16 @@ DEAL::Cell: 5_2:37 unit point 3.371760536e-15 1.000000000 1.000000000 DEAL::Cell: 5_2:72 unit point 1.000000000 1.000000000 1.140884752e-16 DEAL::Cell: 5_2:73 unit point 5.810029089e-15 1.000000000 1.123543668e-16 DEAL:: +DEAL::Testing 3D with point 0.6010407640 0.6010407640 5.204748896e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_2:35 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 1_2:37 unit point 1.000000000 1.035237010e-15 1.000000000 +DEAL::Cell: 1_2:71 unit point 1.000000000 1.000000000 1.140884766e-16 +DEAL::Cell: 1_2:73 unit point 1.000000000 6.309532335e-15 1.123543561e-16 +DEAL::Cell: 5_2:36 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_2:37 unit point 3.371760536e-15 1.000000000 1.000000000 +DEAL::Cell: 5_2:72 unit point 1.000000000 1.000000000 1.140884752e-16 +DEAL::Cell: 5_2:73 unit point 5.810029089e-15 1.000000000 1.123543668e-16 +DEAL:: DEAL::Testing 3D with point 0.6363961031 0.6363961031 5.510910596e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_2:17 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 1_2:35 unit point 1.000000000 5.739641719e-15 1.000000000 @@ -473,6 +555,16 @@ DEAL::Cell: 5_2:36 unit point 2.984230820e-15 1.000000000 1.000000000 DEAL::Cell: 5_2:63 unit point 1.000000000 1.000000000 1.989747189e-16 DEAL::Cell: 5_2:72 unit point -5.554517273e-15 1.000000000 1.970388457e-16 DEAL:: +DEAL::Testing 3D with point 0.6363961031 0.6363961031 5.510910596e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_2:17 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 1_2:35 unit point 1.000000000 5.739641719e-15 1.000000000 +DEAL::Cell: 1_2:53 unit point 1.000000000 1.000000000 1.989747201e-16 +DEAL::Cell: 1_2:71 unit point 1.000000000 -4.180203939e-15 1.970388233e-16 +DEAL::Cell: 5_2:27 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_2:36 unit point 2.984230820e-15 1.000000000 1.000000000 +DEAL::Cell: 5_2:63 unit point 1.000000000 1.000000000 1.989747189e-16 +DEAL::Cell: 5_2:72 unit point -5.554517273e-15 1.000000000 1.970388457e-16 +DEAL:: DEAL::Testing 3D with point 0.6717514421 0.6717514421 5.817072296e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_2:15 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 1_2:17 unit point 1.000000000 3.522141350e-15 1.000000000 @@ -483,12 +575,28 @@ DEAL::Cell: 5_2:27 unit point 6.083266222e-15 1.000000000 1.000000000 DEAL::Cell: 5_2:62 unit point 1.000000000 1.000000000 1.989746802e-16 DEAL::Cell: 5_2:63 unit point 3.099632218e-16 1.000000000 1.968434937e-16 DEAL:: +DEAL::Testing 3D with point 0.6717514421 0.6717514421 5.817072296e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_2:15 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 1_2:17 unit point 1.000000000 3.522141350e-15 1.000000000 +DEAL::Cell: 1_2:51 unit point 1.000000000 1.000000000 1.989746804e-16 +DEAL::Cell: 1_2:53 unit point 1.000000000 -2.574390584e-15 1.968435037e-16 +DEAL::Cell: 5_2:26 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_2:27 unit point 6.083266222e-15 1.000000000 1.000000000 +DEAL::Cell: 5_2:62 unit point 1.000000000 1.000000000 1.989746802e-16 +DEAL::Cell: 5_2:63 unit point 3.099632218e-16 1.000000000 1.968434937e-16 +DEAL:: DEAL::Testing 3D with point 0.7071067812 0.7071067812 6.123233996e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_2:15 unit point 1.000000000 -2.152963627e-14 1.000000000 DEAL::Cell: 1_2:51 unit point 1.000000000 -3.910010845e-15 1.966551364e-16 DEAL::Cell: 5_2:26 unit point -1.080858785e-14 1.000000000 1.000000000 DEAL::Cell: 5_2:62 unit point -1.077699249e-14 1.000000000 1.966551340e-16 DEAL:: +DEAL::Testing 3D with point 0.7071067812 0.7071067812 6.123233996e-17 tolerance 1.000000000e-12 +DEAL::Cell: 1_2:15 unit point 1.000000000 -2.152963627e-14 1.000000000 +DEAL::Cell: 1_2:51 unit point 1.000000000 -3.910010845e-15 1.966551364e-16 +DEAL::Cell: 5_2:26 unit point -1.080858785e-14 1.000000000 1.000000000 +DEAL::Cell: 5_2:62 unit point -1.077699249e-14 1.000000000 1.966551340e-16 +DEAL:: DEAL::Testing 3D with point 0.4702282018 0.6472135955 4.898587197e-17 tolerance 1.000000000e-08 DEAL::Cell: 5_2:37 unit point 1.000000000 0.6000000000 1.000000000 DEAL::Cell: 5_2:73 unit point 1.000000000 0.6000000000 2.350707507e-17