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

Tensor notation

+2 votes

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.

asked Feb 3, 2014 by Nick FEniCS Novice (180 points)

Within Fenics what ordering is used for storing vectors as upper triangular matrices?

There is no such thing.

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?

Don't know what is Voigt notation, what would you like to do and what is your problem.
Nevertheless, the definition of E is mathematicaly verbose - it is what it is. You should increase a specificity of your question to have a chance of getting an answer.

I would also recommend you to read UFL chapter in the book.

1 Answer

+2 votes
 
Best answer

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.

answered Feb 3, 2014 by logg FEniCS Expert (11,790 points)
selected Feb 3, 2014 by Jan Blechta
...