Here’s a similar problem. To produce this, I set up a virtual machine running Ubuntu 20.04 LTS on Digital Ocean. Python version is 3.8. I then logged in as root and followed almost exactly the Ubuntu instructions on this page. - thus:
apt-add-repository universe
add-apt-repository ppa:ngsolve/ngsolve
apt-get update
apt-get install ngsolve
(Since I was root, I didn’t need sudo.)
I then used my favorite, console based text editor to create a file named “ng_bad_script.py” with the following content:
#!/usr/bin/python3
from ngsolve import Mesh
from netgen.geom2d import Solid2d, Circle, CSG2d
dom = Solid2d([(0,0),(1,0),(1,1),(0.5,0.5)])-Circle((0.5,0.5),0.2)
geo = CSG2d()
geo.Add(dom)
mesh = Mesh(geo.GenerateMesh())
If I run this script, meshing then fails:
root@netgen:~# python3 ng_bad_script.py
importing NGSolve-6.2.2009
Generate Mesh from spline geometry
Boundary mesh done, np = 30
CalcLocalH: 30 Points 0 Elements 0 Surface Elements
Meshing domain 1 / 1
load internal triangle rules
give up with qualclass 201
number of frontlines = 27
Surface meshing done
Traceback (most recent call last):
File "ng_script.py", line 9, in <module>
mesh = Mesh(geo.GenerateMesh())
netgen.libngpy._meshing.NgException: meshing failed
The situation is worse if I delete the point (0.5,0.5) from the Solid2d object and store the program in “ng_really_bad_script.py”, for then I enter an infinite loop:
root@netgen:~# python3 ng_really_bad_script.py
importing NGSolve-6.2.2009
Generate Mesh from spline geometry
Boundary mesh done, np = 30
CalcLocalH: 30 Points 0 Elements 0 Surface Elements
Meshing domain 1 / 1
load internal triangle rules
loclines.Size = 1
loclines.Size = 1
loclines.Size = 1
...
...
Note that loclines.Size=1 printout repeats until I terminate.
Again, this is a totally fresh install and the exact same thing happens on my Mac with an Anaconda based installation.
To be clear, though, I’m generally quite impressed with the software and I’m looking forward to using it to generate examples for the PDE class that I’ll be teaching this semester. Examples where the points are in generic position tend to work; thus, problems like the above tend to go away if the points are perturbed a bit.