Closed krober10nd closed 3 years ago
I just realized I had the radius and height backwards, fixing that https://github.com/krober10nd/SeismicMesh/pull/131/files
If you release a new version I'll be able to include it in the plots.
Okay, I released 3.1.3 with this fix.
There's still something wrong with the params. Perhaps messing up radius and diameter?
Yea, think the radius
should be diameter
.
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",
)
nevermind...It's called height h
. I'll fix it.
Fixed by #5.
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", )