Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes IndexError elmap #96

Merged
merged 4 commits into from
Aug 1, 2023
Merged

Conversation

akhoubani
Copy link
Contributor

Fixes #48

@akhoubani akhoubani changed the title Fixes InedexError elmap Fixes IndexError elmap Jul 28, 2023
@ashwinvis
Copy link
Member

@akhoubani This changes the ordering of elements as I understand. Did you double check with other Nek5000 setups that it works?

@ashwinvis
Copy link
Member

An alternate solution could be to keep the ordering that we had earlier (since there maybe an obscure user which relies on that order) and create an new element map capped with h.nb_elems_file so the IndexError does not occur.

@akhoubani
Copy link
Contributor Author

@akhoubani This changes the ordering of elements as I understand. Did you double check with other Nek5000 setups that it works?

I am unsure why pymech should use elmap to read data. I checked with some of my solvers, and it works fine.

@guillaumechauvat
Copy link
Member

guillaumechauvat commented Jul 30, 2023

If I remember correctly, the reason for ordering the elements with elmap was that element orderings for the same mesh file were inconsistent between runs, especially when running on a different number of cores. In the past, I had tried to calculate the difference between two fields from different runs but with the same geometry, and got garbage because the element order was inconsistent.

This is something I could add a test for.

Copy link
Member

@guillaumechauvat guillaumechauvat left a comment

Choose a reason for hiding this comment

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

Looks good to me!
It could still fail if elmap is not a permutation of 1..nel and doesn't contain zero but this is maybe not a problem in practice and it's complex to check.
Maybe use logger.warning() instead of print() too.

@ashwinvis
Copy link
Member

LGTM!

@ashwinvis ashwinvis merged commit 253ba50 into eX-Mech:main Aug 1, 2023
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.

IndexError: list index out of range in geometry reading
3 participants