From c58c2adb42081a48e0a8455416b54fc245521ded Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Fri, 19 Sep 2003 12:19:51 +0000 Subject: [PATCH] fix boundary numbers on 3D cylinder git-svn-id: https://svn.dealii.org/trunk@7988 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_generator.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index a7abb7b069..46b35159f3 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -1146,10 +1146,16 @@ GridGenerator::cylinder (Triangulation<3> &tria, while (cell != end) { - if (cell->face(0)->boundary_indicator() != 255) - cell->face(0)->set_boundary_indicator(1); - if (cell->face(1)->boundary_indicator() != 255) - cell->face(1)->set_boundary_indicator(2); + for (unsigned int i=0;i::faces_per_cell;++i) + { + if (cell->face(i)->boundary_indicator() == 255) + continue; + + if (cell->face(i)->center()(0) > 1.-1.e-5) + cell->face(i)->set_boundary_indicator(2); + else if (cell->face(i)->center()(0) < -1.+1.e-5) + cell->face(i)->set_boundary_indicator(1); + } ++cell; } } -- 2.39.5