@@ -175,14 +175,13 @@ void GmshIO::read_mesh(std::istream & in)
175
175
// actually blocks of lower-dimensional elements.
176
176
std ::set < subdomain_id_type > lower_dimensional_blocks ;
177
177
178
- // Mapping from physical id -> ( physical dim, physical name) pairs .
178
+ // Mapping from ( physical id, physical dim) -> physical name.
179
179
// These can refer to either "sidesets" or "subdomains"; we need to
180
180
// wait until the Mesh has been read to know which is which. Note
181
- // that we are using 'int' as the key here rather than
181
+ // that we are using ptrdiff_t as the key here rather than
182
182
// subdomain_id_type or boundary_id_type, since at this point, it
183
183
// could be either.
184
- typedef std ::pair < unsigned , std ::string > GmshPhysical ;
185
- std ::map < int , GmshPhysical > gmsh_physicals ;
184
+ std ::map < std ::pair < std ::ptrdiff_t , unsigned > , std ::string > gmsh_physicals ;
186
185
187
186
// map to hold the node numbers for translation
188
187
// note the the nodes can be non-consecutive
@@ -267,7 +266,7 @@ void GmshIO::read_mesh(std::istream & in)
267
266
phys_name .erase (std ::remove (phys_name .begin (), phys_name .end (), '"' ), phys_name .end ());
268
267
269
268
// Record this ID for later assignment of subdomain/sideset names.
270
- gmsh_physicals [phys_id ] = std ::make_pair (phys_dim , phys_name ) ;
269
+ gmsh_physicals [std ::make_pair (phys_id , phys_dim )] = phys_name ;
271
270
272
271
// If 's' also contains the libmesh-specific string
273
272
// "lower_dimensional_block", add this block ID to
@@ -790,9 +789,8 @@ void GmshIO::read_mesh(std::istream & in)
790
789
for (const auto & pr : gmsh_physicals )
791
790
{
792
791
// Extract data
793
- int phys_id = pr .first ;
794
- unsigned phys_dim = pr .second .first ;
795
- const std ::string & phys_name = pr .second .second ;
792
+ auto [phys_id , phys_dim ] = pr .first ;
793
+ const std ::string & phys_name = pr .second ;
796
794
797
795
// If the physical's dimension matches the largest
798
796
// dimension we've seen, it's a subdomain name.
0 commit comments