@@ -480,6 +480,13 @@ class BoundaryInfo : public ParallelObject
480480 unsigned int n_boundary_ids (const Elem * const elem,
481481 const unsigned short int side) const ;
482482
483+ /* *
484+ * \returns The number of raw (excludes ancestors) boundary ids associated with the \p side
485+ * side of element \p elem.
486+ */
487+ unsigned int n_raw_boundary_ids (const Elem * const elem,
488+ const unsigned short int side) const ;
489+
483490 /* *
484491 * \returns The list of boundary ids associated with the \p side side of
485492 * element \p elem.
@@ -550,6 +557,21 @@ class BoundaryInfo : public ParallelObject
550557 */
551558 void build_shellface_boundary_ids (std::vector<boundary_id_type> & b_ids) const ;
552559
560+ #ifdef LIBMESH_ENABLE_AMR
561+ /* *
562+ * Update parent's boundary id list so that this information is consistent with
563+ * its children
564+ *
565+ * This is useful when `_children_on_boundary = true`, and is used when the
566+ * element is about to get coarsened i.e., in MeshRefinement::_coarsen_elements()
567+ *
568+ * Specifically, when we coarsen an element whose children have different boundary ids.
569+ * In such scenarios, the parent will inherit the children's boundaries if at
570+ * least 50% them own a boundary while sharing the side of the parent.
571+ */
572+ void transfer_boundary_ids_from_children (const Elem * const parent);
573+ #endif
574+
553575 /* *
554576 * \returns The number of element-side-based boundary conditions.
555577 *
@@ -877,6 +899,18 @@ class BoundaryInfo : public ParallelObject
877899 const std::multimap<const Elem *, std::pair<unsigned short int , boundary_id_type>> & get_sideset_map () const
878900 { return _boundary_side_id; }
879901
902+ /* *
903+ * \returns Whether or not there may be child elements directly assigned boundary sides
904+ */
905+ bool is_children_on_boundary_side () const
906+ { return _children_on_boundary; }
907+
908+ /* *
909+ * Whether or not to allow directly setting boundary sides on child elements
910+ */
911+ void allow_children_on_boundary_side (const bool children_on_boundary)
912+ { _children_on_boundary = children_on_boundary; }
913+
880914private:
881915
882916 /* *
@@ -927,6 +961,13 @@ class BoundaryInfo : public ParallelObject
927961 std::pair<unsigned short int , boundary_id_type>>
928962 _boundary_side_id;
929963
964+ /*
965+ * Whether or not children elements are associated with any boundary
966+ * It is false by default. The flag will be turned on if `add_side`
967+ * function is called with a child element
968+ */
969+ bool _children_on_boundary;
970+
930971 /* *
931972 * A collection of user-specified boundary ids for sides, edges, nodes,
932973 * and shell faces.
0 commit comments