From: Peter Munch Date: Thu, 19 Aug 2021 06:49:05 +0000 (+0200) Subject: Remove special treatment of boundary cells X-Git-Tag: v9.4.0-rc1~1041^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cb82627cd00fb1795e51396057e9f58894ab45a;p=dealii.git Remove special treatment of boundary cells --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 2b8925bdcf..1b84026f27 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -3737,49 +3737,11 @@ namespace internal new_vertices[8] = next_unused_vertex; - // if this quad lives - // in 2d, then we can - // compute the new - // central vertex - // location just from - // the surrounding - // ones. If this is - // not the case, then - // we need to ask a - // boundary object - if (dim == spacedim) - { - // triangulation.vertices[next_unused_vertex] = new_point; - triangulation.vertices[next_unused_vertex] = cell->center(true); - - // if the user_flag is set, i.e. if the cell is at the - // boundary, use a different calculation of the middle vertex - // here. this is of advantage if the boundary is strongly - // curved (whereas the cell is not) and the cell has a high - // aspect ratio. - if (cell->user_flag_set()) - { - // first reset the user_flag and then refine - cell->clear_user_flag(); - triangulation.vertices[next_unused_vertex] = - cell->center(true, true); - } - } - else - { - // if this quad lives in a higher dimensional space - // then we don't need to worry if it is at the - // boundary of the manifold -- we always have to use - // the boundary object anyway; so ignore whether the - // user flag is set or not - cell->clear_user_flag(); - - // determine middle vertex by transfinite interpolation to be - // consistent with what happens to quads in a Triangulation<3, - // 3> when they are refined - triangulation.vertices[next_unused_vertex] = - cell->center(true, true); - } + // determine middle vertex by transfinite interpolation to be + // consistent with what happens to quads in a + // Triangulation<3,3> when they are refined + triangulation.vertices[next_unused_vertex] = + cell->center(true, true); } @@ -4238,25 +4200,8 @@ namespace internal new_vertices[8] = next_unused_vertex; - if (dim == spacedim) - { - triangulation.vertices[next_unused_vertex] = - cell->center(true); - - if (cell->user_flag_set()) - { - cell->clear_user_flag(); - triangulation.vertices[next_unused_vertex] = - cell->center(true, true); - } - } - else - { - cell->clear_user_flag(); - - triangulation.vertices[next_unused_vertex] = - cell->center(true, true); - } + triangulation.vertices[next_unused_vertex] = + cell->center(true, true); } std::array::raw_line_iterator, @@ -4512,9 +4457,6 @@ namespace internal triangulation.active_cell_iterators_on_level(level)) if (cell->refine_flag_set()) { - if (cell->at_boundary()) - cell->set_user_flag(); - create_children(triangulation, next_unused_vertex, next_unused_line, @@ -5060,15 +5002,6 @@ namespace internal triangulation.active_cell_iterators_on_level(level)) if (cell->refine_flag_set()) { - // set the user flag to indicate, that at least one - // line is at the boundary - - // TODO[Tobias Leicht] find a better place to set - // this flag, so that we do not need so much time to - // check each cell here - if (cell->at_boundary()) - cell->set_user_flag(); - // actually set up the children and update neighbor // information create_children(triangulation, diff --git a/tests/manifold/manifold_id_06.output b/tests/manifold/manifold_id_06.output index 0291bf67d3..5ae79a6795 100644 --- a/tests/manifold/manifold_id_06.output +++ b/tests/manifold/manifold_id_06.output @@ -118,13 +118,13 @@ $NOD 66 0.0815301 0.0815301 0 67 0.418470 0.0815301 0 68 0.0815301 0.418470 0 -69 0.405284 0.405284 0 +69 0.418470 0.418470 0 70 0.676265 0.119850 0 71 0.887944 0.125000 0 -72 0.666941 0.376287 0 +72 0.676265 0.380150 0 73 0.887944 0.375000 0 74 0.119850 0.676265 0 -75 0.376287 0.666941 0 +75 0.380150 0.676265 0 76 0.125000 0.887944 0 77 0.375000 0.887944 0 78 0.625000 0.625000 0 diff --git a/tests/manifold/polar_manifold_02.output b/tests/manifold/polar_manifold_02.output index 56bdedde2a..ed26a6a3ca 100644 --- a/tests/manifold/polar_manifold_02.output +++ b/tests/manifold/polar_manifold_02.output @@ -72,24 +72,24 @@ $NOD 69 2.87590e-17 0.469670 0 70 -0.320837 -0.774570 0 71 0.320837 -0.774570 0 -72 -0.200084 -0.471182 0 -73 0.200084 -0.471182 0 +72 -0.208485 -0.456792 0 +73 0.208485 -0.456792 0 74 -0.774570 -0.320837 0 -75 -0.471182 -0.200084 0 +75 -0.456792 -0.208485 0 76 -0.774570 0.320837 0 -77 -0.471182 0.200084 0 +77 -0.456792 0.208485 0 78 -0.146447 -0.146447 0 79 0.146447 -0.146447 0 80 -0.146447 0.146447 0 81 0.146447 0.146447 0 82 0.774570 -0.320837 0 83 0.774570 0.320837 0 -84 0.471182 -0.200084 0 -85 0.471182 0.200084 0 +84 0.456792 -0.208485 0 +85 0.456792 0.208485 0 86 -0.320837 0.774570 0 -87 -0.200084 0.471182 0 +87 -0.208485 0.456792 0 88 0.320837 0.774570 0 -89 0.200084 0.471182 0 +89 0.208485 0.456792 0 $ENDNOD $ELM 80