@@ -1237,29 +1237,38 @@ void BoundaryInfo::boundary_ids (const Elem * const elem,
1237
1237
// Clear out any previous contents
1238
1238
vec_to_fill .clear ();
1239
1239
1240
- // Only level-0 elements store BCs. If this is not a level-0
1241
- // element get its level-0 parent and infer the BCs.
1242
- const Elem * searched_elem = elem ;
1240
+ // Only level-0 elements store BCs if _children_on_boundary is off
1241
+ // We want to check current element if _children_on_boundary is on
1242
+ std ::vector < const Elem * > searched_elems ;
1243
+ if (_children_on_boundary || elem -> level () == 0 )
1244
+ searched_elems .push_back (elem );
1245
+
1243
1246
if (elem -> level () != 0 )
1244
1247
{
1245
1248
if (elem -> neighbor_ptr (side ) == nullptr )
1246
- searched_elem = elem -> top_parent ( );
1249
+ searched_elems . push_back ( elem -> top_parent () );
1247
1250
#ifdef LIBMESH_ENABLE_AMR
1248
1251
else
1252
+ {
1253
+ const Elem * searched_elem = elem ;
1249
1254
while (searched_elem -> parent () != nullptr )
1250
1255
{
1251
1256
const Elem * parent = searched_elem -> parent ();
1252
- if (parent -> is_child_on_side (parent -> which_child_am_i (searched_elem ), side ) == false)
1257
+ if (parent -> is_child_on_side (parent -> which_child_am_i (searched_elem ), side ) == false && ! _children_on_boundary )
1253
1258
return ;
1254
1259
searched_elem = parent ;
1255
1260
}
1261
+ searched_elems .push_back (elem -> top_parent ());
1262
+ }
1256
1263
#endif
1257
1264
}
1258
1265
1266
+
1259
1267
// Check each element in the range to see if its side matches the requested side.
1260
- for (const auto & pr : as_range (_boundary_side_id .equal_range (searched_elem )))
1261
- if (pr .second .first == side )
1262
- vec_to_fill .push_back (pr .second .second );
1268
+ for (auto searched_elem : searched_elems )
1269
+ for (const auto & pr : as_range (_boundary_side_id .equal_range (searched_elem )))
1270
+ if (pr .second .first == side )
1271
+ vec_to_fill .push_back (pr .second .second );
1263
1272
}
1264
1273
1265
1274
@@ -1285,7 +1294,7 @@ void BoundaryInfo::raw_boundary_ids (const Elem * const elem,
1285
1294
vec_to_fill .clear ();
1286
1295
1287
1296
// Only level-0 elements store BCs.
1288
- if (elem -> parent ())
1297
+ if (elem -> parent () && ! _children_on_boundary )
1289
1298
return ;
1290
1299
1291
1300
// Check each element in the range to see if its side matches the requested side.
0 commit comments