Save Maximum Stress to File
Save Maximum Stress to File
(OP)
Good Morning,
I am creating an APDL macro. With it, I wish to save to a file the maximum stress that is written on the screen as "SMX" after ploting the results for Flux Gradient with EFSUM.
Does anyone know how I can retrieve that value in APDL and store it in a variable?
Cheers!
I am creating an APDL macro. With it, I wish to save to a file the maximum stress that is written on the screen as "SMX" after ploting the results for Flux Gradient with EFSUM.
Does anyone know how I can retrieve that value in APDL and store it in a variable?
Cheers!





RE: Save Maximum Stress to File
You can use for contour displays (PLNSOL) the folowing code:
CODE
or
CODE
Regards,
Alex
RE: Save Maximum Stress to File
Thanks Alex, that code does exactly what I was hoping for.
Is there also a way to retrieve and store the element number where the maximum stress is? Or even better, to retrieve the x and y component of the element with that maximum stress?
Cheers!
RE: Save Maximum Stress to File
Do you want the element or the nodal maximum results? In both cases the code is simple. For the element results:
CODE
nsel,all
! first the vector sum of components:
etab,efsum,ef,sum ! store the vector sum of electric field of all elements in an element table
esort,etab,efsum ! sort the element table
*get,efsum_max,sort,,max ! get the maximum value
*get,efsum_max_el,sort,,imax ! get the element number with the maximum value
! now for the x component
etab,efx,ef,x
esort,etab,efx
*get,efx_max,sort,,max
*get,efx_max_el,sort,,imax
! for the othe components (y and z) it's similar...
For the nodal results:
CODE
nsel,all ! select all nodes
! for the vector sum:
nsort,ef,sum
*get,efsum_max,sort,,max
*get,efsum_max_nd,sort,,imax
! for the x component:
nsort,ef,x
*get,efx_max,sort,,max
*get,efx_max_nd,sort,,imax
Regards,
Alex