From b8cc8d81d8745e2bacfaf56c336278e2aa089e7c Mon Sep 17 00:00:00 2001 From: Magdalena Schreter Date: Tue, 7 Feb 2023 20:25:34 +0100 Subject: [PATCH] extend find_all_active_cells_around_point_04.cc --- .../find_all_active_cells_around_point_04.cc | 24 ++++++-- ...nd_all_active_cells_around_point_04.output | 60 +++++++++++++++++++ 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/tests/grid/find_all_active_cells_around_point_04.cc b/tests/grid/find_all_active_cells_around_point_04.cc index 4654d92e41..296fda1082 100644 --- a/tests/grid/find_all_active_cells_around_point_04.cc +++ b/tests/grid/find_all_active_cells_around_point_04.cc @@ -45,7 +45,7 @@ print_result(const Mapping & mapping, template void -test() +test(const bool flip_refinement = false) { Triangulation tria; GridGenerator::subdivided_hyper_cube( @@ -55,7 +55,7 @@ test() for (unsigned int i = 1; i < 3; ++i) { for (const auto &cell : tria.active_cell_iterators()) - if (cell->at_boundary(0)) + if (cell->at_boundary(static_cast(flip_refinement))) cell->set_refine_flag(); tria.execute_coarsening_and_refinement(); @@ -63,17 +63,28 @@ test() MappingQ mapping(2); - // Point at the edge between cells of different levels Point point_at_edge; - point_at_edge[dim - 1] = 0.25; + // boundary face + point_at_edge[dim - 1] = flip_refinement ? 0.75 : 0.25; print_result(mapping, tria, point_at_edge); if (dim > 1) { + // interior face for (unsigned d = 0; d < dim; ++d) - point_at_edge[d] = 0.25; + point_at_edge[d] = flip_refinement ? 0.75 : 0.25; + print_result(mapping, tria, point_at_edge); + // hanging node + for (unsigned d = 0; d < dim - 1; ++d) + point_at_edge[d] = 0.5; + print_result(mapping, tria, point_at_edge); + } + else + { + // interior face + point_at_edge[0] = 0.5; print_result(mapping, tria, point_at_edge); } @@ -94,5 +105,8 @@ main() test<1, 1>(); test<2, 2>(); test<3, 3>(); + test<1, 1>(true); + test<2, 2>(true); + test<3, 3>(true); return 0; } diff --git a/tests/grid/find_all_active_cells_around_point_04.output b/tests/grid/find_all_active_cells_around_point_04.output index 1652b45e37..127e073ea0 100644 --- a/tests/grid/find_all_active_cells_around_point_04.output +++ b/tests/grid/find_all_active_cells_around_point_04.output @@ -3,6 +3,10 @@ DEAL::Testing 1D with point 0.2500000000 tolerance default DEAL::Cell: 0_1:1 unit point 0.000000000 DEAL::Cell: 0_2:01 unit point 1.000000000 DEAL:: +DEAL::Testing 1D with point 0.5000000000 tolerance default +DEAL::Cell: 1_0: unit point 0.000000000 +DEAL::Cell: 0_1:1 unit point 1.000000000 +DEAL:: DEAL::Testing 2D with point 0.000000000 0.2500000000 tolerance default DEAL::Cell: 0_2:02 unit point 0.000000000 1.000000000 DEAL::Cell: 0_2:20 unit point 0.000000000 0.000000000 @@ -13,6 +17,11 @@ DEAL::Cell: 0_1:3 unit point 0.000000000 0.000000000 DEAL::Cell: 0_2:03 unit point 1.000000000 1.000000000 DEAL::Cell: 0_2:21 unit point 1.000000000 0.000000000 DEAL:: +DEAL::Testing 2D with point 0.5000000000 0.2500000000 tolerance default +DEAL::Cell: 1_0: unit point 0.000000000 0.5000000000 +DEAL::Cell: 0_1:1 unit point 1.000000000 1.000000000 +DEAL::Cell: 0_1:3 unit point 1.000000000 0.000000000 +DEAL:: DEAL::Testing 3D with point 0.000000000 0.000000000 0.2500000000 tolerance default DEAL::Cell: 0_2:04 unit point 0.000000000 0.000000000 1.000000000 DEAL::Cell: 0_2:40 unit point 0.000000000 0.000000000 0.000000000 @@ -27,3 +36,54 @@ DEAL::Cell: 0_2:25 unit point 1.000000000 0.000000000 1.000000000 DEAL::Cell: 0_2:43 unit point 1.000000000 1.000000000 0.000000000 DEAL::Cell: 0_2:61 unit point 1.000000000 0.000000000 0.000000000 DEAL:: +DEAL::Testing 3D with point 0.5000000000 0.5000000000 0.2500000000 tolerance default +DEAL::Cell: 1_0: unit point 0.000000000 1.000000000 0.5000000000 +DEAL::Cell: 3_0: unit point 0.000000000 0.000000000 0.5000000000 +DEAL::Cell: 0_1:3 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 0_1:7 unit point 1.000000000 1.000000000 0.000000000 +DEAL::Cell: 2_1:1 unit point 1.000000000 0.000000000 1.000000000 +DEAL::Cell: 2_1:5 unit point 1.000000000 0.000000000 0.000000000 +DEAL:: +DEAL::Testing 1D with point 0.7500000000 tolerance default +DEAL::Cell: 1_1:0 unit point 1.000000000 +DEAL::Cell: 1_2:10 unit point 0.000000000 +DEAL:: +DEAL::Testing 1D with point 0.5000000000 tolerance default +DEAL::Cell: 0_0: unit point 1.000000000 +DEAL::Cell: 1_1:0 unit point 0.000000000 +DEAL:: +DEAL::Testing 2D with point 0.000000000 0.7500000000 tolerance default +DEAL::Cell: 2_0: unit point 0.000000000 0.5000000000 +DEAL:: +DEAL::Testing 2D with point 0.7500000000 0.7500000000 tolerance default +DEAL::Cell: 3_1:0 unit point 1.000000000 1.000000000 +DEAL::Cell: 3_1:2 unit point 1.000000000 0.000000000 +DEAL::Cell: 3_2:12 unit point 0.000000000 1.000000000 +DEAL::Cell: 3_2:30 unit point 0.000000000 0.000000000 +DEAL:: +DEAL::Testing 2D with point 0.5000000000 0.7500000000 tolerance default +DEAL::Cell: 2_0: unit point 1.000000000 0.5000000000 +DEAL::Cell: 3_1:0 unit point 0.000000000 1.000000000 +DEAL::Cell: 3_1:2 unit point 0.000000000 0.000000000 +DEAL:: +DEAL::Testing 3D with point 0.000000000 0.000000000 0.7500000000 tolerance default +DEAL::Cell: 4_0: unit point 0.000000000 0.000000000 0.5000000000 +DEAL:: +DEAL::Testing 3D with point 0.7500000000 0.7500000000 0.7500000000 tolerance default +DEAL::Cell: 7_1:0 unit point 1.000000000 1.000000000 1.000000000 +DEAL::Cell: 7_1:2 unit point 1.000000000 0.000000000 1.000000000 +DEAL::Cell: 7_1:4 unit point 1.000000000 1.000000000 0.000000000 +DEAL::Cell: 7_1:6 unit point 1.000000000 0.000000000 0.000000000 +DEAL::Cell: 7_2:16 unit point 0.000000000 1.000000000 1.000000000 +DEAL::Cell: 7_2:34 unit point 0.000000000 0.000000000 1.000000000 +DEAL::Cell: 7_2:52 unit point 0.000000000 1.000000000 0.000000000 +DEAL::Cell: 7_2:70 unit point 0.000000000 0.000000000 0.000000000 +DEAL:: +DEAL::Testing 3D with point 0.5000000000 0.5000000000 0.7500000000 tolerance default +DEAL::Cell: 4_0: unit point 1.000000000 1.000000000 0.5000000000 +DEAL::Cell: 6_0: unit point 1.000000000 0.000000000 0.5000000000 +DEAL::Cell: 5_1:2 unit point 0.000000000 1.000000000 1.000000000 +DEAL::Cell: 5_1:6 unit point 0.000000000 1.000000000 0.000000000 +DEAL::Cell: 7_1:0 unit point 0.000000000 0.000000000 1.000000000 +DEAL::Cell: 7_1:4 unit point 0.000000000 0.000000000 0.000000000 +DEAL:: -- 2.39.5