From: David K. <dav...@ak...> - 2018-01-10 20:10:07
|
On Wed, Jan 10, 2018 at 3:07 PM, John Peterson <jwp...@gm...> wrote: > > > On Wed, Jan 10, 2018 at 12:38 PM, David Knezevic < > dav...@ak...> wrote: > >> I'd like to use unique_ids to identify elements and nodes without worrying >> about renumbering, but before I do that I'd like to understand a bit more >> about how unique_ids are defined. >> >> In particular, what is the idea behind how we generate the unique_ids? >> From >> the code in replicated_mesh.C, for example, it looks like the unique_ids >> are set in add_node and add_elem, with _next_unique_id being incremented >> each time a new ID is set. This looks simple enough, but I was wondering >> if >> there's anything else to it? >> > > That's pretty much all there is to it, at least as far as I know. > > > One concrete question I have is if I create two Mesh objects by reading in >> the same mesh exodus file twice, will those two meshes have matching >> unique_ids? I guess they will simply because "add_node" and "add_elem" >> will >> be called in the same order during those two read operations. >> > > Yes, the unique ids are only unique per mesh, as the _next_unique_id is > owned by MeshBase. > > I can't see why two meshes created in exactly the same way wouldn't have > the exact same unique ids for all nodes and elems. > OK, thanks! David |