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

deriving the variational form

0 votes

Hello
I am trying to derive the variational problem for these set of equations:

enter image description here

I know how to handle the left hand side (second time derivation). My question is about the right hand side. I need to mention that c11,c33,c44,c13 are constant. I have two dimensions here including x and z. I do not know how to handle the right hand side using the FEniCS operators like grad, div etc.
Does anybody know how I can do that?
Thanks in advance for your help.

asked Feb 9, 2016 by jafar FEniCS Novice (670 points)

1 Answer

0 votes

You can use "normal" derivatives as well as grad, div etc. If you want to take the y derivative of the x-component of u the write:

u[0].dx(1)

I.e you can write div(u) in 2D as

div2d = lambda u: u[0].dx(0) + u[1].dx(1)
...
a = div2d(u)*v*dx

You can also take the derivative of a combined expression

(u[0].dx(1) - u[1].dx(0)).dx(1)
answered Feb 9, 2016 by Tormod Landet FEniCS User (5,130 points)
...