This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Mixed displacement

0 votes

Hi,

I'm trying to solve a mixed pressure displacement problem, but when I define the problem in this way:

V = VectorFunctionSpace(mesh, "CG", 2)
W = FunctionSpace(mesh, "CG", 1)
M = V * W # Mixed space

bc = [DirichletBC(M.sub(0), u_0, fixedFace),
DirichletBC(M.sub(1), p_0, innerFace)]

(u, p) = TrialFunctions(M)
(v, w) = TestFunctions(M)
a = ( 4Ginner(sym(grad(u)), sym(grad(v))) - (div(u)+p)div(v) + w(p/K+div(u)) ) * dx
L = 0

I get the following error: Unable to define nonlinear variational problem F(u; v) = 0 for all v.

But I can't see any nonlinearity in this problem. Does anyone knows what am I doing wrong?

Thank you!

asked Mar 10, 2016 by EduardoMS FEniCS Novice (270 points)

Can you post a minimal (but complete) non-working example of your code?

Hernan, thank you for your attention!

The problem was in this part of the code I presented. As I defined "L = 0" the solve function of FEniCS was interpreting that my problem was nonlinear because the definition to a nonlinear problem is "F == 0" while the definition to a linear one is "a == L".

What I had to do is define a zero vector f and define "L = fvdx"

...