Making scalar values with Frobenius inner product of two 2nd order tensors

Asked by Sungick Kim

Hi.
I want to calculate a scalar value(strain energy) with two 2nd-order tensors.
In the FFC User manual,

dot(A, B) = A:B =sum(A_ij*B_ij) #When A and B are 2nd order tensor.
But it seems not working. When I tried to project the result error poped up.
Error message is
'ufl.log.UFLException: Shape mismatch.'

My code is written below.

Q = FunctionSpace(mesh, "CG", 1)
P=dot(A, B)
ans = project(P, Q)

Question information

Language:
English Edit question
Status:
Answered
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johan Hake (johan-hake) said :
#1

Can you help with this problem?

Provide an answer of your own, or ask Sungick Kim for more information if necessary.

To post a message you must log in.