C PSTRE3 SOURCE CHAT 05/01/13 02:38:19 5004 c--------------------------------------------------------------------- c SUBROUTINE PSTRE3 (SIGMA, SGPRI) c c===================================================================== c = c This routine calculates the eigen stress values of 3D = c 'sigma (6)' and puts the results in 'sgpri (3)'. = c = c Note: sigma = (Sxx, Syy, Szz, Sxy, Sxz, Syz) = c sgpri = (S11, S22, S33) = c = c===================================================================== IMPLICIT INTEGER(I-N) real*8 sigma (6), sgpri (6) c integer*4 i real*8 x (6), a (6), . oneth, t, tp, tp3, sm, xj1, xj2, xj3, r, arg c data a . / 1.0 d0, 1.0 d0, 1.0 d0, 0.0 d0, 0.0 d0, 0.0 d0 / data oneth, tp . / 0.333333333333333 d0, 6.283185307179586 d0 / c tp3 = tp * oneth c xj1 = sigma (1) + sigma (2) + sigma (3) sm = xj1 * oneth c do 10 i = 1, 6 x (i) = sigma (i) - a (i) * sm 10 continue c xj2 = (x (1) **2 + x (2) **2 + x (3) **2) * 0.5 d0 + . x (4) **2 + x (5) **2 + x (6) **2 c if (xj2 .gt. 0.0 d0) then r = 2.0 d0 * SQRT (xj2 * oneth) xj3 = x (1) * (x (2) * x (3) - x (6) * x (6)) - . x (4) * (x (4) * x (3) - x (5) * x (6)) + . x (5) * (x (4) * x (6) - x (2) * x (5) ) arg = -3.0 d0 * xj3 / (r * xj2) if (arg .gt. 1.0 d0) then arg = 1.0 d0 else if (arg .lt. -1.0 d0) then arg = -1.0 d0 end if t = asin (arg) * oneth c sgpri (1) = r * sin (t + tp3) + sm sgpri (2) = r * sin (t ) + sm sgpri (3) = r * sin (t + 2.0 d0 * tp3) + sm else sgpri (1) = sigma (1) sgpri (2) = sigma (2) sgpri (3) = sigma (3) end if c return end