# Exception: Unable to extract all indices when trying to solve a coupled PDE (Stokes + adv-diff eq)

Hi,

I am having difficulties solving a coupled Stokes with an adv-diff equation. In particular the problem comes in when trying to define week forms that involve both variables i.e., (u, grad(T))*s, where u is the velocity solution of the Stokes and T is the temperature solution of the adv-diff equation. I posted below a minimalistic code that shows the problem. When I run it I get "Exception: Unable to extract all indices." I am wondering if you could give a feedback or if you have an idea of what the problem could be? Thanks in advance!

Noemi

-------

from dolfin import *

#Define Mesh and Elements

mesh = UnitSquare(16,16)

V = VectorFunctionS

Q = FunctionSpace(mesh, "Lagrange", 1)

S = FunctionSpace(mesh, "Lagrange", 1)

ME = MixedFunctionSp

# Define Dirichlet boundary conditions

def all_boundary(x, on_boundary):

return on_boundary

v0 = Expression(

bc1 = DirichletBC(

bc2 = DirichletBC(

bc3 = DirichletBC(

bcs = [bc1, bc2, bc3]

# body forces

f = Expression (("1","1"))

g = Expression(("1"))

(u, p, T) = TrialFunctions(ME)

(v, q, s) = TestFunctions(ME)

# Define Variational problems

a = inner(grad(

a = a + inner(grad(T), grad(s))*dx + inner(u,

L = inner(f,v)*dx + g*s*dx

w = Function(ME)

solve(a == L, w, bcs, solver_

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- DOLFIN Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- Noemi Petra

- Solved:

- Last query:

- Last reply: