How to use the petsc.PETSc.DMPlex function in petsc

To help you get started, we’ve selected a few petsc 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 firedrakeproject / firedrake / firedrake / dmplex.py View on Github external
:arg dim: The topological dimension of the mesh
    :arg cells: The vertices of each cell
    :arg coords: The coordinates of each vertex
    :arg comm: An optional communicator to build the plex on (defaults to COMM_WORLD)
    """

    if comm is None:
        comm = MPI.comm
    if comm.rank == 0:
        # Provide the actual data on rank 0.
        return PETSc.DMPlex().createFromCellList(dim, cells, coords, comm=comm)

    # Provide empty plex on other ranks
    # A subsequent call to plex.distribute() takes care of parallel partitioning
    return PETSc.DMPlex().createFromCellList(dim,
                                             np.zeros((0, 0), dtype=np.int32),
                                             np.zeros((0, 0), dtype=np.int32),
                                             comm=comm)

petsc

PETSc: Portable, Extensible Toolkit for Scientific Computation

BSD-2-Clause
Latest version published 8 days ago

Package Health Score

60 / 100
Full package analysis