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

showing wrong plot for a sum of two tensor components

0 votes

In my code I solve for a 2D displacement field u and then proceed to calculate strain

 eps = ( grad(u)+transpose(grad(u)) )
 e11 = eps[0, 0]
 e22 = eps[1, 1]
 eii = eps[1,1]+eps[0,0]

Plots for e11 and e22 are like this:
e11
e22
which look right according to the problem. But if I plot eii then the positive part goes away
somehow,
eii
Am I doing it wrong? Please help.

Regards
Deb.

related to an answer for: Plot my Stress Tensor Components
asked Jun 23, 2016 by debsankar FEniCS Novice (520 points)

1 Answer

0 votes

Try with a finer mesh or post a minimum working example.

answered Jun 24, 2016 by KristianE FEniCS Expert (12,900 points)

I think it is not right to think that e11 + e22 will show the actual compression behaviour.
The positive part (i.e. the extension) in e11 get cancelled by a same amount of compression
coming from e22.
I am solving elasticity in 2D with PBC, so you can not get total strain non-zero. That is why I thought Total( strain_xx + strain_yy ) != 0 is coming from some mistake in the code, while it was my logic that was wrong.
Thank you for the answer though.

Regards,
Deb.

...