-
Notifications
You must be signed in to change notification settings - Fork 8
Implement loading of meshes from MSH files #15
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
Implement loading of meshes from MSH files #15
Conversation
09bff9c to
fa45d81
Compare
5261245 to
983bd72
Compare
Andlon
left a comment
There was a problem hiding this 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! I left one comment about some commented out stuff; unsure if we should remove this before merge or keep it in, maybe with some added TODO statement?
More generally, I'm also unsure about the higher order elements, because currently the higher-order elements in fenris assume an affine reference -> physical mapping... But maybe we can merge and create an issue for fixing this in the future. I believe the fix is to support fully isoparametric elements and import directly into these, then having some kind of assume_affine() function to turn them into elements with affine transformations. Not sure!
| { | ||
| return Err(eyre!("node block entity does not have the right dimension for this mesh")); | ||
| } | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still relevant? Should it be left in but commented? It's not clear to me why it's commented out, which probably means it should either be removed or fixed? (Or replaced with a TODO or something)
6e26900 to
6642394
Compare
Andlon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically ready to merge, but it looks like parts of #49 sneaked into this PR? Since that one is still pending some basic tests I'd prefer to leave this out of this one.
| weights: self.weights, | ||
| data: data, | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be unrelated to MSH, and seems to be the same functionality as in #49 ? Also applies to code below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that was not intended.
6a74c8f to
6a11152
Compare
Andlon
left a comment
There was a problem hiding this 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, thanks!
This implements loading of Fenris meshes from MSH files/byte slices using the mshio crate. Only Gmsh MSH file format 4.1 is currently supported.
The
io::mshmodule provides the functionsload_msh_from_fileandload_msh_from_bytes. The specifiedConnectivitytype determines which element blocks are actually extracted from the loaded MSH file. All element types that implement theMshConnectivitytrait are supported. Currently those are:Hex8ConnectivityHex27ConnectivityQuad4d2ConnectivityQuad9d2ConnectivityTet4ConnectivityTet10ConnectivityTri3d2ConnectivityTri3d3ConnectivityTri6d2ConnectivityTri6d3Connectivity,Quad4d3ConnectivityandQuad9d3Connectivityare currently not supported because they don't implement theElementConnectivitytrait.