How to define subdomain solver for multiphysics problem-domain decomposition

Dear NGsolve community,

If we try to use domain decomposition to solve the multiphysics problem, for example, Stokes-Darcy problem. At each time step, the Stokes equations and Darcy equations are solved separately. For example, for a simple test, we have the following codes:

geo = SplineGeometry()
geo.AddRectangle((0,0), (2,2),
bcs=[“b”,“r”,“t”,“l”],
leftdomain=1)
geo.AddRectangle((1,0.9), (1.3,1.4),
bcs=[“b2”,“r2”,“t2”,“l2”],
leftdomain=2, rightdomain=1)
geo.SetMaterial (1, “outer”)
geo.SetMaterial (2, “inner”)
mesh = Mesh(geo.GenerateMesh(maxh=0.1))

S1 = H1(mesh, order=order, definedon=“inner”)
S2 = H1(mesh, order=order, definedon=“outer”)

fes1 = FESpace([S1])
fes2 = FESpace([S2])
print (“ndof =”, fes1.ndof)
print (“ndof =”, fes2.ndof)

When I print out the degree of freedom of fes1 (or fes2), it seems that unused degrees for freedom were also added for fes1, it is not really the degrees of freedom restricted to one subdomain. If we use this S1 to generate the matrix for one subdomain, then it is singular. How should we solve this situation?

Many thanks.

Best regards,
Lina

Lowest order dofs are always kept in standard FESpaces. But they are marked as “unused”. You can use the “Compress”-Wrapper to remove those dofs.

Simply write S1c = Compress(S1) and you will obtain the reduction that you are expecting.

Best, Christoph

Dear Christoph,

Thank you so much for your kind reply.

Best regards,
Lina