Closed krober10nd closed 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",
)
assert
and adding dimension field to toTorus
,Cylinder
, andPrism
.