Skip to content

Commit 6c21f43

Browse files
committed
Ensure global ID is read as a long long, assumed to line up with global ordinal type. static assert set to ensure this
1 parent 5d32927 commit 6c21f43

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mesh/triangulation.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,9 @@ void triangulation::load_mesh_from_h5(const std::string& mesh_filename)
837837
hsize_t nelem;
838838
int ndims = dataspace.getSimpleExtentDims(&nelem, NULL);
839839
_global_IDs.resize(nelem);
840-
dataset.read(_global_IDs.data(), PredType::NATIVE_INT);
840+
static_assert(std::is_same<global_ordinal_type, long long>::value,
841+
"Assumption is that global_ordinal_type (from trillions) must be typedef'd to long long");
842+
dataset.read(_global_IDs.data(), PredType::NATIVE_LLONG);
841843
}
842844

843845
std::vector<int> owner; //what MPIrank owns each triangle,
@@ -1593,8 +1595,8 @@ void triangulation::partition_mesh_nonMPI(global_ordinal_type _num_global_faces)
15931595
{
15941596
_global_IDs[i] = i;
15951597
_faces.at(i)->is_ghost = false;
1596-
_faces.at(i)->cell_local_id =
1597-
i; // Mesh has been (potentially) reordered before this point. Set the local_id correctly
1598+
// Mesh has been (potentially) reordered before this point. Set the local_id correctly
1599+
_faces.at(i)->cell_local_id = i;
15981600
}
15991601

16001602
// make sure these setup when in MPI mode for partition

0 commit comments

Comments
 (0)