FEniCSx 0.9 interpolate_nonmatching

I am in the process of updating my code to FEniCSx 0.9, and part of that update is using the new “interpolate_nonmatching” function. I have created a test script to practice the new function, however I get the error:

  File "/home/mungerct/research/Stabilized_Stokes_Flow_FEniCSx/FE_Practice/interpolate_nonmatching_example.py", line 30, in <module>
    interpolation_data = fem.create_interpolation_data(mesh0, mesh1, # interpolating form mesh1 to mesh0
            cells, padding=1.0e-6)
  File "/home/mungerct/miniconda3/envs/fenicsx/lib/python3.13/site-packages/dolfinx/fem/__init__.py", line 94, in create_interpolation_data
    V_to.mesh._cpp_object.geometry, V_to.element, V_from.mesh._cpp_object, cells, padding
    ^^^^^^^^^
AttributeError: 'Mesh' object has no attribute 'mesh'

Below is the code I am using to practice interpolating between non-matching meshes. I am trying to interpolate a 2D solution onto a 3D solution because in my research, I need to interpolate a 2D solution as the boundary condition for a 3D problem.

I could not find any code examples for the new interpolate_nonmatching function, if any are out there please let me know so I can look at them for additional help.

Here is my code:
from dolfinx.mesh import create_unit_square, create_unit_cube, CellType
from basix.ufl import element
from dolfinx import fem
from mpi4py import MPI
import numpy as np

xtype = np.float64

cell_type0 = CellType.hexahedron
cell_type1 = CellType.triangle

mesh0 = create_unit_cube(MPI.COMM_WORLD, 5, 6, 7, cell_type=cell_type0, dtype=xtype) # 3D mesh
mesh1 = create_unit_square(MPI.COMM_WORLD, 5, 4, cell_type=cell_type1, dtype=xtype) # 2D mesh

el0 = element("Lagrange", mesh0.topology.cell_name(), 1)
V0 = fem.functionspace(mesh0, el0)
el1 = element("Lagrange", mesh1.topology.cell_name(), 1)
V1 = fem.functionspace(mesh1, el1)

# Interpolate on 2D mesh

u1 = fem.Function(V1, dtype=xtype)
u1.interpolate(lambda x: 7 * x[1] + 3 * x[0]) # Sample function to interpolate
u1.x.scatter_forward()

# Interpolate 2D->3D

msh_cell_map = mesh0.topology.index_map(mesh0.topology.dim)
num_cells_on_proc = msh_cell_map.size_local + msh_cell_map.num_ghosts
cells = np.arange(num_cells_on_proc, dtype=np.int32)
interpolation_data = fem.create_interpolation_data(mesh0, mesh1, # interpolating form mesh1 to mesh0
cells, padding=1.0e-6)
mesh0.sub(0).interpolate_nonmatching(mesh0, cells, interpolation_data)

I am using FEniCSx 0.9 installed on Linux (Ubuntu) using anaconda

See;

and the documentation

https://docs.fenicsproject.org/dolfinx/v0.9.0/python/generated/dolfinx.fem.html#dolfinx.fem.create_interpolation_data

https://docs.fenicsproject.org/dolfinx/v0.9.0/python/generated/dolfinx.fem.html#dolfinx.fem.Function.interpolate_nonmatching