From f627b537beef62e77405f5414d0eeb7c838c389e Mon Sep 17 00:00:00 2001 From: Fande Kong Date: Thu, 24 Feb 2022 14:41:38 -0700 Subject: [PATCH] Made BoundaryInfo::boundary_ids for _children_on_boundary --- src/mesh/boundary_info.C | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mesh/boundary_info.C b/src/mesh/boundary_info.C index ff9122c0cae..112fd711866 100644 --- a/src/mesh/boundary_info.C +++ b/src/mesh/boundary_info.C @@ -1235,9 +1235,16 @@ void BoundaryInfo::boundary_ids (const Elem * const elem, // Clear out any previous contents vec_to_fill.clear(); - // Only level-0 elements store BCs. If this is not a level-0 - // element get its level-0 parent and infer the BCs. - const Elem * searched_elem = elem; + // Search BC on the current element. If we find anything, we should return + for (const auto & pr : as_range(_boundary_side_id.equal_range(elem))) + if (pr.second.first == side) + vec_to_fill.push_back(pr.second.second); + + if (vec_to_fill.size()) + return; + + // We check the top parent now + const Elem * searched_elem = nullptr; if (elem->level() != 0) { if (elem->neighbor_ptr(side) == nullptr) @@ -1283,7 +1290,7 @@ void BoundaryInfo::raw_boundary_ids (const Elem * const elem, vec_to_fill.clear(); // Only level-0 elements store BCs. - if (elem->parent()) + if (elem->parent() && !_children_on_boundary) return; // Check each element in the range to see if its side matches the requested side.