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

Vector Function

0 votes

I'd like to set up a problem of the form $\min \int |g(\nabla u) \nabla u- W|^2$ subject to boundary conditions on $u$. I haven vector field, $W$, currently set up as a standard vector valued python function. My question is really how do I "subtract" vector fields within fenics?

asked Mar 26, 2016 by gideonsimpson FEniCS Novice (510 points)

1 Answer

0 votes

If your question is how to access different dimensions of a vector field you can use the sub() function. As an example if you have:

u = VectorFunctionSpace(..)

as your function space, you can access u in the X direction using u.sub(0), and u.sub(1) for the Y direction.

answered Mar 27, 2016 by babak FEniCS Novice (380 points)
...