meshpro / meshgen-comparison

:spider_web: A comparison of mesh generators.
GNU General Public License v3.0
40 stars 8 forks source link

cylinder benchmark suggestion? #4

Closed krober10nd closed 3 years ago

krober10nd commented 3 years ago

import SeismicMesh

comm = MPI.COMM_WORLD

hmin = 0.10

cylinder = SeismicMesh.Cylinder(h=1.0, r=0.5)

points, cells = SeismicMesh.generate_mesh( domain=cylinder, edge_length=hmin, )

points, cells = SeismicMesh.sliver_removal( points=points, domain=cylinder, edge_length=hmin, )

if comm.rank == 0: meshio.write_points_cells( "Cylinder.vtk", points, [("tetra", cells)], file_format="vtk", )

krober10nd commented 3 years ago

I just realized I had the radius and height backwards, fixing that https://github.com/krober10nd/SeismicMesh/pull/131/files

nschloe commented 3 years ago

If you release a new version I'll be able to include it in the plots.

krober10nd commented 3 years ago

Okay, I released 3.1.3 with this fix.

https://pypi.org/project/SeismicMesh/3.1.3/

nschloe commented 3 years ago

There's still something wrong with the params. Perhaps messing up radius and diameter?

krober10nd commented 3 years ago

Yea, think the radius should be diameter.

krober10nd commented 3 years ago

hmm..

This produces a height of 4 when I specified h = 2.0. Radius of the circle on each side looks okay. I guess the first parameter is called the diameter of the cylinder?

 # Mesh a cylinder
 from mpi4py import MPI
 import meshio

 import SeismicMesh

 comm = MPI.COMM_WORLD

 hmin = 0.20

 cylinder = SeismicMesh.Cylinder(h=2.0, r=1.0)

 points, cells = SeismicMesh.generate_mesh(
     domain=cylinder,
     edge_length=hmin,
     verbose=2,
     max_iter=50,
 )

 points, cells = SeismicMesh.sliver_removal(
     points=points,
     domain=cylinder,
     edge_length=hmin,
 )

 if comm.rank == 0:
     meshio.write_points_cells(
         "Cylinder.vtk",
         points,
         [("tetra", cells)],
         file_format="vtk",
     )

cylinder1

krober10nd commented 3 years ago

nevermind...It's called height h . I'll fix it.

nschloe commented 3 years ago

Fixed by #5.