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