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

Correction of reading .npy files #13

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

corentin-prigent
Copy link

@corentin-prigent corentin-prigent commented Feb 13, 2024

Input files in .npy format are now correctly read.

In previous versions, it was considered that the array size specified in the header of the .npy file corresponded to the number of vertices in the mesh. However, since references (array entries) are given to hexahedra, this led to leaving unused every entry in the array corresponding to the last index in each dimension.
Hence, the number of vertices and hexahedra in every dimension have been increased by one.

Data reading has been modified from int16_t type to uint32_t.

This modification is not enough to ensure proper reading for every type of data entry (int64 for instance). Another update will shortly be made in order to correct this.

Some int have been changed to MMG5_int.

Added some standard output lines.

Example

A example is provided here. The file small-example.npy is 4 x 4 x 4 array containing integers from 1 to 64. Running hex2tet without the update leads to an incorrect output file: most references do not appear in the mesh. This problem was caused both by the offset between the number of hexahedra and vertices and the data type that was read.
small-example.tar.gz

Warning

Since it is necessary for mmg to have a cell-centered distribution of the references, this update renders the use of a vertex-centered level-set function unusable with the output tetrahedral mesh.

@Algiane Algiane added the bug Something isn't working label Feb 16, 2024
@Algiane Algiane self-assigned this Feb 16, 2024
@Algiane Algiane merged commit f3834fd into MmgTools:develop Feb 16, 2024
8 checks passed
@Algiane
Copy link
Member

Algiane commented Feb 16, 2024

Thanks

@corentin-prigent corentin-prigent deleted the feature/fix_deadlock branch February 16, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants