Forms defined on different mesh

Hi guys!
I am running fencsx code about MHD from
https://github.com/jpdean/mixed_domain_demos/blob/main/mhd.py
I define A on mesh ,define u p T in submesh(fuild domain)
Just like in the reference,but encountered an issue while writing the coupling term(Lorentz force).

a_40 = fem.form(
    inner(cross(curl(A), u), phi) * dx_c,
    entity_maps={msh: sm_f_to_msh},
)

I provided a simple code:

from mpi4py import MPI
from petsc4py import PETSc
import numpy as np
from dolfinx import default_real_type, fem, io, mesh,default_scalar_type
from dolfinx.fem.petsc import assemble_matrix, assemble_vector
from ufl import (CellDiameter, FacetNormal, TestFunction, TrialFunction, avg,
conditional, div, dot, dS, ds, dx, grad, gt, inner, outer,
TrialFunctions,TestFunctions,curl,cross)
import ufl
from dolfinx.io import gmshio,XDMFFile
from basix.ufl import element,mixed_element
from dolfinx.fem.petsc import (apply_lifting, assemble_matrix, assemble_vector,
create_vector, set_bc,create_matrix)
import time
from dolfinx.mesh import CellType

msh=mesh.create_unit_cube(MPI.COMM_WORLD,8,8,8,cell_type=CellType.tetrahedron)

entities= mesh.locate_entities(msh,3, lambda x:(x[2]>=0.5))
submesh,entity_map, vertex_map, geom_map=mesh.create_submesh(msh,3,entities)

U_element=element(“RT”, msh.basix_cell(), 2)
P_element=element(“DG”, msh.basix_cell(), 1)
A_element=element(“N1curl”, msh.basix_cell(), 2)
T_element=element(“DG”, msh.basix_cell(), 1)

VU=fem.functionspace(submesh,U_element)
VP=fem.functionspace(submesh,P_element)
VA=fem.functionspace(msh,A_element)
VT=fem.functionspace(submesh,T_element)

##output submesh
with io.XDMFFile(msh.comm,“submesh.xdmf”,“w”) as xdmf:
xdmf.write_mesh(submesh)

u, v = ufl.TrialFunction(VU), ufl.TestFunction(VU)
p, q = ufl.TrialFunction(VP), ufl.TestFunction(VP)
A, Av = ufl.TrialFunction(VA), ufl.TestFunction(VA)

dx_c=ufl.Measure(“dx”,domain=submesh)

aa=fem.form(inner(A,v)*dx_c)
‘’‘aa=fem.form(inner(A,v)*dx_c,
entity_maps={msh: entity_map},)’‘’

I have to do this because I want to remove redundant dofs.

Please reformat the code with 3x`, i.e.

```python
import dolfinx 
# Add code here
```

It would also help if you add your error message/stack trace of the issue.