My isw 3 in short is this,
if(isw.eq.3 .or.isw.eq.6) then ! Compute residual/tangent
! Material Properties
emod = d(1)
enu = d(2)
thk = d(3)
nnode = nen
ndim = ndm
ngp = 2
! Initializing the displacement vector
utmp(1) = ul(1,1)
utmp(2) = ul(2,1)
! ---------------------------------
utmp(3) = ul(1,2)
utmp(4) = ul(2,2)
! ---------------------------------
utmp(5) = ul(1,3)
utmp(6) = ul(2,3)
! ---------------------------------
utmp(7) = ul(1,4)
utmp(8) = ul(2,4)
do i=1,nnode
do j=1,ndim
xref(j,i) = xl(j,i) !Reference coordinaates
end do
end do
! Initializing s(nst,nst) and p(nst)
do i =1,ndim*nnode
p(i) = zero
end do
do i =1,ndim*nnode
do j =1,ndim*nnode
s(i,j) = zero
end do
end do
! Setting the integration points
call int2d(ngp,lint,sg)
! Integration Loop
do l =1,lint
ss(1)=sg(1,l)
!write(*,*)'xi: ',ss(1)
ss(2)=sg(2,l)
!write(*,*)'eta: ',ss(2)
!write(*,*)'Step Integration: ',l
call kshape2d(shapef,dshape,ss(1),ss(2),ngp,nnode,ndim)
!write(*,*)'shapefunction: ',shapef
call kjac2d(xjac,xjacinv,detxjac,ndim,nnode,shapef
* ,dshape,xref)
call kstrain(stran,utmp,Bmat,ndim,nnode)
! Taking material model into consideration
call pzero(CmatVoigt2d,3*3)
CmatVoigt2D(1,1)=(emod/((one+enu)*(one-two*enu)))*
* (one-enu)
CmatVoigt2D(1,2)=(emod/((one+enu)*(one-two*enu)))*enu
CmatVoigt2D(2,1)=CmatVoigt2D(1,2)
CmatVoigt2D(2,2)=CmatVoigt2D(1,1)
CmatVoigt2D(3,3)=(emod/((one+enu)*(one-two*enu)))
* *((one-two*enu)/two)
call pzero(stress,3)
do ii = 1,3
do jj =1,3
stress(ii) = stress(ii) + CmatVoigt2d(ii,jj)*
* stran(jj)
end do
end do
!write(*,*)'CmatVoigt2D',CmatVoigt2D
factor = detxjac*sg(3,l)*thk
call kBmat2d(Bmat,ndim,nnode,ngp,shapef
* ,dshape,xjac,xjacinv)
!write(*,*)'Bmat: ',Bmat
call kCompTrans(Bmat,ndim*nnode,3,BmatT)
call kmatrixtripl(kdd,ndim*nnode,ndim*nnode,BmatT,
& nnode*ndim,3,CmatVoigt2d,3,3,Bmat,3,ndim*nnode)
!write(*,*)'kdd',kdd
!write(*,*)'kdd: ',kdd
do i =1,ndim*nnode
do j = 1,ndim*nnode
s(i,j) = s(i,j) + kdd(i,j)*factor
end do
end do
do i =1,nst
do j = 1,nst
p(i) = p(i) - s(i,j)*utmp(j)
end do
end do
end do
endif
I have nothing added to other ISWs. apart from 1.