mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Setting id appropriately for new unstructured mesh.
This commit is contained in:
parent
9695cc2771
commit
4d607e52b8
1 changed files with 6 additions and 1 deletions
|
|
@ -1310,7 +1310,12 @@ extern "C" int openmc_add_unstrucutred_mesh(const char filename[],
|
|||
return OPENMC_E_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
*mesh_id = model::meshes.back()->id_;
|
||||
int id = 0;
|
||||
for (const auto& m : model::meshes) { id = std::max(m->id_, id); }
|
||||
|
||||
id += 1;
|
||||
model::meshes.back()->id_ = id;
|
||||
*mesh_id = id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue