-
Notifications
You must be signed in to change notification settings - Fork 81
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
Gmsh Python API #180
Comments
Do you happen to have a minimal example so I can try it out? |
Nevermind, I found some stuff here: https://gitlab.onelab.info/gmsh/gmsh/blob/master/demos/api/adapt_mesh.py |
Maybe the cleanest way of doing this would be along
Basically we'd be writing various functions that take some external Mesh format object and transform those into a tuple of correct input variables for Some questions:
|
I've just noticed that gmsh-sdk is actually also a convenient way of installing Gmsh itself pip install gmsh-sdk
which gmsh → gmsh -version → This might replace the three lines Lines 8 to 10 in 55bcfc7
Also is this fourth already redundant? Line 6 in 55bcfc7
|
A brief example of a Python script importing |
|
This might be coming back in via nschloe/pygmsh#360. |
I've been experimenting with the new Gmsh Python API, in conjunction with the wrapping package gmsh-sdk. It's good.
So far, I've just been using it to generate MSH files for
Mesh.load
, but of course part of the appeal is that it might be possible to avoid writing out the mesh and rereading it (as is necessary for pygmsh); i.e. it should be possible to instantiate askfem.Mesh
directly from the data structures available in the Gmsh Python API. This would bypass not onlyMesh.load
but alsoMesh.from_meshio
.In order to pass on any subdomains and boundaries, should it populate
Mesh.external
and then useMesh._parse_submeshes
asMesh.from_meshio
does?Or (thinking also of the impasse on loading
MeshLine.boundaries
in #175) should theskfem.Mesh
constructors be enhanced to take not only points and cells but also optionally subdomains and boundaries? Factoring that code out ofMesh._parse_submeshes
.The text was updated successfully, but these errors were encountered: