mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Add openmc_mesh_get_volumes C API function (#2869)
This commit is contained in:
parent
f14fc55e60
commit
bf33a9e11b
5 changed files with 54 additions and 2 deletions
11
src/mesh.cpp
11
src/mesh.cpp
|
|
@ -1881,6 +1881,17 @@ extern "C" int openmc_mesh_get_n_elements(int32_t index, size_t* n)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//! Get the volume of each element in the mesh
|
||||
extern "C" int openmc_mesh_get_volumes(int32_t index, double* volumes)
|
||||
{
|
||||
if (int err = check_mesh(index))
|
||||
return err;
|
||||
for (int i = 0; i < model::meshes[index]->n_bins(); ++i) {
|
||||
volumes[i] = model::meshes[index]->volume(i);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int openmc_mesh_material_volumes(int32_t index, int n_sample,
|
||||
int bin, int result_size, void* result, int* hits, uint64_t* seed)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue