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

Variational form of the equation

0 votes

Hi,

Am solving a system of pdes in fenics and need to write the the variational form. Everything looks good except a term like the following

$ \nabla \xi\nabla \cdot U $.

U=(U,V) is a vector and $\xi$ is a scalar function in 2d

So i tried the following

Multiplying by a vector function p and integrating by part I arrived at

$$ - \int (\xi\nabla\cdot U) \cdot \nabla p \space dx $$

assuming that p vanishes on the boundary. But this doesn't look right. Can someone please help with this. Any hint is highly appreciated. Thanks.

asked Nov 9, 2015 by Vivian FEniCS Novice (550 points)

Note that the expressions $(\xi\nabla\cdot U)$ and $\nabla p$ don't have the same dimensions.

Yes that is why I said is not right. But I couldn't think of anything else. Could you help please. Thanks.

1 Answer

+1 vote
 
Best answer

If U, V are vectors and you have the expression
inner(grad(div(U)), V) then integration by parts
gives you div(U)*div(V)

this is very different from the situation where you have
inner(div(grad(U)), V) because then integration by parts gives
inner(grad(U), grad(V))

(assuming that bc terms vanish in both cases)

answered Nov 10, 2015 by Kent-Andre Mardal FEniCS Expert (14,380 points)
selected Nov 10, 2015 by Vivian

Thanks Kent-Andre! I get it now.

...