SUBROUTINE RSURFU(H,P,TGT,DNDS,X,TIME,U,CINAME,SECNAME, 1 MAINNAME,NOEL,NODE,LCLOSE) C INCLUDE 'ABA_PARAM.INC' C CHARACTER*80 CINAME,SECNAME,MAINNAME DIMENSION P(3), TGT(3,2),DNDS(3,2), X(3,2), TIME(2), U(6,2) C C DEFINE THE FOLLOWING QUANTITIES: C A = RADIUS 'A' OF THE SPHERICAL HEAD C SINA = SINE (CONE ANGLE ALPHA) C COSA = COSINE (CONE ANGLE ALPHA) C Z0 = ORIGINAL 'Z' COORDINATE OF POINT 'Q' C A=5.0 SINA=0.5 COSA=0.86603 Z0=5.0 ZQ= Z0 + U(3,2) C C TEST FOR SEGMENT C R = SQRT(X(1,1)*X(1,1)+X(2,1)*X(2,1)) IF(R .GT. 0.0) THEN COSG = X(1,1)/R SING = X(2,1)/R ELSE COSG = 1.0 SING = 0.0 END IF IF(R*SINA/COSA .LT. ZQ -X(3,1)) THEN C C SPHERE C B=SQRT(R*R+(X(3,1)-ZQ)**2) H=A-B COSB=R/B SINB=(ZQ-X(3,1))/B P(1)=A*COSB*COSG P(2)=A*COSB*SING P(3)=ZQ-A*SINB TGT(1,1)=-SINB*COSG TGT(2,1)=-SINB*SING TGT(3,1)=-COSB TGT(1,2)=-SING TGT(2,2)=COSG TGT(3,2)=0.0 DNDS(1,1)=-SINB*COSG/A DNDS(2,1)=-SINB*SING/A DNDS(3,1)=-COSB/A DNDS(1,2)=-SING/A DNDS(2,2)=COSG/A DNDS(3,2)=0.0 ELSE C C CONE C H=-R*COSA+(X(3,1)-ZQ)*SINA+A P(1)=(R+H*COSA)*COSG P(2)=(R+H*COSA)*SING P(3)=X(3,1)-H*SINA TGT(1,1)=-SINA*COSG TGT(2,1)=-SINA*SING TGT(3,1)=-COSA TGT(1,2)=-SING TGT(2,2)=COSG TGT(3,2)=0.0 DNDS(1,1)=0.0 DNDS(2,1)=0.0 DNDS(3,1)=0.0 C=R+H*COSA DNDS(1,2)=-COSA*SING/C DNDS(2,2)=COSA*COSG/C DNDS(3,2)=0.0 END IF C RETURN END