Writing total unstructured mesh volume to statepoint as well.

This commit is contained in:
Patrick Shriwise 2019-05-31 11:33:44 -05:00
parent 645cc12737
commit 66346e8356

View file

@ -1890,11 +1890,15 @@ UnstructuredMesh::to_hdf5(hid_t group) const
hid_t mesh_group = create_group(group, "mesh " + std::to_string(id_));
write_dataset(mesh_group, "type", "unstructured");
// write volume of each tet
std::vector<double> tet_vols;
for (const auto& eh : ehs_) {
tet_vols.emplace_back(tet_volume(eh));
}
write_dataset(mesh_group, "volumes", tet_vols);
// and the total volume of the mesh
auto total_vol = std::accumulate(tet_vols.begin(), tet_vols.end(), 0.0);
write_dataset(mesh_group, "total_volume", total_vol);
close_group(mesh_group);
}