Skip to content

Commit 0b91772

Browse files
committed
Remove boundary deletion upon child boundary transfer.
1 parent 6f1ae70 commit 0b91772

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/mesh/boundary_info.C

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,12 +1890,8 @@ BoundaryInfo::transfer_boundary_ids_from_children(const Elem * const parent)
18901890
// This is where the decision is made. If 50% of the children have the tags,
18911891
// we propagate them upwards upon coarsening. Otherwise, they are deleted.
18921892
for (const auto & boundary : boundary_counts)
1893-
{
18941893
if (boundary.second / number_of_sides_on_children > 0.5)
18951894
this->add_side(parent, side_i, boundary.first);
1896-
else
1897-
this->remove_side(parent, side_i, boundary.first);
1898-
}
18991895
}
19001896

19011897
for (const auto & child_i : make_range(parent->n_children()))

src/mesh/mesh_refinement.C

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,9 +1370,8 @@ bool MeshRefinement::_coarsen_elements ()
13701370

13711371
for (auto & elem : _mesh.element_ptr_range())
13721372
{
1373-
// Make sure we transfer the element's boundary id(s)
1373+
// Make sure we transfer the children's boundary id(s)
13741374
// up to its parent when necessary before coarsening.
1375-
// This can be adding or removing the corresonding boundary info.
13761375
_mesh.get_boundary_info().transfer_boundary_ids_from_children(elem);
13771376

13781377
// active elements flagged for coarsening will
@@ -1388,11 +1387,11 @@ bool MeshRefinement::_coarsen_elements ()
13881387
elem->nullify_neighbors();
13891388

13901389
// Remove any boundary information associated
1391-
// with this element if we do not allow children to have boundary info
1392-
// otherwise we will have trouble in boundary info consistency among
1393-
// parent and children elements
1394-
// if (!_mesh.get_boundary_info().is_children_on_boundary_side())
1395-
_mesh.get_boundary_info().remove (elem);
1390+
// with this element if we do not allow children to have boundary info.
1391+
// Otherwise, we will do the removal in `transfer_boundary_ids_from_children`
1392+
// to make sure we don't delete the information before it is transferred
1393+
if (!_mesh.get_boundary_info().is_children_on_boundary_side())
1394+
_mesh.get_boundary_info().remove (elem);
13961395

13971396
// Add this iterator to the _unused_elements
13981397
// data structure so we might fill it.

tests/mesh/boundary_info.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ public:
560560
if (c(0) < 1)
561561
{
562562
CPPUNIT_ASSERT(bi.has_boundary_id(elem, 1, 5));
563+
// We clean up this boundary ID for the next round of tests
564+
bi.remove_side(elem, 1, 5);
563565
// we will refine this element again
564566
elem->set_refinement_flag(Elem::REFINE);
565567
}

0 commit comments

Comments
 (0)