I am solving a PDE on a domain Ω split into two sub-domains Ω⁺ and Ω⁻ separated by an interface Γ.
On Γ I need to impose the interface (flux) condition
[
\frac{\partial u^{+}}{\partial n} = k,\frac{\partial u^{-}}{\partial n}
\quad \text{on } \Gamma,
]
where k is a given constant (or function defined on Γ).
I can mesh the two sub-domains separately (or use a single mesh with a label for the interface), and I can write the weak form of the PDE in each sub-domain.
However, I am not sure how to correctly enforce this interface condition in FreeFEM++.
Could someone provide guidance or a small example showing:
how to write the weak formulation that incorporates this interface condition,
or how to implement it using Lagrange multipliers or jump terms in FreeFEM++.
A minimal code example would be greatly appreciated.
Thank you for your answer.
I’m working on a problem where
[
\Delta u^+ = 0 \quad \text{in } \Omega_1
]
and
[
\Delta u^- = 0 \quad \text{in } \Omega_2
]
with (\Omega_1) being a square domain and (\Omega_2) an ellipse inside (\Omega_1).
On the interface (\Gamma = \partial\Omega_2), I impose
[
u^+ = u^- \quad \text{on } \Gamma , \qquad
k_1 \frac{\partial u^+}{\partial n} = k_2 \frac{\partial u^-}{\partial n}.
]
So the solution is continuous across the interface, and the flux is continuous as well.
I tried to reproduce the discontinuity of (k) as suggested in the FreeFem++ documentation, using:
// We create the variable k = 1 or -1
fespace V(tout,P0);
V pl = region;
int inside = pl((x1+x0)/2, (y1+y0)/2);
V chi = (inside == region);
V k = (1 - chi) * (-1) + 1 * chi;
I think this should be sufficient to achieve a good modeling of the problem.