Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_mesh(self, k):
n = 2 ** (k + 1)
vertices, cells = meshzoo.cube(
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, n + 1, n + 1, n + 1
)
return meshplex.MeshTetra(vertices, cells)
def get_ball_mesh(k):
import pygmsh
h = 0.5 ** (k + 1)
geom = pygmsh.built_in.Geometry()
geom.add_ball([0.0, 0.0, 0.0], 1.0, lcar=h)
mesh = pygmsh.generate_mesh(geom, verbose=False)
cells = mesh.get_cells_type("tetra")
# toss away unused points
uvertices, uidx = numpy.unique(cells, return_inverse=True)
cells = uidx.reshape(cells.shape)
points = mesh.points[uvertices]
return meshplex.MeshTetra(points, cells)
def get_mesh(self, k):
n = 2 ** (k + 1)
vertices, cells = meshzoo.cube(
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, n + 1, n + 1, n + 1
)
return meshplex.MeshTetra(vertices, cells)
def get_mesh(self, k):
n = 2 ** (k + 1)
vertices, cells = meshzoo.cube(
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, n + 1, n + 1, n + 1
)
return meshplex.MeshTetra(vertices, cells)
def get_mesh(self, k):
n = 2 ** (k + 1)
vertices, cells = meshzoo.cube(
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, n + 1, n + 1, n + 1
)
return meshplex.MeshTetra(vertices, cells)