Closed krober10nd closed 4 years ago
Happy that the mesh optimization helps improving the mesh. Does the gmsh one improve when running optimization on it? (I thought gmsh used optimization in 3D by default). I would like to note that even if the average mesh quality goes up, the minimum mesh quality seems to decrease when you increase number of iterations (from 13.173 to 12.174). I'm not trying to say that this is disastrous, but I am then unsure if it is worth having more iterations (as the runtime increases with 60 percent). I guess your algorithm will always keep the dihedral algorithm over the minimum bound (default 10).
To try to draw some conclusions out of this:
Does the gmsh one improve when running optimization on it? (I thought gmsh used optimization in 3D by default).
All the above call the same optimization at the end.
Does the gmsh one improve when running optimization on it? (I thought gmsh used optimization in 3D by default).
All the above call the same optimization at the end.
I got that, but does this last optimization call actually improve the GMSH mesh?
I would like to note that even if the average mesh quality goes up, the minimum mesh quality seems to decrease when you increase number of iterations (from 13.173 to 12.174). I'm not trying to say that this is disastrous, but I am then unsure if it is worth having more iterations (as the runtime increases with 60 percent). I guess your algorithm will always keep the dihedral algorithm over the minimum bound (default 10).
Yes, 10 degree as a bound seems to work quite well. I believe you can also achieve higher dihedral bounds by repeatedly calling this method with progressively higher bounds.
This algorithm works by perturbing a vertex of the tetrahedral a fraction of the minimum edge length in the domain in the direction that increases circumsphere radii of the sliver the fastest. I could make the sliver_removal
algorithm parallel but actually it already accelerates as there are fewer slivers since I use CGAL's incremental point moves
capability (and avoid a full retriangulation at all costs).
I got that, but does this last optimization call actually improve the GMSH mesh?
No, so probably you're right. It's probably called by default when generating a 3d mesh.
Ah, the par3d to master switch today didn't carry over some critical thing on master...
The sliver_removal
should actually be pretty quick and converge in < 10 iterations if the mesh is already high quality (~25 meshing iterations).
I can get a dihedral bound of 20 degrees in about a second with the following.
import gmsh
import SeismicMesh
import meshio
cube = SeismicMesh.Cube((0.0, 1.0, 0.0, 1.0, 0.0, 1.0))
points, cells = SeismicMesh.generate_mesh(domain=cube, edge_length=0.05)
points, cells = SeismicMesh.sliver_removal(points=points, domain=cube, edge_length=0.05)
points, cells = SeismicMesh.sliver_removal(
points=points, domain=cube, edge_length=0.05, min_dh_angle_bound=15
)
points, cells = SeismicMesh.sliver_removal(
points=points, domain=cube, edge_length=0.05, min_dh_angle_bound=20
)
This optimization benchmark came on in a different PR by accident so I'm going to close this.
@jorgensd I created a new benchmark similar to the old ball one where a mesh improvement method is ran at the end to compare final qualities with improvement methods. Specifically, I use the default gmsh 3d optimization one (not Netgen).
The results from running the
benchmarks/benchmark_ball_optmi.py
Time spent in optimization is generally between 0.20 to 0.33 seconds between the methods. The times reported below are without optimization considered.