-
Notifications
You must be signed in to change notification settings - Fork 348
Description
I have a scripted pipeline that creates geometry using gmsh, then feeds it into an magnetostatics simulation in Elmer. It works well, except some meshes fail to simulate properly. I'm unsure if it's a bug with ElmerGrid or Gmsh, but the gmsh author has now looked at the meshes and said they look OK.
The only thing I've been able to narrow it down is that when running ElmerGrid with -autoclean
, it will print a message about removing a single unused node. If no such message is printed (ie, all nodes are "used"?), the simulation will produce meaningful results. If it does print something about an unused node, the simulation will complete, but the results will make no sense.
It's pretty random when the meshes fail to work, and you can typically modify the geometry by very small amounts and get it to work. It's not an issue with geometry overlapping, because the dimension being changed is perpendicular to any intersections.
Here is a python gmsh script that can easily produce both a working and non-working mesh. By default, it will produce a mesh that fails to run. If line 36 is changed from 12.5
to 12.49
, ElmerGrid will no longer complain about an unused node, and the simulation will produce meaningful results.
Not sure what's going on here. My current workaround is to detect the unused node message in ElmerGrid and manually tweak some dimensions by random small amounts until the problem goes away. It's kind of annoying when I kick off 20 simulations to do a parameter sweep and 3 of them end up failing due to this bug.