From 3f72612990f24c6bf0290d230b0b86cf9b469c32 Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Sun, 25 Feb 2024 13:33:12 -0500 Subject: [PATCH] Add tests for cases that lead to wrong boundary ID --- ...grid_generator_cylinder_shell_colorized.cc | 23 +++++++++++++++- ..._generator_cylinder_shell_colorized.output | 27 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/tests/grid/grid_generator_cylinder_shell_colorized.cc b/tests/grid/grid_generator_cylinder_shell_colorized.cc index 454c20b9c0..c4d7066e95 100644 --- a/tests/grid/grid_generator_cylinder_shell_colorized.cc +++ b/tests/grid/grid_generator_cylinder_shell_colorized.cc @@ -30,7 +30,8 @@ template void test(std::ostream &out) { - deallog << "cylinder_shell colorized" << std::endl; + deallog << "cylinder_shell colorized with default aspect ratio" << std::endl; + { Triangulation tr; GridGenerator::cylinder_shell(tr, 2., 5., 6., 0, 0, true); @@ -46,6 +47,26 @@ test(std::ostream &out) << " faceidx = " << face->index() << std::endl; } } + } + + deallog << "cylinder_shell colorized with 3:2 ratio " << std::endl; + { + Triangulation tr; + GridGenerator::cylinder_shell(tr, 2., 5., 6., 3, 2, true); + + for (const auto &cell : tr.active_cell_iterators()) + { + deallog << "cell:" << std::endl; + + for (const auto &face : cell->face_iterators()) + { + if (face->at_boundary()) + deallog << "boundary id = " << face->boundary_id() + << " center = " << face->center() + << " faceidx = " << face->index() << std::endl; + } + } + } } diff --git a/tests/grid/grid_generator_cylinder_shell_colorized.output b/tests/grid/grid_generator_cylinder_shell_colorized.output index ff129338a6..cc87d9d16f 100644 --- a/tests/grid/grid_generator_cylinder_shell_colorized.output +++ b/tests/grid/grid_generator_cylinder_shell_colorized.output @@ -1,5 +1,5 @@ -DEAL::cylinder_shell colorized +DEAL::cylinder_shell colorized with default aspect ratio DEAL::cell: DEAL::boundary id = 2 center = 5.45581 0.491031 0.00000 faceidx = 0 DEAL::boundary id = 1 center = 5.95179 0.535671 0.333333 faceidx = 35 @@ -385,3 +385,28 @@ DEAL::cell: DEAL::boundary id = 3 center = 5.45581 -0.491031 2.00000 faceidx = 418 DEAL::boundary id = 1 center = 5.95179 -0.535671 1.66667 faceidx = 417 DEAL::boundary id = 0 center = 4.95982 -0.446392 1.66667 faceidx = 454 +DEAL::cylinder_shell colorized with 3:2 ratio +DEAL::cell: +DEAL::boundary id = 2 center = 1.37500 2.38157 0.00000 faceidx = 0 +DEAL::boundary id = 1 center = 1.50000 2.59808 0.500000 faceidx = 3 +DEAL::boundary id = 0 center = 1.25000 2.16506 0.500000 faceidx = 12 +DEAL::cell: +DEAL::boundary id = 2 center = -2.75000 1.11022e-15 0.00000 faceidx = 1 +DEAL::boundary id = 1 center = -3.00000 8.88178e-16 0.500000 faceidx = 6 +DEAL::boundary id = 0 center = -2.50000 8.88178e-16 0.500000 faceidx = 13 +DEAL::cell: +DEAL::boundary id = 2 center = 1.37500 -2.38157 0.00000 faceidx = 2 +DEAL::boundary id = 1 center = 1.50000 -2.59808 0.500000 faceidx = 9 +DEAL::boundary id = 0 center = 1.25000 -2.16506 0.500000 faceidx = 14 +DEAL::cell: +DEAL::boundary id = 3 center = 1.37500 2.38157 2.00000 faceidx = 16 +DEAL::boundary id = 1 center = 1.50000 2.59808 1.50000 faceidx = 15 +DEAL::boundary id = 0 center = 1.25000 2.16506 1.50000 faceidx = 24 +DEAL::cell: +DEAL::boundary id = 3 center = -2.75000 1.11022e-15 2.00000 faceidx = 19 +DEAL::boundary id = 1 center = -3.00000 8.88178e-16 1.50000 faceidx = 18 +DEAL::boundary id = 0 center = -2.50000 8.88178e-16 1.50000 faceidx = 25 +DEAL::cell: +DEAL::boundary id = 3 center = 1.37500 -2.38157 2.00000 faceidx = 22 +DEAL::boundary id = 1 center = 1.50000 -2.59808 1.50000 faceidx = 21 +DEAL::boundary id = 0 center = 1.25000 -2.16506 1.50000 faceidx = 26 -- 2.39.5