dolfinx.cpp.mesh

Mesh library module

Functions

build_dual_graph(comm, cells, tdim)

Build dual graph for cells

cell_dim(type)

cell_entity_type(type, dim, index)

cell_normals(*args, **kwargs)

Overloaded function.

cell_num_entities(type, dim)

cell_num_vertices(type)

compute_connectivity(topology, d0, d1)

compute_entities(comm, topology, dim)

compute_incident_entities(mesh, entities, d0, d1)

compute_midpoints(*args, **kwargs)

Overloaded function.

create_box_float32(comm, p, FixedSize]], ...)

create_box_float64(comm, p, FixedSize]], ...)

create_cell_partitioner(*args, **kwargs)

Overloaded function.

create_interval_float32(comm, n, p, ...)

create_interval_float64(comm, n, p, ...)

create_mesh(*args, **kwargs)

Overloaded function.

create_meshtags(*args, **kwargs)

Overloaded function.

create_rectangle_float32(comm, p, ...)

create_rectangle_float64(comm, p, ...)

create_submesh(*args, **kwargs)

Overloaded function.

entities_to_geometry(*args, **kwargs)

Overloaded function.

exterior_facet_indices(topology)

extract_topology(cell_type, layout, cells)

get_entity_vertices(type, dim)

h(*args, **kwargs)

Overloaded function.

is_simplex(type)

locate_entities(*args, **kwargs)

Overloaded function.

locate_entities_boundary(*args, **kwargs)

Overloaded function.

to_string(type)

to_type(cell)

Classes

CellType(self, value)

Members:

DiagonalType(self, value)

Members:

Geometry_float32

Geometry object

Geometry_float64

Geometry object

GhostMode(self, value)

Members:

MeshTags_float64(self, arg0, arg1, arg2, arg3)

MeshTags object

MeshTags_int32(self, arg0, arg1, arg2, arg3)

MeshTags object

MeshTags_int64(self, arg0, arg1, arg2, arg3)

MeshTags object

MeshTags_int8(self, arg0, arg1, arg2, arg3)

MeshTags object

Mesh_float32(self, comm, topology, geometry)

Mesh object

Mesh_float64(self, comm, topology, geometry)

Mesh object

Topology(self, comm, cell_type)

Topology object

class dolfinx.cpp.mesh.CellType(self: dolfinx.cpp.mesh.CellType, value: int)

Bases: pybind11_object

Members:

point

interval

triangle

quadrilateral

tetrahedron

pyramid

prism

hexahedron

hexahedron = <CellType.hexahedron: -8>
interval = <CellType.interval: 2>
property name
point = <CellType.point: 1>
prism = <CellType.prism: -6>
pyramid = <CellType.pyramid: -5>
quadrilateral = <CellType.quadrilateral: -4>
tetrahedron = <CellType.tetrahedron: 4>
triangle = <CellType.triangle: 3>
property value
class dolfinx.cpp.mesh.DiagonalType(self: dolfinx.cpp.mesh.DiagonalType, value: int)

Bases: pybind11_object

Members:

left

right

crossed

left_right

right_left

crossed = <DiagonalType.crossed: 2>
left = <DiagonalType.left: 0>
left_right = <DiagonalType.left_right: 4>
property name
right = <DiagonalType.right: 1>
right_left = <DiagonalType.right_left: 5>
property value
class dolfinx.cpp.mesh.Geometry_float32

Bases: pybind11_object

Geometry object

property cmaps

The coordinate maps

property dim

Geometric dimension

property dofmap
index_map(self: dolfinx.cpp.mesh.Geometry_float32) dolfinx.cpp.common.IndexMap
property input_global_indices
property x

Return coordinates of all geometry points. Each row is the coordinate of a point.

class dolfinx.cpp.mesh.Geometry_float64

Bases: pybind11_object

Geometry object

property cmaps

The coordinate maps

property dim

Geometric dimension

property dofmap
index_map(self: dolfinx.cpp.mesh.Geometry_float64) dolfinx.cpp.common.IndexMap
property input_global_indices
property x

Return coordinates of all geometry points. Each row is the coordinate of a point.

class dolfinx.cpp.mesh.GhostMode(self: dolfinx.cpp.mesh.GhostMode, value: int)

Bases: pybind11_object

Members:

none

shared_facet

shared_vertex

property name
none = <GhostMode.none: 0>
shared_facet = <GhostMode.shared_facet: 1>
shared_vertex = <GhostMode.shared_vertex: 2>
property value
class dolfinx.cpp.mesh.MeshTags_float64(self: dolfinx.cpp.mesh.MeshTags_float64, arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: numpy.ndarray[numpy.int32], arg3: numpy.ndarray[numpy.float64])

Bases: pybind11_object

MeshTags object

property dim
property dtype
find(self: dolfinx.cpp.mesh.MeshTags_float64, arg0: float) numpy.ndarray[numpy.int32]
property indices
property name
property topology
property values
class dolfinx.cpp.mesh.MeshTags_int32(self: dolfinx.cpp.mesh.MeshTags_int32, arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: numpy.ndarray[numpy.int32], arg3: numpy.ndarray[numpy.int32])

Bases: pybind11_object

MeshTags object

property dim
property dtype
find(self: dolfinx.cpp.mesh.MeshTags_int32, arg0: int) numpy.ndarray[numpy.int32]
property indices
property name
property topology
property values
class dolfinx.cpp.mesh.MeshTags_int64(self: dolfinx.cpp.mesh.MeshTags_int64, arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: numpy.ndarray[numpy.int32], arg3: numpy.ndarray[numpy.int64])

Bases: pybind11_object

MeshTags object

property dim
property dtype
find(self: dolfinx.cpp.mesh.MeshTags_int64, arg0: int) numpy.ndarray[numpy.int32]
property indices
property name
property topology
property values
class dolfinx.cpp.mesh.MeshTags_int8(self: dolfinx.cpp.mesh.MeshTags_int8, arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: numpy.ndarray[numpy.int32], arg3: numpy.ndarray[numpy.int8])

Bases: pybind11_object

MeshTags object

property dim
property dtype
find(self: dolfinx.cpp.mesh.MeshTags_int8, arg0: int) numpy.ndarray[numpy.int32]
property indices
property name
property topology
property values
class dolfinx.cpp.mesh.Mesh_float32(self: dolfinx.cpp.mesh.Mesh_float32, comm: MPICommWrapper, topology: dolfinx.cpp.mesh.Topology, geometry: dolfinx.cpp.mesh.Geometry_float32)

Bases: pybind11_object

Mesh object

property comm
property geometry

Mesh geometry

property name
property topology

Mesh topology

class dolfinx.cpp.mesh.Mesh_float64(self: dolfinx.cpp.mesh.Mesh_float64, comm: MPICommWrapper, topology: dolfinx.cpp.mesh.Topology, geometry: dolfinx.cpp.mesh.Geometry_float64)

Bases: pybind11_object

Mesh object

property comm
property geometry

Mesh geometry

property name
property topology

Mesh topology

class dolfinx.cpp.mesh.Topology(self: dolfinx.cpp.mesh.Topology, comm: MPICommWrapper, cell_type: List[dolfinx.cpp.mesh.CellType])

Bases: pybind11_object

Topology object

cell_name(self: dolfinx.cpp.mesh.Topology) str
property cell_types
property comm
connectivity(self: dolfinx.cpp.mesh.Topology, d0: int, d1: int) dolfinx::graph::AdjacencyList<int>
create_connectivity(self: dolfinx.cpp.mesh.Topology, d0: int, d1: int) None
create_entities(self: dolfinx.cpp.mesh.Topology, dim: int) int
create_entity_permutations(self: dolfinx.cpp.mesh.Topology) None
property dim

Topological dimension

entity_group_offsets(self: dolfinx.cpp.mesh.Topology, arg0: int) List[int]
get_cell_permutation_info(self: dolfinx.cpp.mesh.Topology) numpy.ndarray[numpy.uint32]
get_facet_permutations(self: dolfinx.cpp.mesh.Topology) numpy.ndarray[numpy.uint8]
index_map(self: dolfinx.cpp.mesh.Topology, dim: int) dolfinx.cpp.common.IndexMap
interprocess_facets(self: dolfinx.cpp.mesh.Topology) List[int]
property original_cell_index
set_connectivity(self: dolfinx.cpp.mesh.Topology, c: dolfinx::graph::AdjacencyList<int>, d0: int, d1: int) None
set_index_map(self: dolfinx.cpp.mesh.Topology, dim: int, map: dolfinx.cpp.common.IndexMap) None
dolfinx.cpp.mesh.build_dual_graph(comm: MPICommWrapper, cells: dolfinx::graph::AdjacencyList<long>, tdim: int) dolfinx::graph::AdjacencyList<long>

Build dual graph for cells

dolfinx.cpp.mesh.cell_dim(type: dolfinx.cpp.mesh.CellType) int
dolfinx.cpp.mesh.cell_entity_type(type: dolfinx.cpp.mesh.CellType, dim: int, index: int) dolfinx.cpp.mesh.CellType
dolfinx.cpp.mesh.cell_normals(*args, **kwargs)

Overloaded function.

  1. cell_normals(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float32]

  2. cell_normals(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float64]

dolfinx.cpp.mesh.cell_num_entities(type: dolfinx.cpp.mesh.CellType, dim: int) int
dolfinx.cpp.mesh.cell_num_vertices(type: dolfinx.cpp.mesh.CellType) int
dolfinx.cpp.mesh.compute_connectivity(topology: dolfinx::mesh::Topology, d0: int, d1: int) Annotated[List[dolfinx::graph::AdjacencyList<int>], FixedSize(2)]
dolfinx.cpp.mesh.compute_entities(comm: MPICommWrapper, topology: dolfinx::mesh::Topology, dim: int) Tuple[dolfinx::graph::AdjacencyList<int>, dolfinx::graph::AdjacencyList<int>, dolfinx.cpp.common.IndexMap, List[int]]
dolfinx.cpp.mesh.compute_incident_entities(mesh: dolfinx.cpp.mesh.Topology, entities: numpy.ndarray[numpy.int32], d0: int, d1: int) numpy.ndarray[numpy.int32]
dolfinx.cpp.mesh.compute_midpoints(*args, **kwargs)

Overloaded function.

  1. compute_midpoints(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float32]

  2. compute_midpoints(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float64]

dolfinx.cpp.mesh.create_box_float32(comm: MPICommWrapper, p: Annotated[List[Annotated[List[float], FixedSize(3)]], FixedSize(2)], n: Annotated[List[int], FixedSize(3)], celltype: dolfinx.cpp.mesh.CellType, partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]) dolfinx.cpp.mesh.Mesh_float32
dolfinx.cpp.mesh.create_box_float64(comm: MPICommWrapper, p: Annotated[List[Annotated[List[float], FixedSize(3)]], FixedSize(2)], n: Annotated[List[int], FixedSize(3)], celltype: dolfinx.cpp.mesh.CellType, partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]) dolfinx.cpp.mesh.Mesh_float64
dolfinx.cpp.mesh.create_cell_partitioner(*args, **kwargs)

Overloaded function.

  1. create_cell_partitioner(arg0: dolfinx.cpp.mesh.GhostMode) -> Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]

Create default cell partitioner.

  1. create_cell_partitioner(part: Callable[[MPICommWrapper, int, dolfinx::graph::AdjacencyList<long>, bool], dolfinx::graph::AdjacencyList<int>], ghost_mode: dolfinx.cpp.mesh.GhostMode = <GhostMode.none: 0>) -> Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]

Create a cell partitioner from a graph partitioning function.

dolfinx.cpp.mesh.create_interval_float32(comm: MPICommWrapper, n: int, p: Annotated[List[float], FixedSize(2)], ghost_mode: dolfinx.cpp.mesh.GhostMode, partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]) dolfinx.cpp.mesh.Mesh_float32
dolfinx.cpp.mesh.create_interval_float64(comm: MPICommWrapper, n: int, p: Annotated[List[float], FixedSize(2)], ghost_mode: dolfinx.cpp.mesh.GhostMode, partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]) dolfinx.cpp.mesh.Mesh_float64
dolfinx.cpp.mesh.create_mesh(*args, **kwargs)

Overloaded function.

  1. create_mesh(comm: MPICommWrapper, cells: dolfinx::graph::AdjacencyList<long>, element: dolfinx::fem::CoordinateElement<float>, x: numpy.ndarray[numpy.float32], partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]) -> dolfinx.cpp.mesh.Mesh_float32

Helper function for creating meshes.

  1. create_mesh(comm: MPICommWrapper, cells: dolfinx::graph::AdjacencyList<long>, element: dolfinx::fem::CoordinateElement<double>, x: numpy.ndarray[numpy.float64], partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>]) -> dolfinx.cpp.mesh.Mesh_float64

Helper function for creating meshes.

dolfinx.cpp.mesh.create_meshtags(*args, **kwargs)

Overloaded function.

  1. create_meshtags(arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: dolfinx::graph::AdjacencyList<int>, arg3: numpy.ndarray[numpy.int8]) -> dolfinx.cpp.mesh.MeshTags_int8

  2. create_meshtags(arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: dolfinx::graph::AdjacencyList<int>, arg3: numpy.ndarray[numpy.int32]) -> dolfinx.cpp.mesh.MeshTags_int32

  3. create_meshtags(arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: dolfinx::graph::AdjacencyList<int>, arg3: numpy.ndarray[numpy.int64]) -> dolfinx.cpp.mesh.MeshTags_int64

  4. create_meshtags(arg0: dolfinx.cpp.mesh.Topology, arg1: int, arg2: dolfinx::graph::AdjacencyList<int>, arg3: numpy.ndarray[numpy.float64]) -> dolfinx.cpp.mesh.MeshTags_float64

dolfinx.cpp.mesh.create_rectangle_float32(comm: MPICommWrapper, p: Annotated[List[Annotated[List[float], FixedSize(2)]], FixedSize(2)], n: Annotated[List[int], FixedSize(2)], celltype: dolfinx.cpp.mesh.CellType, partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>], diagonal: dolfinx::mesh::DiagonalType) dolfinx.cpp.mesh.Mesh_float32
dolfinx.cpp.mesh.create_rectangle_float64(comm: MPICommWrapper, p: Annotated[List[Annotated[List[float], FixedSize(2)]], FixedSize(2)], n: Annotated[List[int], FixedSize(2)], celltype: dolfinx.cpp.mesh.CellType, partitioner: Callable[[MPICommWrapper, int, int, dolfinx::graph::AdjacencyList<long>], dolfinx::graph::AdjacencyList<int>], diagonal: dolfinx::mesh::DiagonalType) dolfinx.cpp.mesh.Mesh_float64
dolfinx.cpp.mesh.create_submesh(*args, **kwargs)

Overloaded function.

  1. create_submesh(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, entities: numpy.ndarray[numpy.int32]) -> Tuple[dolfinx.cpp.mesh.Mesh_float32, List[int], List[int], List[int]]

  2. create_submesh(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, entities: numpy.ndarray[numpy.int32]) -> Tuple[dolfinx.cpp.mesh.Mesh_float64, List[int], List[int], List[int]]

dolfinx.cpp.mesh.entities_to_geometry(*args, **kwargs)

Overloaded function.

  1. entities_to_geometry(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, entities: numpy.ndarray[numpy.int32], orient: bool) -> numpy.ndarray[numpy.int32]

  2. entities_to_geometry(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, entities: numpy.ndarray[numpy.int32], orient: bool) -> numpy.ndarray[numpy.int32]

dolfinx.cpp.mesh.exterior_facet_indices(topology: dolfinx.cpp.mesh.Topology) numpy.ndarray[numpy.int32]
dolfinx.cpp.mesh.extract_topology(cell_type: dolfinx.cpp.mesh.CellType, layout: dolfinx::fem::ElementDofLayout, cells: dolfinx::graph::AdjacencyList<long>) dolfinx::graph::AdjacencyList<long>
dolfinx.cpp.mesh.get_entity_vertices(type: dolfinx.cpp.mesh.CellType, dim: int) dolfinx::graph::AdjacencyList<int>
dolfinx.cpp.mesh.h(*args, **kwargs)

Overloaded function.

  1. h(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float32]

Compute maximum distsance between any two vertices.

  1. h(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float64]

Compute maximum distsance between any two vertices.

dolfinx.cpp.mesh.is_simplex(type: dolfinx.cpp.mesh.CellType) bool
dolfinx.cpp.mesh.locate_entities(*args, **kwargs)

Overloaded function.

  1. locate_entities(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, marker: Callable[[numpy.ndarray[numpy.float32]], numpy.ndarray[bool]]) -> numpy.ndarray[numpy.int32]

  2. locate_entities(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, marker: Callable[[numpy.ndarray[numpy.float64]], numpy.ndarray[bool]]) -> numpy.ndarray[numpy.int32]

dolfinx.cpp.mesh.locate_entities_boundary(*args, **kwargs)

Overloaded function.

  1. locate_entities_boundary(mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, marker: Callable[[numpy.ndarray[numpy.float32]], numpy.ndarray[bool]]) -> numpy.ndarray[numpy.int32]

  2. locate_entities_boundary(mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, marker: Callable[[numpy.ndarray[numpy.float64]], numpy.ndarray[bool]]) -> numpy.ndarray[numpy.int32]

dolfinx.cpp.mesh.to_string(type: dolfinx.cpp.mesh.CellType) str
dolfinx.cpp.mesh.to_type(cell: str) dolfinx.cpp.mesh.CellType