New user NGSolve coding issue

Hello,

I am trying to code a problem that involves two domains connected by an interface. There is pressure in the domains and at the interface. Therefore, I have a 2D and a 1D space. I tried to develop these pieces of code, but I am getting an anumerical factorization error( The matrix is singular). Any help would be greatly appreciated.
V = VectorL2(mesh, order=order)
Qi = H1(mesh, order=order, orderinner=0, definedon=mesh.Boundaries(“gammaf”), dirichlet=“gamma1|gamma2”)
Q1 = L2(mesh,order=order,definedon=mesh.Materials(“Domain1”))
Q2 = L2(mesh,order=order,definedon=mesh.Materials(“Domain2”))
Qbar1 = FacetFESpace(mesh, order=order,definedon=mesh.Materials(“Domain1”), dirichlet=“gamma1”)
Qbar2 = FacetFESpace(mesh, order=order, definedon=mesh.Materials(“Domain2”), dirichlet=“gamma2”)
X=FESpace([V,Q1,Qbar1,Q2,Qbar2,Qi])
(u,p1,pbar1,p2,pbar2,p_i),(v,q1,qbar1,q2,qbar2,qi)=X.TnT()

dx1 = dx(definedon=mesh.Materials(“Domain1”))
ds1 = dx(element_boundary = True, definedon=mesh.Materials(“Domain1”))

dx2 = dx(definedon=mesh.Materials(“Domain2”))
ds2 = dx(element_boundary = True, definedon=mesh.Materials(“Domain2”))

dsi = ds(skeleton = True, definedon=mesh.Boundaries(“gammai”))
a=BilinearForm(X,check_unused=False)
a += uvdx
a += p1q1dx1
a += p2q2dx2
a += pbar1qbar1ds1
a += pbar2qbar2ds2
a += p_iqidsi
f=LinearForm(X)
gfu=GridFunction(X)
a.Assemble()
f.Assemble()
res = f.vec.CreateVector()
res.data = f.vec - a.mat * gfu.vec
gfu.vec.data=a.mat.Inverse(X.FreeDofs(),inverse=“umfpack”)*res