@@ -537,7 +537,7 @@ MeshTools::find_block_boundary_nodes(const MeshBase & mesh)
537
537
// mark them as true in on_boundary.
538
538
for (const auto & elem : mesh .active_element_ptr_range ())
539
539
for (auto s : elem -> side_index_range ())
540
- if (elem -> neighbor_ptr (s ) && ( elem -> neighbor_ptr (s )-> subdomain_id () != elem -> subdomain_id () ))
540
+ if (elem -> neighbor_ptr (s ) && elem -> neighbor_ptr (s )-> subdomain_id () > elem -> subdomain_id ())
541
541
{
542
542
auto nodes_on_side = elem -> nodes_on_side (s );
543
543
@@ -549,6 +549,31 @@ MeshTools::find_block_boundary_nodes(const MeshBase & mesh)
549
549
}
550
550
551
551
552
+ std ::multimap < dof_id_type , std ::pair < subdomain_id_type , subdomain_id_type >>
553
+ MeshTools ::build_block_boundary_node_map (const MeshBase & mesh )
554
+ {
555
+ std ::multimap < dof_id_type , std ::pair < subdomain_id_type , subdomain_id_type >> block_boundary_node_map ;
556
+
557
+ // Loop over elements, find those on boundary, and
558
+ // mark them as true in on_boundary.
559
+ for (const auto & elem : mesh .active_element_ptr_range ())
560
+ {
561
+ const auto id1 = elem -> subdomain_id ();
562
+ for (auto s : elem -> side_index_range ())
563
+ {
564
+ const auto id2 = elem -> neighbor_ptr (s )-> subdomain_id ();
565
+ if (elem -> neighbor_ptr (s ) && id2 > id1 )
566
+ {
567
+ auto nodes_on_side = elem -> nodes_on_side (s );
568
+
569
+ for (auto & local_id : nodes_on_side )
570
+ block_boundary_node_map .emplace (elem -> node_ptr (local_id )-> id (), id1 , id2 );
571
+ }
572
+ }
573
+
574
+ return block_boundary_node_map ;
575
+ }
576
+
552
577
553
578
libMesh ::BoundingBox
554
579
MeshTools ::create_bounding_box (const MeshBase & mesh )
0 commit comments