Geometry, topology and tags#
cmap#
fenicsx_compat.cmap(mesh) -> dolfinx.fem.CoordinateElement
The coordinate element of the mesh geometry.
DOLFINx |
Native |
|---|---|
0.10 |
|
0.11, main |
|
cell = 0
nodes = mesh.geometry.x[fenicsx_compat.dofmap(mesh)[cell]]
X = fenicsx_compat.cmap(mesh).pull_back(np.array([[0.2, 0.1, 0.0]]), nodes)
dofmap#
fenicsx_compat.dofmap(mesh) -> numpy.ndarray
The geometry dofmap: the node indices of each cell, shape (num_cells, num_nodes_per_cell).
DOLFINx |
Native |
|---|---|
0.10 |
|
0.11, main |
|
cell_nodes = mesh.geometry.x[fenicsx_compat.dofmap(mesh)] # (num_cells, num_nodes_per_cell, 3)
cell_permutation_info#
fenicsx_compat.cell_permutation_info(topology) -> numpy.ndarray # uint32
Computes and returns the packed per-cell permutation info, ghost cells included, as used by dof transformations.
DOLFINx |
Native |
|---|---|
0.10, 0.11 |
|
main (DOLFINx PR #3904) |
|
cell_info = fenicsx_compat.cell_permutation_info(mesh.topology)
# e.g. for V.element.Tt_inv_apply(data, cell_info, n)
Calling it is also the portable way to make sure the permutations are computed before handing the topology to code that needs them.
facet_permutations#
fenicsx_compat.facet_permutations(topology) -> numpy.ndarray # uint8
The permutation of every facet of every cell, shape (num_cells, num_facets_per_cell), ghost cells included. These are the values FFCx kernels take as quadrature_permutation.
DOLFINx |
Native |
|---|---|
0.10, 0.11 |
|
main (DOLFINx PR #3904) |
|
perms = fenicsx_compat.facet_permutations(mesh.topology)
perm = perms[cell, local_facet]
On main, an interval mesh gives an empty array, since points have no orientation.
create_facet_orientations#
Added in version 0.3.0.
fenicsx_compat.create_facet_orientations(topology) -> None
Computes the facet orientations that Raviart-Thomas and other contravariant Piola spaces need on a manifold. Call it on every rank, before creating the space.
DOLFINx |
Native |
|---|---|
0.10, 0.11 |
No equivalent, and none needed: such spaces are created without it. Does nothing. |
main (DOLFINx PR #4625) |
|
submesh = dolfinx.mesh.create_submesh(mesh, 2, boundary_facets)[0]
fenicsx_compat.create_facet_orientations(submesh.topology)
V = dolfinx.fem.functionspace(submesh, ("RT", 1))
On main it raises ValueError for a topology whose dimension is not 2, as the native method does. Lagrange and Nédélec spaces do not need it.