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

Accesing the fields of a directional derivative in a three-field elasticity problem

+3 votes

Hello,
In a three-field Hu-Washizu variational functional representing nearly incompressible material behaviour like Pi(u,p,theta), the directional derivatives for this would be:

DPi(u,p,theta).dv
DPi(u,p,theta).dp
DPi(u,p,theta).dtheta

After computing these with:

F = derivative(Pi, u, v)

how can I access each component of F.
In other words, does F have three components with for example:

F[0] = DPi(u,p,theta).dv

and therefore, can I manipulate this by e.g., adding a tensor function to it like:

F[0] += some_tensor_function
asked Nov 22, 2013 by gennadiy FEniCS Novice (590 points)
edited Nov 22, 2013 by gennadiy

1 Answer

+1 vote
 
Best answer

I believe your Pi is functional. Then F is linear form on mixed space (you did not give its designation so let's say W = MixedSpace([U, P, T])) for components u, p, theta.

Hence you can

  • add another linear form corresponding to some subspace, let's say W.sub(0).sub(0) this way

    ux, vx = u[0], v[0]
    F += ux.dx(0)*vx*ds(42) # example, probably stupid
    
  • assemble it and then you can access components of resulting vector corresponding to different subspaces of W in principle. This is not a practical way of doing something.

answered Nov 22, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Nov 22, 2013 by gennadiy

Thanks Jan, this makes sense to me and I'm sure I can extend it to do what I want. One more question though, did you mean to do W.sub(0).sub(0) or W.sub(0)?

W.sub(0) is a velocity subspace and W.sub(0).sub(0) is a subspace of a first velocity component.

...