def ball(h): ball = SeismicMesh.Ball([0.0, 0.0, 0.0], 1.0) points, cells = SeismicMesh.generate_mesh( domain=ball, h0=h, edge_length=h, verbose=0 ) points, cells = SeismicMesh.sliver_removal( domain=ball, points=points, h0=h, edge_length=h, verbose=0 ) return points, cells
def test_smooth_diff(): cube1 = sm.Cube((-0.5, 0.5, -0.5, 0.5, -0.5, 0.5)) ball1 = sm.Ball((0.0, 0.0, 0.5), 0.85) domain = sm.Difference([ball1, cube1], smoothness=0.20) points, cells = sm.generate_mesh( domain=domain, edge_length=0.10, ) points, cells = sm.sliver_removal( points=points, domain=domain, edge_length=0.10, ) assert np.abs(cells.shape[0] - 9004) < 100