@@ -1268,21 +1268,22 @@ void BoundaryInfo::boundary_ids (const Elem * const elem,
12681268 vec_to_fill .end ())
12691269 vec_to_fill .push_back (pr .second .second );
12701270
1271+ // Loop over ancestors to check if they have boundary ids on the same side
12711272 while (searched_elem -> parent () != nullptr)
12721273 {
1273- const Elem * parent = searched_elem -> parent ();
1274- if (parent -> is_child_on_side (parent -> which_child_am_i (searched_elem ), side ) == false)
1275- return ;
1276-
1277- searched_elem = parent ;
1278-
1279- if (_children_on_boundary )
1280- for (const auto & pr : as_range (_boundary_side_id .equal_range (searched_elem )))
1281- // Here we need to check if the boundary id already exists
1282- if (pr .second .first == side &&
1283- std ::find (vec_to_fill .begin (), vec_to_fill .end (), pr .second .second ) ==
1284- vec_to_fill .end ())
1285- vec_to_fill .push_back (pr .second .second );
1274+ const Elem * parent = searched_elem -> parent ();
1275+ if (parent -> is_child_on_side (parent -> which_child_am_i (searched_elem ), side ) == false)
1276+ return ;
1277+
1278+ searched_elem = parent ;
1279+
1280+ if (_children_on_boundary )
1281+ for (const auto & pr : as_range (_boundary_side_id .equal_range (searched_elem )))
1282+ // Here we need to check if the boundary id already exists
1283+ if (pr .second .first == side &&
1284+ std ::find (vec_to_fill .begin (), vec_to_fill .end (), pr .second .second ) ==
1285+ vec_to_fill .end ())
1286+ vec_to_fill .push_back (pr .second .second );
12861287 }
12871288
12881289 return ;
@@ -1296,11 +1297,11 @@ void BoundaryInfo::boundary_ids (const Elem * const elem,
12961297 else
12971298 while (searched_elem -> parent () != nullptr )
12981299 {
1299- const Elem * parent = searched_elem -> parent ();
1300- if (parent -> is_child_on_side (parent -> which_child_am_i (searched_elem ), side ) == false)
1301- return ;
1300+ const Elem * parent = searched_elem -> parent ();
1301+ if (parent -> is_child_on_side (parent -> which_child_am_i (searched_elem ), side ) == false)
1302+ return ;
13021303
1303- searched_elem = parent ;
1304+ searched_elem = parent ;
13041305 }
13051306 }
13061307
@@ -1324,6 +1325,15 @@ unsigned int BoundaryInfo::n_boundary_ids (const Elem * const elem,
13241325}
13251326
13261327
1328+ unsigned int BoundaryInfo ::n_raw_boundary_ids (const Elem * const elem ,
1329+ const unsigned short int side ) const
1330+ {
1331+ std ::vector < boundary_id_type > ids ;
1332+ this -> raw_boundary_ids (elem , side , ids );
1333+ return cast_int < unsigned int > (ids .size ());
1334+ }
1335+
1336+
13271337
13281338void BoundaryInfo ::raw_boundary_ids (const Elem * const elem ,
13291339 const unsigned short int side ,
@@ -1499,9 +1509,6 @@ void BoundaryInfo::remove_side (const Elem * elem,
14991509{
15001510 libmesh_assert (elem );
15011511
1502- // Only level 0 elements unless the flag "_children_on_boundary" is on.
1503- libmesh_assert (elem -> level () == 0 || _children_on_boundary );
1504-
15051512 // Erase (elem, side, id) entries from map.
15061513 erase_if (_boundary_side_id , elem ,
15071514 [side , id ](decltype (_boundary_side_id )::mapped_type & pr )
@@ -1661,7 +1668,7 @@ unsigned int BoundaryInfo::side_with_boundary_id(const Elem * const elem,
16611668 p = parent ;
16621669 }
16631670#endif
1664- // We're on that side of our top_parent; return it
1671+ // We're on that side of our top_parent; return it
16651672 if (!p )
16661673 return side ;
16671674 }
@@ -1719,7 +1726,7 @@ BoundaryInfo::sides_with_boundary_id(const Elem * const elem,
17191726
17201727 const Elem * searched_elem = elem ;
17211728 if (elem -> level () != 0 && !_children_on_boundary )
1722- searched_elem = elem -> top_parent ();
1729+ searched_elem = elem -> top_parent ();
17231730
17241731 // elem may have zero or multiple occurrences
17251732 for (const auto & pr : as_range (_boundary_side_id .equal_range (searched_elem )))
@@ -1737,10 +1744,10 @@ BoundaryInfo::sides_with_boundary_id(const Elem * const elem,
17371744 // If we're on this external boundary then we share this
17381745 // external boundary id
17391746 if (elem -> neighbor_ptr (side ) == nullptr )
1740- {
1741- returnval .push_back (side );
1742- continue ;
1743- }
1747+ {
1748+ returnval .push_back (side );
1749+ continue ;
1750+ }
17441751
17451752 // If we're on an internal boundary then we need to be sure
17461753 // it's the same internal boundary as our top_parent
@@ -2069,7 +2076,6 @@ BoundaryInfo::build_node_list_from_side_list()
20692076 // Need to loop over the sides of any possible children
20702077 std ::vector < const Elem * > family ;
20712078#ifdef LIBMESH_ENABLE_AMR
2072- // if (!elem->subactive())
20732079 elem -> active_family_tree_by_side (family , id_pair .first );
20742080#else
20752081 family .push_back (elem );
@@ -2432,8 +2438,7 @@ BoundaryInfo::build_active_side_list () const
24322438 // Loop over the sides of possible children
24332439 std ::vector < const Elem * > family ;
24342440#ifdef LIBMESH_ENABLE_AMR
2435- // if (!elem->subactive())
2436- elem -> active_family_tree_by_side (family , id_pair .first );
2441+ elem -> active_family_tree_by_side (family , id_pair .first );
24372442#else
24382443 family .push_back (elem );
24392444#endif
0 commit comments