From 31d5ccf16d1afdb9ab329d1069fd18aef6ec76c1 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 27 Mar 2007 15:57:18 +0000 Subject: [PATCH] added math_Hooke to calc stress from stiffness and strain --- trunk/math.f90 | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/trunk/math.f90 b/trunk/math.f90 index 6137d1083..871ec48af 100644 --- a/trunk/math.f90 +++ b/trunk/math.f90 @@ -326,6 +326,25 @@ END SUBROUTINE +!******************************************************************** +! calculate v6 stress from M6x6 stiffness and v6 strain +!******************************************************************** + FUNCTION math_Hooke(C,e) + + use prec, only: pReal,pInt + implicit none + + real(pReal) C(6,6), e(6), factoredE(6) + real(pReal), dimension(6), parameter :: preFactor = (/1.0_pReal,1.0_pReal,1.0_pReal,2.0_pReal,2.0_pReal,2.0_pReal/) + real(pReal) math_Hooke(6) + + factoredE = dot_product(preFactor,e) + math_Hooke = matmul(C,factoredE) + return + + END FUNCTION + + !******************************************************************** ! calculate the determinant of a (3x3) !******************************************************************** @@ -345,7 +364,7 @@ !******************************************************************** -! covert a symmetric 3,3 matrix into an array of 6 +! convert a symmetric 3,3 matrix into an array of 6 !******************************************************************** FUNCTION math_33to6(m33) @@ -836,7 +855,7 @@ integer(pInt) i,dimen real(pReal) math_identity2nd(dimen,dimen) - math_identity = 0.0_pReal + math_identity2nd = 0.0_pReal forall (i=1:dimen) math_identity2nd(i,i) = 1.0_pReal return @@ -850,7 +869,7 @@ use prec, only: pReal, pInt implicit none - integer(pInt) i,dimen + integer(pInt) i,j,k,l,dimen real(pReal) math_identity4th(dimen,dimen,dimen,dimen) forall (i=1:dimen,j=1:dimen,k=1:dimen,l=1:dimen) math_identity4th(i,j,k,l) = &