dolfinx.generation

Simple built-in mesh generation module

Functions

BoxMesh(comm, points, n[, cell_type, …])

Create box mesh

IntervalMesh(comm, nx, points[, ghost_mode, …])

Create an interval mesh

RectangleMesh(comm, points, n[, cell_type, …])

Create rectangle mesh

UnitCubeMesh(comm, nx, ny, nz[, cell_type, …])

Create a mesh of a unit cube

UnitIntervalMesh(comm, nx[, ghost_mode, …])

Create a mesh on the unit interval

UnitSquareMesh(comm, nx, ny[, cell_type, …])

Create a mesh of a unit square

dolfinx.generation.BoxMesh(comm, points: List[numpy.array], n: list, cell_type=<CellType.tetrahedron: 4>, ghost_mode=<GhostMode.shared_facet: 1>, partitioner=<built-in method partition_cells_graph of PyCapsule object>)[source]

Create box mesh

Parameters
  • comm – MPI communicator

  • points – List of points representing vertices

  • n – List of cells in each direction

dolfinx.generation.IntervalMesh(comm, nx: int, points: list, ghost_mode=<GhostMode.shared_facet: 1>, partitioner=<built-in method partition_cells_graph of PyCapsule object>)[source]

Create an interval mesh

Parameters
  • comm – MPI communicator

  • nx – Number of cells

  • point – Coordinates of the end points

  • ghost_mode

dolfinx.generation.RectangleMesh(comm, points: List[numpy.array], n: list, cell_type=<CellType.triangle: 3>, ghost_mode=<GhostMode.shared_facet: 1>, partitioner=<built-in method partition_cells_graph of PyCapsule object>, diagonal: str = 'right')[source]

Create rectangle mesh

Parameters
  • comm – MPI communicator

  • points – List of Points representing vertices

  • n – List of number of cells in each direction

  • diagonal – Direction of diagonal

dolfinx.generation.UnitCubeMesh(comm, nx, ny, nz, cell_type=<CellType.tetrahedron: 4>, ghost_mode=<GhostMode.shared_facet: 1>, partitioner=<built-in method partition_cells_graph of PyCapsule object>)[source]

Create a mesh of a unit cube

Parameters
  • comm – MPI communicator

  • nx – Number of cells in “x” direction

  • ny – Number of cells in “y” direction

  • nz – Number of cells in “z” direction

dolfinx.generation.UnitIntervalMesh(comm, nx, ghost_mode=<GhostMode.shared_facet: 1>, partitioner=<built-in method partition_cells_graph of PyCapsule object>)[source]

Create a mesh on the unit interval

Parameters
  • comm – MPI communicator

  • nx – Number of cells

dolfinx.generation.UnitSquareMesh(comm, nx, ny, cell_type=<CellType.triangle: 3>, ghost_mode=<GhostMode.shared_facet: 1>, partitioner=<built-in method partition_cells_graph of PyCapsule object>, diagonal='right')[source]

Create a mesh of a unit square

Parameters
  • comm – MPI communicator

  • nx – Number of cells in “x” direction

  • ny – Number of cells in “y” direction

  • diagonal – Direction of diagonal