Dear Professor,
I have edited the first few lines of code in pfiber.f to the following:
subroutine pfiber(d, a0, f, j, sig, dd, ftype, xref, xcur) ! xref and xcur have been added as new inputs!!!
c-----[--+---------+---------+---------+---------+---------+---------+-]
c Purpose: Fiber models for finite deformation constitution
c N.B. - Use I_4 not \bar{I_4}
c 1.) Holzapfel-Gasser model
c Psi(I_4) = 0.5*h1/h2*[exp(h2*(I_4 - 1)**2) - 1)]
c I_4 = A_I*C_IJ*A_J = (F_iI*A_I)*(F_iJ*A_J) = a_i*a_i
c a_i = F_iI*A_I
c Inputs:
c d(*) - Material parameters
c a0(3) - Structure vector
c f(3,3)- Deformation and displacement gradient
c j - Jacobian determinant
c ftype = 1 uses F; else uses G = displacement gradeint
c Outputs:
c sig(6) - Cauchy stress
c dd(6,6) - Moduli (current configuration)
c-----[--+---------+---------+---------+---------+---------+---------+-]
implicit none
real*8 d(*), a0(3), f(3,3), j, sig(6), dd(6,6), xref(3)
real*8 xcur(3)
integer ftype, i
real*8 a(3), tau(6), i4, ee, h1,h2, dpsi1, dpsi2, aLocal(3),
& a0Local(3), theta
c Compute current structure tensor
! *************** Am I correct in using xcur and xref? ***************
theta = atan2(xref(2) - xcur(2),xref(1) - xcur(1))
! Calculate new a0 for each point
aLocal(1) = cos(theta)*a0(3) - sin(theta)*a0(1)
aLocal(2) = sin(theta)*a0(3) + cos(theta)*a0(1)
aLocal(3) = a0(2)
! Normalization
a0Local(:) = aLocal(:)/sqrt(aLocal(1)**2+aLocal(2)**2+ &
aLocal(3)**2)
if(ftype.eq.1) then ! Use deformation gradient
a(:) = 0.0d0
do i = 1,3
a(:) = a(:) + f(:,i)*a0Local(i)
end do ! i
else ! Use displacement gradient
a(:) = a0Local(:)
do i = 1,3
a(:) = a(:) + f(:,i)*a0Local(i)
end do ! i
endif
There are a few syntax errors of course but I would like to know if this is what I am supposed to end up doing.
Regards,
Bharath