@@ -1268,21 +1268,22 @@ void BoundaryInfo::boundary_ids (const Elem * const elem,
1268
1268
vec_to_fill .end ())
1269
1269
vec_to_fill .push_back (pr .second .second );
1270
1270
1271
+ // Loop over ancestors to check if they have boundary ids on the same side
1271
1272
while (searched_elem -> parent () != nullptr)
1272
1273
{
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 );
1286
1287
}
1287
1288
1288
1289
return ;
@@ -1296,11 +1297,11 @@ void BoundaryInfo::boundary_ids (const Elem * const elem,
1296
1297
else
1297
1298
while (searched_elem -> parent () != nullptr )
1298
1299
{
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 ;
1302
1303
1303
- searched_elem = parent ;
1304
+ searched_elem = parent ;
1304
1305
}
1305
1306
}
1306
1307
@@ -1324,6 +1325,15 @@ unsigned int BoundaryInfo::n_boundary_ids (const Elem * const elem,
1324
1325
}
1325
1326
1326
1327
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
+
1327
1337
1328
1338
void BoundaryInfo ::raw_boundary_ids (const Elem * const elem ,
1329
1339
const unsigned short int side ,
@@ -1499,9 +1509,6 @@ void BoundaryInfo::remove_side (const Elem * elem,
1499
1509
{
1500
1510
libmesh_assert (elem );
1501
1511
1502
- // Only level 0 elements unless the flag "_children_on_boundary" is on.
1503
- libmesh_assert (elem -> level () == 0 || _children_on_boundary );
1504
-
1505
1512
// Erase (elem, side, id) entries from map.
1506
1513
erase_if (_boundary_side_id , elem ,
1507
1514
[side , id ](decltype (_boundary_side_id )::mapped_type & pr )
@@ -1661,7 +1668,7 @@ unsigned int BoundaryInfo::side_with_boundary_id(const Elem * const elem,
1661
1668
p = parent ;
1662
1669
}
1663
1670
#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
1665
1672
if (!p )
1666
1673
return side ;
1667
1674
}
@@ -1719,7 +1726,7 @@ BoundaryInfo::sides_with_boundary_id(const Elem * const elem,
1719
1726
1720
1727
const Elem * searched_elem = elem ;
1721
1728
if (elem -> level () != 0 && !_children_on_boundary )
1722
- searched_elem = elem -> top_parent ();
1729
+ searched_elem = elem -> top_parent ();
1723
1730
1724
1731
// elem may have zero or multiple occurrences
1725
1732
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,
1737
1744
// If we're on this external boundary then we share this
1738
1745
// external boundary id
1739
1746
if (elem -> neighbor_ptr (side ) == nullptr )
1740
- {
1741
- returnval .push_back (side );
1742
- continue ;
1743
- }
1747
+ {
1748
+ returnval .push_back (side );
1749
+ continue ;
1750
+ }
1744
1751
1745
1752
// If we're on an internal boundary then we need to be sure
1746
1753
// it's the same internal boundary as our top_parent
@@ -2069,7 +2076,6 @@ BoundaryInfo::build_node_list_from_side_list()
2069
2076
// Need to loop over the sides of any possible children
2070
2077
std ::vector < const Elem * > family ;
2071
2078
#ifdef LIBMESH_ENABLE_AMR
2072
- // if (!elem->subactive())
2073
2079
elem -> active_family_tree_by_side (family , id_pair .first );
2074
2080
#else
2075
2081
family .push_back (elem );
@@ -2432,8 +2438,7 @@ BoundaryInfo::build_active_side_list () const
2432
2438
// Loop over the sides of possible children
2433
2439
std ::vector < const Elem * > family ;
2434
2440
#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 );
2437
2442
#else
2438
2443
family .push_back (elem );
2439
2444
#endif
0 commit comments