template <int dim, int spacedim>
void
-test()
+test(const bool flip_refinement = false)
{
Triangulation<dim, spacedim> tria;
GridGenerator::subdivided_hyper_cube(
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<int>(flip_refinement)))
cell->set_refine_flag();
tria.execute_coarsening_and_refinement();
MappingQ<dim> mapping(2);
- // Point at the edge between cells of different levels
Point<dim> 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);
}
test<1, 1>();
test<2, 2>();
test<3, 3>();
+ test<1, 1>(true);
+ test<2, 2>(true);
+ test<3, 3>(true);
return 0;
}
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
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
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::