subroutine rsurfu(h,p,tgt,dnds,x1,time,u,ciname,slname,msname, 1 noel,node,lclose) include 'aba_param.inc' c character*80 ciname,slname,msname dimension p(3),tgt(3,2),dnds(3,2),x1(3,2),time(2) parameter(zero=0.d0,one=1.d0) c get cylinder radius stime=time(2) if(msname(1:5)=='INNER')then ri=0.4d0 drdt=one if(stime<=one)then radius=ri+drdt*stime elseif(stime<=2.d0)then radius=ri+drdt*(2.d0-stime) else radius=ri endif else ri=1.8d0 drdt=-one if(stime>=2.0d0)then radius=ri+drdt*(stime-2.0d0) else radius=ri endif endif c initialize variables do k1=1,2 do k2=1,3 tgt(k2,k1) = zero dnds(k2,k1) = zero p(k2) = zero enddo enddo c coordinates of point on deforming body x = x1(1,1) y = x1(2,1) z = x1(3,1) c project point onto unit radius cylinder r = ( x*x + y*y )**(0.5d0) x = x / r y = y / r c get point on rigid cylinder p(1) = radius*x p(2) = radius*y p(3) = z c get unit tangents tgt(1,1) = -y tgt(2,1) = x tgt(3,2) = one c get local curvatures dnds(1,1) = -y / radius dnds(2,1) = x / radius c get surface penetration depth if(msname(1:5)=='INNER')then h = radius - r else h = r - radius endif print *,radius,stime,msname(1:5),h return end