Which function do I need?#

Find what your code does in the first column. The last column says which DOLFINx versions behave differently, which is when the function matters. “None” means the native call is the same from 0.10 on, and the function is only a convenience. For things that need no function at all, see Already the same on every version.

Meshes#

If your code needs to

Use

Differs between

Create a mesh from arrays with a ghost mode

create_mesh

0.10, 0.11 / main

Create a mesh from a gmsh model with a ghost mode

model_to_mesh

0.10, 0.11 / main

Pass a ghosted partitioner to an API that takes no ghost mode

create_cell_partitioner

0.10, 0.11 only; raises on main

Change the degree of the coordinate element

reconstruct_mesh

0.10 / 0.11, main

Get the coordinate element

cmap

0.10 / 0.11, main

Get the nodes of each cell

dofmap

0.10 / 0.11, main

Get the topology of a MeshTags as the Python object

meshtags_topology

0.10, 0.11 / main

Get the cell permutation info

cell_permutation_info

0.10, 0.11 / main

Get the orientation of each facet as seen from each cell

facet_permutations

0.10, 0.11 / main

Create a Raviart-Thomas space on a manifold

create_facet_orientations

0.10, 0.11 / main

Move tags from a mesh to a submesh

transfer_meshtags_to_submesh

0.10 / 0.11 / main

Index maps and vectors#

If your code needs to

Use

Differs between

Create an index map

create_index_map

0.10, 0.11 / main

Pass an index map to a dolfinx.cpp function

unwrap_index_map

0.10, 0.11 / main

Create an index map for a subset of indices

create_sub_index_map

0.10, 0.11 / main

Find the other ranks that hold each index

index_to_dest_ranks

0.10, 0.11 / main

Split range(N) over ranks the way DOLFINx does

local_range

0.10, 0.11 / main

Create a dolfinx.la.Vector

vector

None, if dtype is a keyword

Function spaces, elements and interpolation#

If your code needs to

Use

Differs between

Create a real (global constant) function space

real_functionspace

0.10 / 0.11, main

Create a C++ finite element

finite_element_ctor_kwargs

0.10, 0.11 / main

Interpolate values already evaluated at the interpolation points

interpolate

0.10 / 0.11, main

Evaluate an expression on cells or facets

expression_eval

None

Create an expression that uses coefficients from a parent mesh

interpolate_to_submesh_entity_maps

0.10 / 0.11, main

Evaluate on facets at points seen from the cell

permute_facet_quadrature

0.10 / 0.11, main

Reorder facet values to the facet’s own orientation

permute_interpolation_data

0.10 / 0.11, main

Forms and PETSc#

If your code needs to

Use

Differs between

Get the index map and block size of a linear form

form_map

0.10 / 0.11, main

Sort boundary conditions by block

bcs_by_block

0.10, 0.11 / main, when spaces are mixed

Set Dirichlet values in a PETSc vector

set_bc

None

Apply lifting and set Dirichlet values in one call

apply_lifting_and_set_bc

None

Zero a PETSc vector, or update its ghosts

zero_petsc_vector, ghost_update

None

UFL#

If your code needs to

Use

Differs between

Get the domain of an expression

domain_of

None

Map an expression back to the reference cell

apply_pullback_inverse

0.10, 0.11 / main

Output and other packages#

If your code needs to

Use

Differs between

Get the VTK cell type of a mesh cell

vtk_cell_type

0.10, 0.11 / main

Get ADIOS2’s low-level bindings

resolve_adios_scope

ADIOS2 2.9 / 2.10 and newer

Let PyVista use VTK’s snake_case names

pyvista_allow_snake_case

PyVista 0.45, 0.46 / 0.47 and newer

Branch on the DOLFINx version

at_least, before

None

Import an optional module with a helpful error

require_module

None