@@ -89,7 +89,7 @@ Packing<const Elem *>::packed_size (std::vector<largest_id_type>::const_iterator
89
89
DofObject ::unpackable_indexing_size (in + pre_indexing_size );
90
90
91
91
unsigned int total_packed_bc_data = 0 ;
92
- if (level == 0 )
92
+ // if (level == 0)
93
93
{
94
94
for (unsigned int s = 0 ; s != n_sides ; ++ s )
95
95
{
@@ -100,23 +100,26 @@ Packing<const Elem *>::packed_size (std::vector<largest_id_type>::const_iterator
100
100
total_packed_bc_data += n_bcs ;
101
101
}
102
102
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
+ }
111
113
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
+ }
120
123
}
121
124
122
125
return
@@ -145,23 +148,26 @@ Packing<const Elem *>::packable_size (const Elem * const & elem,
145
148
unsigned int total_packed_bcs = 0 ;
146
149
const unsigned short n_sides = elem -> n_sides ();
147
150
148
- if (elem -> level () == 0 )
151
+ // if (elem->level() == 0)
149
152
{
150
153
total_packed_bcs += n_sides ;
151
154
for (unsigned short s = 0 ; s != n_sides ; ++ s )
152
155
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);
160
157
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
+ }
165
171
}
166
172
167
173
return
@@ -290,38 +296,40 @@ Packing<const Elem *>::pack (const Elem * const & elem,
290
296
291
297
// If this is a coarse element,
292
298
// Add any element side boundary condition ids
293
- if (elem -> level () == 0 )
299
+ // if (elem->level() == 0)
294
300
{
295
301
std ::vector < boundary_id_type > bcs ;
296
302
for (auto s : elem -> side_index_range ())
297
303
{
298
- mesh -> get_boundary_info ().boundary_ids (elem , s , bcs );
304
+ mesh -> get_boundary_info ().boundary_ids (elem , s , bcs ,false );
299
305
300
306
* data_out ++ = (bcs .size ());
301
307
302
308
for (const auto & bid : bcs )
303
309
* data_out ++ = bid ;
304
310
}
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 );
305
316
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 ());
311
318
312
- for (const auto & bid : bcs )
313
- * data_out ++ = bid ;
314
- }
319
+ for (const auto & bid : bcs )
320
+ * data_out ++ = bid ;
321
+ }
315
322
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 );
319
326
320
- * data_out ++ = (bcs .size ());
327
+ * data_out ++ = (bcs .size ());
321
328
322
- for (const auto & bid : bcs )
323
- * data_out ++ = bid ;
324
- }
329
+ for (const auto & bid : bcs )
330
+ * data_out ++ = bid ;
331
+ }
332
+ }
325
333
}
326
334
}
327
335
@@ -776,7 +784,7 @@ Packing<Elem *>::unpack (std::vector<largest_id_type>::const_iterator in,
776
784
777
785
// If this is a coarse element,
778
786
// add any element side or edge boundary condition ids
779
- if (level == 0 )
787
+ // if (level == 0)
780
788
{
781
789
for (auto s : elem -> side_index_range ())
782
790
{
@@ -788,25 +796,28 @@ Packing<Elem *>::unpack (std::vector<largest_id_type>::const_iterator in,
788
796
(elem , s , cast_int < boundary_id_type > (* in ++ ));
789
797
}
790
798
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 ++ );
795
805
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
+ }
800
810
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 ++ );
805
815
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
+ }
810
821
}
811
822
812
823
// Return the new element
0 commit comments