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

Variational form for inverting a gradient

–2 votes

I'm trying to find a vector $ u $ such that $ I + \nabla u = F_Q $, where $ F_Q $ is a known tensor field.

I'm not sure how to get the variational form for such a problem.

My first guess was:

$$ \int (I + \nabla u - F_Q) \cdot \nabla v dx = 0 $$

This is a linear problem, so I can always get some sort of solution with FEniCS. But for some values of $ F_Q $ the solutions seem to be correct within numerical tolerance, and for others they are way off.

Do I have the wrong variational form? Or is the strong form perhaps not well-specified?

asked Feb 23, 2017 by raeneufe FEniCS Novice (270 points)

What is v? What is your domain? How did you come up with the bilinear form? Looks all like "trying something" to me. You should aim to understand what you are doing. Guessing your solution is almost always wrong.

v is the test function. Since the trial function u is a vector, so is v.

The domain is a 3D box.

I got the bilinear and linear forms by calling lhs(...) and rhs(...) on that equation.

And yes, it certainly is "trying something" and I know that my current attempt is wrong.

The point of my question is that I don't know where to start in finding the variational form, and my first guess was unsurprisingly wrong.

...