# A DG method for Stokes and Darcy flow

I tried to implement a DG method for Stokes and Darcy problem on a square with two rectangle subdomains.

$$a_D(u,v)+a_S(u,v)+a_I(u,v)+b(v,p)+b(u,q)=\int_{\Omega_S}f_Svdx+\int_{\Omega_D}f_Dqdx$$
with
$$a_{S}(u,v)=\sum_{T\in \mathcal{T_S}}2\mu\int_T\epsilon(u):\epsilon(v)dx-\sum_{F\in\mathcal{F^i_S}}\int_{F}2\mu{{\epsilon(u)}}n\cdot[[v]]ds-\sum_{F\in\mathcal{F^i_S}}\int_{F}2\mu{{\epsilon(v)}}n\cdot[[u]]ds +\sum_{F\in \mathcal{F}^i_S}\frac{\sigma k^2}{h}\int_{F}[[u]][[v]]ds+\sum_{F\in\mathcal{F_S}}\frac{2\sigma k^2}{h}\int_{F}uvds$$
where \mathcal{F^i_S is the set of faces that are interior to Stokes region.
Please see the attached file for more details.

When I run the code, there was a traceback error as follows.

[code]NgException Traceback (most recent call last)
in
139
140 #Solve
→ 141 inv = a.mat.Inverse(freedofs=X.FreeDofs(), inverse=“umfpack”)
142 res = f.vec.CreateVector()
143 res.data = f.vec - a.mat*gfu.vec

NgException: UmfpackInverse: Numeric factorization failed.[/code]

Could you please tell me what the mistake I made is?
Thank you so much.

Attachment: SDproblem_2020-05-29-2.ipynb