@@ -89,7 +89,7 @@ Packing<const Elem *>::packed_size (std::vector<largest_id_type>::const_iterator
8989 DofObject ::unpackable_indexing_size (in + pre_indexing_size );
9090
9191 unsigned int total_packed_bc_data = 0 ;
92- if (level == 0 )
92+ // if (level == 0)
9393 {
9494 for (unsigned int s = 0 ; s != n_sides ; ++ s )
9595 {
@@ -100,23 +100,26 @@ Packing<const Elem *>::packed_size (std::vector<largest_id_type>::const_iterator
100100 total_packed_bc_data += n_bcs ;
101101 }
102102
103- for (unsigned int e = 0 ; e != n_edges ; ++ e )
104- {
105- const int n_bcs = cast_int < int >
106- (* (in + pre_indexing_size + indexing_size +
107- total_packed_bc_data ++ ));
108- libmesh_assert_greater_equal (n_bcs , 0 );
109- total_packed_bc_data += n_bcs ;
110- }
103+ if (level == 0 )
104+ {
105+ for (unsigned int e = 0 ; e != n_edges ; ++ e )
106+ {
107+ const int n_bcs = cast_int < int >
108+ (* (in + pre_indexing_size + indexing_size +
109+ total_packed_bc_data ++ ));
110+ libmesh_assert_greater_equal (n_bcs , 0 );
111+ total_packed_bc_data += n_bcs ;
112+ }
111113
112- for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
113- {
114- const int n_bcs = cast_int < int >
115- (* (in + pre_indexing_size + indexing_size +
116- total_packed_bc_data ++ ));
117- libmesh_assert_greater_equal (n_bcs , 0 );
118- total_packed_bc_data += n_bcs ;
119- }
114+ for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
115+ {
116+ const int n_bcs = cast_int < int >
117+ (* (in + pre_indexing_size + indexing_size +
118+ total_packed_bc_data ++ ));
119+ libmesh_assert_greater_equal (n_bcs , 0 );
120+ total_packed_bc_data += n_bcs ;
121+ }
122+ }
120123 }
121124
122125 return
@@ -145,23 +148,26 @@ Packing<const Elem *>::packable_size (const Elem * const & elem,
145148 unsigned int total_packed_bcs = 0 ;
146149 const unsigned short n_sides = elem -> n_sides ();
147150
148- if (elem -> level () == 0 )
151+ // if (elem->level() == 0)
149152 {
150153 total_packed_bcs += n_sides ;
151154 for (unsigned short s = 0 ; s != n_sides ; ++ s )
152155 total_packed_bcs +=
153- mesh -> get_boundary_info ().n_boundary_ids (elem ,s );
154-
155- const unsigned short n_edges = elem -> n_edges ();
156- total_packed_bcs += n_edges ;
157- for (unsigned short e = 0 ; e != n_edges ; ++ e )
158- total_packed_bcs +=
159- mesh -> get_boundary_info ().n_edge_boundary_ids (elem ,e );
156+ mesh -> get_boundary_info ().n_boundary_ids (elem ,s ,false);
160157
161- total_packed_bcs += 2 ; // shellfaces
162- for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
163- total_packed_bcs +=
164- mesh -> get_boundary_info ().n_shellface_boundary_ids (elem ,sf );
158+ if (elem -> level () == 0 )
159+ {
160+ const unsigned short n_edges = elem -> n_edges ();
161+ total_packed_bcs += n_edges ;
162+ for (unsigned short e = 0 ; e != n_edges ; ++ e )
163+ total_packed_bcs +=
164+ mesh -> get_boundary_info ().n_edge_boundary_ids (elem ,e );
165+
166+ total_packed_bcs += 2 ; // shellfaces
167+ for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
168+ total_packed_bcs +=
169+ mesh -> get_boundary_info ().n_shellface_boundary_ids (elem ,sf );
170+ }
165171 }
166172
167173 return
@@ -290,38 +296,40 @@ Packing<const Elem *>::pack (const Elem * const & elem,
290296
291297 // If this is a coarse element,
292298 // Add any element side boundary condition ids
293- if (elem -> level () == 0 )
299+ // if (elem->level() == 0)
294300 {
295301 std ::vector < boundary_id_type > bcs ;
296302 for (auto s : elem -> side_index_range ())
297303 {
298- mesh -> get_boundary_info ().boundary_ids (elem , s , bcs );
304+ mesh -> get_boundary_info ().boundary_ids (elem , s , bcs ,false );
299305
300306 * data_out ++ = (bcs .size ());
301307
302308 for (const auto & bid : bcs )
303309 * data_out ++ = bid ;
304310 }
311+ if (elem -> level () == 0 )
312+ {
313+ for (auto e : elem -> edge_index_range ())
314+ {
315+ mesh -> get_boundary_info ().edge_boundary_ids (elem , e , bcs );
305316
306- for (auto e : elem -> edge_index_range ())
307- {
308- mesh -> get_boundary_info ().edge_boundary_ids (elem , e , bcs );
309-
310- * data_out ++ = (bcs .size ());
317+ * data_out ++ = (bcs .size ());
311318
312- for (const auto & bid : bcs )
313- * data_out ++ = bid ;
314- }
319+ for (const auto & bid : bcs )
320+ * data_out ++ = bid ;
321+ }
315322
316- for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
317- {
318- mesh -> get_boundary_info ().shellface_boundary_ids (elem , sf , bcs );
323+ for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
324+ {
325+ mesh -> get_boundary_info ().shellface_boundary_ids (elem , sf , bcs );
319326
320- * data_out ++ = (bcs .size ());
327+ * data_out ++ = (bcs .size ());
321328
322- for (const auto & bid : bcs )
323- * data_out ++ = bid ;
324- }
329+ for (const auto & bid : bcs )
330+ * data_out ++ = bid ;
331+ }
332+ }
325333 }
326334}
327335
@@ -776,7 +784,7 @@ Packing<Elem *>::unpack (std::vector<largest_id_type>::const_iterator in,
776784
777785 // If this is a coarse element,
778786 // add any element side or edge boundary condition ids
779- if (level == 0 )
787+ // if (level == 0)
780788 {
781789 for (auto s : elem -> side_index_range ())
782790 {
@@ -788,25 +796,28 @@ Packing<Elem *>::unpack (std::vector<largest_id_type>::const_iterator in,
788796 (elem , s , cast_int < boundary_id_type > (* in ++ ));
789797 }
790798
791- for (auto e : elem -> edge_index_range ())
792- {
793- const boundary_id_type num_bcs =
794- cast_int < boundary_id_type > (* in ++ );
799+ if (level == 0 )
800+ {
801+ for (auto e : elem -> edge_index_range ())
802+ {
803+ const boundary_id_type num_bcs =
804+ cast_int < boundary_id_type > (* in ++ );
795805
796- for (boundary_id_type bc_it = 0 ; bc_it < num_bcs ; bc_it ++ )
797- mesh -> get_boundary_info ().add_edge
798- (elem , e , cast_int < boundary_id_type > (* in ++ ));
799- }
806+ for (boundary_id_type bc_it = 0 ; bc_it < num_bcs ; bc_it ++ )
807+ mesh -> get_boundary_info ().add_edge
808+ (elem , e , cast_int < boundary_id_type > (* in ++ ));
809+ }
800810
801- for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
802- {
803- const boundary_id_type num_bcs =
804- cast_int < boundary_id_type > (* in ++ );
811+ for (unsigned short sf = 0 ; sf != 2 ; ++ sf )
812+ {
813+ const boundary_id_type num_bcs =
814+ cast_int < boundary_id_type > (* in ++ );
805815
806- for (boundary_id_type bc_it = 0 ; bc_it < num_bcs ; bc_it ++ )
807- mesh -> get_boundary_info ().add_shellface
808- (elem , sf , cast_int < boundary_id_type > (* in ++ ));
809- }
816+ for (boundary_id_type bc_it = 0 ; bc_it < num_bcs ; bc_it ++ )
817+ mesh -> get_boundary_info ().add_shellface
818+ (elem , sf , cast_int < boundary_id_type > (* in ++ ));
819+ }
820+ }
810821 }
811822
812823 // Return the new element
0 commit comments