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
129 stars 33 forks source link

Cylinder mismatch #132

Closed krober10nd closed 4 years ago

krober10nd commented 4 years ago
krober10nd commented 4 years ago
 from mpi4py import MPI
 import meshio

 import SeismicMesh

 comm = MPI.COMM_WORLD

 hmin = 0.20

 cylinder = SeismicMesh.Cylinder(h=5.0, r=1.0)
 cube = SeismicMesh.Cube((0.0, 3.0, 0.0, 1.0, 0.0, 1.0))
 cube2 = SeismicMesh.Cube((0.0, 1.0, 0.0, 1.0, 0.0, 3.0))
 torus = SeismicMesh.Torus(r1=5.0, r2=0.5)
 ball = SeismicMesh.Ball((0.0, 5.0, 0.0), 2.0)
 union = SeismicMesh.Union([cylinder, cube, torus, ball, cube2])

 points, cells = SeismicMesh.generate_mesh(
     domain=union,
     edge_length=hmin,
     verbose=2,
     max_iter=200,
 )

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

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

crazy