From 66346e8356e766372eeed4e3c124620f1737ba2d Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 31 May 2019 11:33:44 -0500 Subject: [PATCH] Writing total unstructured mesh volume to statepoint as well. --- src/mesh.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesh.cpp b/src/mesh.cpp index 9d8cd67b5a..f039fa08c0 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -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 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); }