Repository navigation
Updated mesh reading for Gmsh version 4 - #77
Merged
Merged
Conversation
Collaborator
Author
|
Oh, this definitely breaks support for old versions of Gmsh, and so the GitHub action tests are failing. |
Collaborator
Author
|
Edited the toy coordinates and nodes in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
celeri_uiwas written for Gmsh version 2 files. We're no longer using these, and the modern version 4 files are formatted really differently. I hacked together some changes that might not be perfect, but meshes are now displaying, at least when loaded one-by-one.The previous version of Gmsh files made things easier, specifying the dimension of mesh elements as the first number of each line within the
$Elementsblock. The new version is meant for more of a line-by-line parsing, with some lines specifying the dimensions and then the number of elements n of that physical section, with the next n lines just containing the vertex indices.To accommodate this knowing no TypeScript, I find the
$Elementssection, then find the index where the 2-D elements (triangles) start, then filter out any lines that start with a 2, which indicate subsequent blocks of 2-D elements (but not their actual vertices). This seems reasonable, because Gmsh always (?) defines 0-D and 1-D elements in a.mshfile, and so no triangle will have the index of 2, and therefore we won't be missing it when parsing the element indices.This is not a great way to read a mesh, but really all we need to do is display it, so I think it's fine. I also had to include a wrap-to-360 statement when reading node longitudes.