- Thank you received: 0
Principal Stresses in Elasticity
3 years 1 month ago #3986
by NV
Principal Stresses in Elasticity was created by NV
In structural engineering we are often interested in minimum and maximum principal stress. In NGSolve we are able to calculate the eigenstress by something like (assuming stresses to be a 3x3 matrix valued coefficient function):
Then the first 9 entries of correspond to the stress eigenvectors and
are the eigenvalues. However, it seemed to be that the order of the eigenvalues is not fixed. Is there an efficient procedure to order them into maximal, middle and minimal principal values?
In 2D I could use
but in 3D this is very inefficient due to the need of multiple comparisons.
Best regards,
Nils
Code:
eig_stresses = stresses.eig()
Code:
eig_stresses[9], eig_stresses[10], eig_stresses[11]
In 2D I could use
Code:
max_princ = IfPos(eig_stresses[4]-eig_stresses[5],eig_stresses[4],eig_stresses[5])
Best regards,
Nils
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
3 years 1 month ago #3988
by mneunteufel
Replied by mneunteufel on topic Principal Stresses in Elasticity
Hi Nils,
using staggered IfPos commands the comparisons can be written relatively compact for the 3D case:
Best,
Michael
using staggered IfPos commands the comparisons can be written relatively compact for the 3D case:
Code:
max_princ = IfPos(eig_stresses[9]-eig_stresses[10],
IfPos(eig_stresses[9]-eig_stresses[11],eig_stresses[9],eig_stresses[11]),
IfPos(eig_stresses[10]-eig_stresses[11],eig_stresses[10],eig_stresses[11]))
min_princ = IfPos(eig_stresses[9]-eig_stresses[10],
IfPos(eig_stresses[10]-eig_stresses[11],eig_stresses[11],eig_stresses[10]),
IfPos(eig_stresses[9]-eig_stresses[11],eig_stresses[11],eig_stresses[9]))
middle_princ = eig_stresses[9]+eig_stresses[10]+eig_stresses[11] - max_princ - min_princ
Best,
Michael
3 years 1 month ago #3993
by NV
Replied by NV on topic Principal Stresses in Elasticity
Thanks for your help Michael.
Your solution works but for larger 3D models it is very slow.
It would be great if there is a solution which works faster and is implemented in the ngsolve environment. E.g. having .eig() already sorted or another option method .sortedEig()
Your solution works but for larger 3D models it is very slow.
It would be great if there is a solution which works faster and is implemented in the ngsolve environment. E.g. having .eig() already sorted or another option method .sortedEig()
- mrambausek
- Offline
- New Member
Less
More
- Thank you received: 3
3 years 1 month ago #3994
by mrambausek
Replied by mrambausek on topic Principal Stresses in Elasticity
Did you try to compile 'max_princ', eg. via
or the actual expression in which max_princ is used ('Compile' works recursively)?
If this is not done, the full Eigensystem will be re-evaluated multiple times with the same outcome, which is quite inefficient.
Code:
max_princ.Compile()
If this is not done, the full Eigensystem will be re-evaluated multiple times with the same outcome, which is quite inefficient.
The following user(s) said Thank You: Nils
Time to create page: 0.127 seconds