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

square root of a norm of a tensor/matrix

0 votes

Dear All,

I am working on the plasticity code based on FEniCS and using the python script for now. I would like to calculate the effective shear stress, which is defined as

sqrt(tr(Me0.T*Me0))/sqrt(2.0).

Me0 is the devetoric Mandel stress. The stress is related to the gradient of the displacement.

I got the following error with the 2016.2.0 version of FEniCS

"AttributeError: 'Trace' object has no attribute 'sqrt'"

My question is can we calculate such as quantity with python? If so, how can we implement it?

Thanks.

Best,
Teng

closed with the note: I found that I import numpy as *, which override the operator defined in dolfin. Thanks
asked Dec 5, 2016 by tengz FEniCS Novice (120 points)
closed Dec 5, 2016 by tengz
...