mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Writing total unstructured mesh volume to statepoint as well.
This commit is contained in:
parent
645cc12737
commit
66346e8356
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue