Hi David,
we do not have many exchange formats implemented, but we rely on Python which allows to convert data relatively easy.
I had it on the list for a while, and your post was a trigger to write a Gmsh reader this afternoon.
Have a look at github, and find it in the nightly release.
github.com/NGSolve/netgen/blob/master/python/read_gmsh.py
Improvements from Gmsh experts are welcome!
You can use it like this:
Code:
from netgen.read_gmsh import ReadGmsh
# import the Gmsh file to a Netgen mesh object
mesh = ReadGmsh("sphere.msh")
# wrap it into an NGSolve mesh
from ngsolve import *
mesh = Mesh(mesh)
Draw(mesh)
print ("num vol elements:", mesh.GetNE(VOL))
print ("num bnd elements:", mesh.GetNE(BND))
How do we exchange data, in particular for higher order finite elements ?
* You can use a piece-wise constant GridFunction, i.e. you provide one value per element.
* You can use voxel data on a uniform brick (with linear interpolation) as coefficient function
* We can exchange data in integration points. For that, we dump our integration points, and you provide function values in these points.
Best,
Joachim