Within Fenics what ordering is used for storing vectors as upper triangular matrices? Th:e question really is I define a green Lagrange strain tensor in the following way:

V = VectorFunctionSpace(mesh, "Lagrange", 1)
u  = Function(V)
I = Identity(V.cell().d)    # Identity tensor
F = I + grad(u)             # Deformation gradient
C = F.T*F                   # Right Cauchy-Green tensor
E = (C-I)/2                 #green strain tensor

But when I accesses the elements later,

psi = stress1*E[0,0]+stress2*E[1,1]+stress3*(E[2,2])+stress4*E[1,2]+stress5*E[0,2]+stress6*E[0,1]

I assumed Voigt notation but it occurs to me that this may not be the case. Using this method to initialize the strain tensor is this the notation I should be using or is there a different type or initialization that would be more appropriate?

Thanks for any help.

  • $\begingroup$ Hopefully you have also tried fenicsproject.org/support. The subject is not very familiar to me. $\endgroup$
    – user5273
    Commented Feb 3, 2014 at 6:06
  • $\begingroup$ No I hadn't. Thanks for the tip, its been a while since I have used fenics and it appears they have started their own Q & A section since I was last there. $\endgroup$
    – Nick
    Commented Feb 3, 2014 at 6:31
  • $\begingroup$ "Pure" FEniCS question (i.e., about implementation details) have indeed moved to fenicsproject.org/qa. (Since it's a different platform, your question cannot be migrated unfortunately, so you'll have to reask there.) Questions with a mathematical or modeling background are still welcome here, though! (Not your question is not welcome; it just makes sense to collect all support-type questions in a single place.) $\endgroup$ Commented Feb 3, 2014 at 7:52

1 Answer 1


Adding the answer here in case others stumble on it. Answer is from Anders Logg, a fenics dev

Your definition of the tensors F, C, E is correct. FEniCS does not know anything about Voigt notation, so you need to access the components directly as E[0, 0] etc.


Not the answer you're looking for? Browse other questions tagged or ask your own question.