# Multiple functions coupled via different domains and meshes

Hello everyone,

so, the last time I solve a problem with multiple trial functions was with fenics 2018 or so, and back then my domain was quite nice, so I am not really sure how to approach this problem in fenicsx.

Consider the following domains:

\Omega_1 := [0,1]
\Omega_2 := [0, \frac{1}{3}] \cup [\frac{2}{3}, 1]
\Omega_3 := \Omega_2 \times [0,1]

Now, I have the following functions:

u_a, u_b: \Omega_1 \rightarrow \mathbb{R}
u_c: \Omega_2 \rightarrow \mathbb{R}
u_d: \Omega_3 \rightarrow \mathbb{R}

The PDEs are (more or less) heat equations, but some of them coupled. For example:
\partial_t u_a = - \nabla \cdot (D_a \nabla u_a + D_b \nabla u_b ) + f
with some diffusion coefficients D and an additional term f. To make things easier we can ignore the time derivative and pretend the equation to be a couple Poisson equation.

Further, u_d is coupled with the other functions via (Neumann) boundary conditions, e.g.
D_d u_d \cdot \nu = c u_c on the boundary \Omega_2 \times \{ 0 \} \subset \partial \Omega_3
with \nu the normal vector and some coefficient c.

Now, to be honest I am a little bit lost how to approach this in fenicsx. I guess that I would need to define three different FunctionSpaces for each domain, correct? But then? In earlier versions there was something like MixedElement or MixedFunctionSpace, but they seem to have been removed. And how would I implement the coupled boundary conditions?

I am thankful for any advice.

Best regards,
welahi