krober10nd / SeismicMesh

2D/3D serial and parallel triangular mesh generation tool for finite element methods.
https://seismicmesh.readthedocs.io/
GNU General Public License v3.0
127 stars 33 forks source link

meaning of `edge_length`, number of points #134

Closed nschloe closed 3 years ago

nschloe commented 3 years ago

Looking at the results of meshgen-comparison, it seems that seismicmesh has a different notion of h than other mesh generators. Check L-shape, cylinder, L-shape 3D. Any idea what's wrong?

https://github.com/nschloe/meshgen-comparison#l-shape

krober10nd commented 3 years ago

I noticed this too. As a sanity check, I produced a square with sides length 1 and specified an edge_length of 0.2, I get ~5 elements across. I repeated the below example with h=0.1 and got 10 across.

 import SeismicMesh

 import meshio

 h = 0.2

 rect = SeismicMesh.Rectangle((0.0, 1.0, 0.0, 1.0))
 points, cells = SeismicMesh.generate_mesh(
     domain=rect,
     edge_length=h,
 )
 meshio.Mesh(points, {"triangle": cells}).write("out.vtk")

Simple

I wonder what cgal and gmsh produce?

I see you're multiplying the max_edge_length by 1.5?

https://github.com/nschloe/meshgen-comparison/blob/ef896116acbe1a352b538a1037b6a90ba6206402/meshgen_comparison/pygalmesh_examples.py#L50

I assume this parameter name implies cgal and gmsh attempt to bound the maximum edge length, which I would assume implies all other edge lengths would be less than this.

nschloe commented 3 years ago

Got it: The L-shapes where too small.