Skip to content

Comments

Index conversion#186

Merged
gonuke merged 16 commits intoxdg-org:mainfrom
pshriwise:index-conversion
Feb 5, 2026
Merged

Index conversion#186
gonuke merged 16 commits intoxdg-org:mainfrom
pshriwise:index-conversion

Conversation

@pshriwise
Copy link
Collaborator

This is a possible solution to #185.

libMesh will take more work than is shown here, but for all of the cases I've used so far the element ID space has been contiguous for replicated, unrefined meshes, so it should be effective for the time being.

This will keep us moving on the OpenMC integration front so we can reliably identify an element's index from an ID regardless of the backend, but tbh I'm not crazy about it so I'm marking it as a draft.

@pshriwise pshriwise marked this pull request as ready for review January 30, 2026 22:56
@pshriwise pshriwise requested review from Waqar-ukaea and gonuke and removed request for gonuke January 30, 2026 22:56
@pshriwise
Copy link
Collaborator Author

This got a little more involved than I'd bargained for, but in the end I'm alright with where it landed. I think this should be ready for a look when ppl have a chance.

Copy link
Collaborator

@Waqar-ukaea Waqar-ukaea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look pretty good to me. I just have some general comments mostly just for checking my own understanding of some of the new code before I am happy to approve.

Copy link
Collaborator

@Waqar-ukaea Waqar-ukaea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give @gonuke a chance to review, since he likely has more insight on the MOAB side of things. But otherwise, I am happy to merge.

Copy link
Collaborator

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for these little ticky-tack comments here, but I don't think I have time to fully review the actual meat of this PR.

{ return vertex_id_map_.index_to_id(vertex_idx); }

//! \brief Return the index of a vertex given its ID in the mesh
virtual int vertex_index(MeshID vertex) const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this return size_t to be consistent with vertex_id() that takes a size_t as input?

//! \brief Convert an element's index in the mesh to its ID
//! \param element The element ID
//! \return The index of the element in the mesh
virtual int element_index(MeshID element) const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment about returning size_t for round trip consistency

@pshriwise
Copy link
Collaborator Author

pshriwise commented Feb 3, 2026

Sorry for these little ticky-tack comments here, but I don't think I have time to fully review the actual meat of this PR.

Still helpful and appreciated! I've updated the return types of those methods to MeshIndex (int32_t under the hood) as that's the type stored in the IDBlockMapping on the class.

@pshriwise
Copy link
Collaborator Author

@gonuke does everything you had time to look at seem okay at this point?

Copy link
Collaborator

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to move this forward

@gonuke
Copy link
Collaborator

gonuke commented Feb 5, 2026

Do we care about the failing test?

@pshriwise
Copy link
Collaborator Author

Do we care about the failing test?

Mmm yes we do, but I might address the root cause in a separate PR. There's a strange bug in libMesh in handling strings I've yet to look into. Trying a re-run of the test for now.

@gonuke gonuke merged commit 60452eb into xdg-org:main Feb 5, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants