Hi Matt,
I tested your Export function like this:
mesh = Mesh(unit_cube.GenerateMesh(maxh=0.5))
Export(mesh.ngmesh, 'neutral.mesh')
When I import into Netgen, it doesn't give any errors
Reading Neutral Format
21 Points, 28 Elements.
import mesh from /home/dow/python/ngsolve_notebooks/neutral.mesh
Read User File
But I don't see the mesh when it is selected. However, if I select 'edges', I can see small squares indicating the vertices.
This document
on page 20 specifies that the surface elements should also be listed (after the volume elements). I modified the Export function to include that information (see attached), but the imported file still doesn't display for me.
Also, when I tried to import from the OCC module, I got package not found.
----> 1 from netgen.NgOCC import *
~/ngsuite/ngsolve-install/lib/python3/dist-packages/netgen/NgOCC.py in <module>()
----> 1 from netgen.libngpy._NgOCC import *
2 from netgen.libngpy._meshing import MeshingParameters
3
4 def NgOCC_meshing_func (geom, **args):
5 if "mp" in args:
ModuleNotFoundError: No module named 'netgen.libngpy._NgOCC'; 'netgen.libngpy' is not a package
That seems odd , since I'm running a build based on the latest source and I can see NgOCC.py in the source tree.
EDIT: The ModuleNotFoundError was because I didn't have Open Cascade support installed and had not specified -DUSE_OCC=ON when configuring NGSolve before building from source.
I found all the information here:
CMake options