eX-Mech / pymech

A Python software suite for Nek5000 and SIMSON
https://pymech.readthedocs.io/en/stable
GNU General Public License v3.0
24 stars 24 forks source link

Fixes IndexError elmap #96

Closed akhoubani closed 1 year ago

akhoubani commented 1 year ago

Fixes #48

ashwinvis commented 1 year ago

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

ashwinvis commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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.

ashwinvis commented 1 year ago

LGTM!