How to use the meshplex.MeshTetra function in meshplex

To help you get started, we’ve selected a few meshplex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / pyfvm / test / test_bratu.py View on Github external
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)
github nschloe / pyfvm / test / helpers.py View on Github external
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)
github nschloe / pyfvm / test / test_convection.py View on Github external
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)
github nschloe / pyfvm / test / test_reaction.py View on Github external
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)
github nschloe / pyfvm / test / test_poisson.py View on Github external
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)