31 character*1 inpc(*),surfkind,typeboun(*)
33 character*20 labmpc(*),label
34 character*80 orname(*),orientation
35 character*81 set(*),surfset
36 character*132 textpart(16),name
38 integer istartset(*),iendset(*),ialset(*),norien,irstrt,nface,
39 & iorientation,iface,jface,nset,nboun,istat,n,i,j,k,ibounstart,
40 & ibounend,key,nk,ipompc(*),nodempc(3,*),nmpc,nmpc_,mpcfree,
41 & ikboun(*),ikmpc(*),ilmpc(*),ipos,m,node,iline,ipol,inl,nope,
42 & ipoinp(2,*),inp(3,*),ipoinpc(0:*),jsurf,irefnode,indexe,nopes,
43 & ifaceq(8,6),ifacet(6,4),ifacew1(4,5),ifacew2(8,5),ipkon(*),
44 & kon(*),istep,nelem,ics(2,*),nodef(8),nboun_,nodeboun(*),
45 & npt,mint,index1,mpcfreeold,id,idof,iflag,inhomnode,nk_,kk,
46 & irotnode(3),l,index2,indexold(3),indexnew(3),idirold,idirmax,
47 & idir,indexmax,nodeold,node1,nodemax,ndirboun(*),ilboun(*),
48 & irotnode_kin,idupnode
50 real*8 coefmpc(*),co(3,*),orab(7,*),dcs(*),areanodal(8),xl2(3,8),
51 & shp2(7,8),xsj2(3),xsj,xi,et,weight,xs2(3,2),area,a(3,3),cgx(3),
52 & aa(3),pi(3),
c1,c4,c9,c10,amax,xcoef,coef(3),xboun(*)
58 data ifaceq /4,3,2,1,11,10,9,12,
59 & 5,6,7,8,13,14,15,16,
61 & 2,3,7,6,10,19,14,18,
62 & 3,4,8,7,11,20,15,19,
63 & 4,1,5,8,12,17,16,20/
67 data ifacet /1,3,2,7,6,5,
74 data ifacew1 /1,3,2,0,
82 data ifacew2 /1,3,2,9,8,7,0,0,
92 if((istep.gt.0).and.(irstrt.ge.0))
then 93 write(*,*)
'*ERROR reading *COUPLING: *COUPLING' 94 write(*,*)
' should be placed before all step definitions' 107 if(textpart(i)(1:8).eq.
'REFNODE=')
then 108 read(textpart(i)(9:18),
'(i10)',iostat=istat) irefnode
109 if(istat.gt.0)
call inputerror(inpc,ipoinpc,iline,
111 if(irefnode.gt.nk)
then 112 write(*,*)
'*ERROR reading *COUPLING: ref node',irefnode
113 write(*,*)
' has not been defined' 116 else if(textpart(i)(1:8).eq.
'SURFACE=')
then 117 surfset(1:80)=textpart(i)(9:88)
119 ipos=index(surfset,
' ')
121 surfset(ipos:ipos)=surfkind
123 if(set(j).eq.surfset)
exit 127 surfset(ipos:ipos)=surfkind
129 if(set(j).eq.surfset)
exit 132 write(*,*)
'*ERROR reading *COUPLING:' 133 write(*,*)
' surface ',surfset
134 write(*,*)
' has not yet been defined.' 139 elseif(textpart(i)(1:12).eq.
'ORIENTATION=')
then 140 orientation=textpart(i)(13:92)
141 elseif(textpart(i)(1:15).eq.
'CONSTRAINTNAME=')
then 142 name(1:117)=textpart(i)(16:132)
145 &
'*WARNING reading *COUPLING: parameter not recognized:' 147 & textpart(i)(1:index(textpart(i),
' ')-1)
153 if(name(1:1).eq.
' ')
then 155 &
'*ERROR reading *COUPLING: no CONTRAINT NAME given' 162 if(orientation.eq.
' ')
then 166 if(orname(i).eq.orientation)
exit 170 &
'*ERROR reading *COUPLING: nonexistent orientation' 181 call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
182 & ipoinp,inp,ipoinpc)
183 if(textpart(1)(2:10).eq.
'KINEMATIC')
then 189 do j=istartset(jsurf),iendset(jsurf)
190 if(ialset(j).gt.0)
then 191 if(surfkind.eq.
'T')
then 200 if(lakon(nelem)(4:5).eq.
'20')
then 202 elseif(lakon(nelem)(4:4).eq.
'2')
then 204 elseif(lakon(nelem)(4:4).eq.
'8')
then 206 elseif(lakon(nelem)(4:5).eq.
'10')
then 208 elseif(lakon(nelem)(4:4).eq.
'4')
then 212 if(lakon(nelem)(4:4).eq.
'6')
then 219 if(lakon(nelem)(4:5).eq.
'15')
then 234 if(surfkind.eq.
'T')
then 235 if((lakon(nelem)(4:4).eq.
'2').or.
236 & (lakon(nelem)(4:4).eq.
'8'))
then 237 node=kon(indexe+ifaceq(m,jface))
238 elseif((lakon(nelem)(4:4).eq.
'4').or.
239 & (lakon(nelem)(4:5).eq.
'10'))
then 240 node=kon(indexe+ifacet(m,jface))
241 elseif(lakon(nelem)(4:4).eq.
'6')
then 242 node=kon(indexe+ifacew1(m,jface))
243 elseif(lakon(nelem)(4:5).eq.
'15')
then 244 node=kon(indexe+ifacew2(m,jface))
252 if(ics(1,id).eq.node)
then 273 if(k.ge.ialset(j-1))
exit 277 if(ics(1,id).eq.node)
then 302 &
'*ERROR reading *KINEMATIC: increase nk_' 307 co(l,nk)=co(l,irefnode)
317 if(nmpc.gt.nmpc_)
then 319 &
'*ERROR reading *KINEMATIC: increase nmpc_' 326 labmpc(nmpc)=
'ROTTRACOUPLING ' 327 idof=8*(irefnode-1)+k+3
328 call nident(ikmpc,idof,nmpc-1,id)
336 nodempc(1,mpcfree)=irefnode
337 nodempc(2,mpcfree)=k+4
338 coefmpc(mpcfree)=1.d0
339 mpcfree=nodempc(3,mpcfree)
341 nodempc(1,mpcfree)=irotnode_kin
343 coefmpc(mpcfree)=-1.d0
345 mpcfree=nodempc(3,mpcfree)
346 nodempc(3,mpcfreeold)=0
349 if(iorientation.gt.0)
then 358 &
'*ERROR reading *KINEMATIC: increase nk_' 363 co(k,nk)=co(k,ics(1,m))
368 call rigidmpc(ipompc,nodempc,coefmpc,irefnode,
370 & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,nk,nk_,
371 & nodeboun,ndirboun,ikboun,ilboun,nboun,nboun_,node,
372 & typeboun,co,ibounstart,ibounend)
379 call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
380 & ipoinp,inp,ipoinpc)
381 if((istat.lt.0).or.(key.eq.1))
return 383 read(textpart(1)(1:10),
'(i10)',iostat=istat) ibounstart
384 if(istat.gt.0)
call inputerror(inpc,ipoinpc,iline,
386 if(ibounstart.lt.1)
then 387 write(*,*)
'*ERROR reading *KINEMATIC' 388 write(*,*)
' starting degree of freedom cannot' 389 write(*,*)
' be less than 1' 396 if(textpart(2)(1:1).eq.
' ')
then 399 read(textpart(2)(1:10),
'(i10)',iostat=istat) ibounend
400 if(istat.gt.0)
call inputerror(inpc,ipoinpc,iline,
403 if(ibounend.gt.3)
then 404 write(*,*)
'*ERROR reading *KINEMATIC' 405 write(*,*)
' final degree of freedom cannot' 406 write(*,*)
' exceed 3' 411 elseif(ibounend.lt.ibounstart)
then 412 write(*,*)
'*ERROR reading *KINEMATIC' 413 write(*,*)
' initial degree of freedom cannot' 414 write(*,*)
' exceed final degree of freedom' 423 if(iorientation.eq.0)
then 429 call rigidmpc(ipompc,nodempc,coefmpc,irefnode,
431 & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,nk,nk_,
432 & nodeboun,ndirboun,ikboun,ilboun,nboun,nboun_,
433 & node,typeboun,co,ibounstart,ibounend)
443 call mpcadd(node,ibounstart,ibounend,nboun,ipompc,
444 & nodempc,coefmpc,nmpc,nmpc_,mpcfree,orab,ikboun,
445 & ikmpc,ilmpc,co,labmpc,label,idupnode,
450 elseif(textpart(1)(2:13).eq.
'DISTRIBUTING')
then 451 if(surfkind.eq.
'S')
then 452 write(*,*)
'*ERROR reading *DISTRIBUTING' 453 write(*,*)
' a nodal surface is not allowed' 454 write(*,*)
' please use a facial surface on' 455 write(*,*)
' the *COUPLING card' 465 do k=istartset(jsurf),iendset(jsurf)
477 if(lakon(nelem)(4:4).eq.
'2')
then 480 elseif(lakon(nelem)(3:4).eq.
'D8')
then 483 elseif(lakon(nelem)(4:5).eq.
'10')
then 487 elseif(lakon(nelem)(4:4).eq.
'4')
then 491 elseif(lakon(nelem)(4:5).eq.
'15')
then 499 elseif(lakon(nelem)(3:4).eq.
'D6')
then 515 nodef(i)=kon(indexe+ifacet(i,jface))
517 elseif(nface.eq.5)
then 520 nodef(i)=kon(indexe+ifacew1(i,jface))
522 elseif(nope.eq.15)
then 524 nodef(i)=kon(indexe+ifacew2(i,jface))
527 elseif(nface.eq.6)
then 529 nodef(i)=kon(indexe+ifaceq(i,jface))
541 if(ics(1,id).eq.node)
then 562 if(lakon(nelem)(3:5).eq.
'D8R')
then 564 elseif(lakon(nelem)(3:4).eq.
'D8')
then 566 elseif(lakon(nelem)(4:6).eq.
'20R')
then 568 elseif(lakon(nelem)(4:4).eq.
'2')
then 570 elseif(lakon(nelem)(4:5).eq.
'10')
then 572 elseif(lakon(nelem)(4:4).eq.
'4')
then 574 elseif(lakon(nelem)(3:4).eq.
'D6')
then 576 elseif(lakon(nelem)(4:5).eq.
'15')
then 587 xl2(j,i)=co(j,nodef(i))
592 if((lakon(nelem)(3:5).eq.
'D8R').or.
593 & ((lakon(nelem)(3:4).eq.
'D6').and.(nopes.eq.4)))
then 597 elseif((lakon(nelem)(3:4).eq.
'D8').or.
598 & (lakon(nelem)(4:6).eq.
'20R').or.
599 & ((lakon(nelem)(4:5).eq.
'15').and.
600 & (nopes.eq.8)))
then 604 elseif(lakon(nelem)(4:4).eq.
'2')
then 608 elseif((lakon(nelem)(4:5).eq.
'10').or.
609 & ((lakon(nelem)(4:5).eq.
'15').and.
610 & (nopes.eq.6)))
then 614 elseif((lakon(nelem)(4:4).eq.
'4').or.
615 & ((lakon(nelem)(3:4).eq.
'D6').and.
616 & (nopes.eq.3)))
then 623 call shape8q(xi,et,xl2,xsj2,xs2,shp2,iflag)
624 elseif(nopes.eq.4)
then 625 call shape4q(xi,et,xl2,xsj2,xs2,shp2,iflag)
626 elseif(nopes.eq.6)
then 627 call shape6tri(xi,et,xl2,xsj2,xs2,shp2,iflag)
628 elseif(nopes.eq.3)
then 629 call shape3tri(xi,et,xl2,xsj2,xs2,shp2,iflag)
634 xsj=weight*dsqrt(xsj2(1)**2+xsj2(2)**2+xsj2(3)**2)
637 areanodal(i)=areanodal(i)+xsj*shp2(4,i)
647 dcs(id)=dcs(id)+areanodal(i)
667 &
'*ERROR reading *DISTRIBUTING: increase nk_' 682 cgx(k)=cgx(k)+dcs(m)*co(k,node)
685 if(nmpc.gt.nmpc_)
then 687 &
'*ERROR reading *DISTRIBUTING: increase nmpc_' 699 call nident(ikmpc,idof,nmpc-1,id)
701 if(ikmpc(id).eq.idof)
then 702 write(*,*)
'*ERROR in couplings: dof',k
703 write(*,*)
' in node ',node
704 write(*,*)
' was already used' 717 nodempc(1,mpcfree)=node
719 coefmpc(mpcfree)=1.d0
720 mpcfree=nodempc(3,mpcfree)
722 nodempc(1,mpcfree)=nk
724 coefmpc(mpcfree)=-area/(npt*dcs(m))
726 mpcfree=nodempc(3,mpcfree)
727 nodempc(3,mpcfreeold)=0
740 call nident(ikmpc,idof,nmpc,id)
743 if(nmpc.gt.nmpc_)
then 744 write(*,*)
'*ERROR in equations: increase nmpc_' 761 nodempc(1,mpcfree)=node
763 coefmpc(mpcfree)=1.d0
764 mpcfree=nodempc(3,mpcfree)
766 nodempc(1,mpcfree)=irefnode
768 coefmpc(mpcfree)=-npt
770 mpcfree=nodempc(3,mpcfree)
771 nodempc(3,mpcfreeold)=0
781 call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
782 & ipoinp,inp,ipoinpc)
783 if((istat.lt.0).or.(key.eq.1))
return 785 read(textpart(1)(1:10),
'(i10)',iostat=istat) ibounstart
786 if(istat.gt.0)
call inputerror(inpc,ipoinpc,iline,
788 if(ibounstart.lt.1)
then 789 write(*,*)
'*ERROR reading *KINEMATIC' 790 write(*,*)
' starting degree of freedom cannot' 791 write(*,*)
' be less than 1' 798 if(textpart(2)(1:1).eq.
' ')
then 801 read(textpart(2)(1:10),
'(i10)',iostat=istat) ibounend
802 if(istat.gt.0)
call inputerror(inpc,ipoinpc,iline,
806 ibounstart=
max(4,ibounstart)
807 if(ibounend.gt.6)
then 808 write(*,*)
'*ERROR reading *DISTRIBUTING' 809 write(*,*)
' final degree of freedom cannot' 810 write(*,*)
' exceed 6' 815 elseif(ibounend.lt.ibounstart)
then 819 if((ibounend.gt.3).and.(irotnode(1).eq.0))
then 824 if(iorientation.ne.0)
then 825 if(orab(7,iorientation).lt.0.d0)
then 826 write(*,*)
'*ERROR reading *DISTRIBUTING' 827 write(*,*)
' a cylindrical local coordinate' 828 write(*,*)
' system is not allowed' 842 &
'*ERROR reading *DISTRIBUTING: increase nk_' 847 co(l,nk)=co(l,irefnode)
858 if(nmpc.gt.nmpc_)
then 860 &
'*ERROR reading *DISTRIBUTING: increase nmpc_' 867 labmpc(nmpc)=
'ROTTRACOUPLING ' 868 idof=8*(irefnode-1)+k+3
869 call nident(ikmpc,idof,nmpc-1,id)
877 nodempc(1,mpcfree)=irefnode
878 nodempc(2,mpcfree)=k+4
879 coefmpc(mpcfree)=1.d0
880 mpcfree=nodempc(3,mpcfree)
882 nodempc(1,mpcfree)=irotnode(k)
884 coefmpc(mpcfree)=-1.d0
886 mpcfree=nodempc(3,mpcfree)
887 nodempc(3,mpcfreeold)=0
895 &
'*ERROR reading *DISTRIBUTING: increase nk_' 910 do kk=ibounstart,ibounend
915 if(iorientation.eq.0)
then 930 co(j,irotnode(k))=aa(j)
934 if(nmpc.gt.nmpc_)
then 936 &
'*ERROR reading *DISTRIBUTING: increase nmpc_' 941 labmpc(nmpc)=
'MEANROTDISTRIB ' 947 nodempc(1,mpcfree)=ics(1,m)
949 coefmpc(mpcfree)=0.d0
950 mpcfree=nodempc(3,mpcfree)
953 nodempc(1,mpcfree)=irotnode(k)
955 coefmpc(mpcfree)=0.d0
956 mpcfree=nodempc(3,mpcfree)
957 nodempc(1,mpcfree)=inhomnode
959 coefmpc(mpcfree)=0.d0
961 mpcfree=nodempc(3,mpcfree)
962 nodempc(3,mpcfreeold)=0
967 idof=8*(inhomnode-1)+k
968 call nident(ikboun,idof,nboun,id)
970 if(nboun.gt.nboun_)
then 971 write(*,*)
'*ERROR in usermpc: increase nboun_' 974 nodeboun(nboun)=inhomnode
979 ikboun(l)=ikboun(l-1)
980 ilboun(l)=ilboun(l-1)
991 node=nodempc(1,index2)
992 if(node.eq.irotnode(k))
exit 997 pi(j)=co(j,node)-cgx(j)
1002 c1=pi(1)*aa(1)+pi(2)*aa(2)+pi(3)*aa(3)
1004 pi(j)=pi(j)-
c1*aa(j)
1007 c1=pi(1)*pi(1)+pi(2)*pi(2)+pi(3)*pi(3)
1008 if(
c1.lt.1.d-20)
then 1010 &
'*WARNING reading *DISTRIBUTING: node ',node
1011 write(*,*)
' is very close to the ' 1012 write(*,*)
' rotation axis through the' 1013 write(*,*)
' center of gravity of' 1014 write(*,*)
' the nodal cloud in a' 1015 write(*,*)
' mean rotation MPC.' 1016 write(*,*)
' This node is not taken' 1017 write(*,*)
' into account in the MPC' 1018 index2=nodempc(3,nodempc(3,nodempc(3,index2)))
1024 c4=aa(2)*pi(3)-aa(3)*pi(2)
1026 c4=aa(3)*pi(1)-aa(1)*pi(3)
1028 c4=aa(1)*pi(2)-aa(2)*pi(1)
1034 node1=nodempc(1,index1)
1035 if(node1.eq.irotnode(k))
exit 1036 if(node1.eq.node)
then 1037 c10=c9*(1.d0-1.d0/
real(npt))
1042 coefmpc(index1)=coefmpc(index1)+c10
1044 coefmpc(nodempc(3,index1))=
1045 & coefmpc(nodempc(3,index1))+c10
1047 coefmpc(nodempc(3,nodempc(3,index1)))=
1048 & coefmpc(nodempc(3,nodempc(3,index1)))+c10
1051 & nodempc(3,nodempc(3,nodempc(3,index1)))
1054 index2=nodempc(3,nodempc(3,nodempc(3,index2)))
1056 coefmpc(index2)=-npt
1066 index2=nodempc(3,index2)
1067 if(nodempc(1,index2).eq.irotnode(k))
exit 1081 coef(1)=coefmpc(index2)
1082 coef(2)=coefmpc(nodempc(3,index2))
1083 coef(3)=coefmpc(nodempc(3,nodempc(3,index2)))
1088 if(dabs(coefmpc(index2)).gt.amax)
then 1089 idir=nodempc(2,index2)
1091 if(dabs(coefmpc(index2)-coef(idir)).lt.1.d-10)
then 1092 index2=nodempc(3,index2)
1096 node=nodempc(1,index2)
1097 idof=8*(node-1)+idir
1101 call nident(ikmpc,idof,nmpc-1,id)
1103 if(ikmpc(id).eq.idof)
then 1104 index2=nodempc(3,index2)
1111 call nident(ikboun,idof,nboun,id)
1113 if(ikboun(id).eq.idof)
then 1114 index2=nodempc(3,index2)
1119 amax=dabs(coefmpc(index2))
1128 if((i/3)*3.eq.i)
then 1129 if(indexmax.ne.0)
exit 1132 index2=nodempc(3,index2)
1135 if(indexmax.eq.0)
then 1137 &
'*WARNING reading *DISTRIBUTING: no MPC is ' 1138 write(*,*)
' generated for the mean' 1139 write(*,*)
' rotation in node ',irefnode
1140 write(*,*)
' and direction ',kk
1155 if(nodempc(3,index2).ne.0)
then 1156 index2=nodempc(3,index2)
1158 nodempc(3,index2)=mpcfreeold
1170 nodemax=nodempc(1,indexmax)
1171 idirmax=nodempc(2,indexmax)
1174 nodeold=nodempc(1,index2)
1175 idirold=nodempc(2,index2)
1179 if(nodemax.ne.nodeold)
then 1182 indexold(2)=nodempc(3,index2)
1183 indexold(3)=nodempc(3,indexold(2))
1185 index2=nodempc(3,indexold(3))
1187 if(nodempc(1,index2).eq.irotnode(k))
exit 1188 if(nodempc(1,index2).eq.nodemax)
then 1189 if(nodempc(2,index2).eq.1)
then 1191 elseif(nodempc(2,index2).eq.2)
then 1197 index2=nodempc(3,index2)
1201 node=nodempc(1,indexold(j))
1202 idir=nodempc(2,indexold(j))
1203 xcoef=coefmpc(indexold(j))
1204 nodempc(1,indexold(j))=nodempc(1,indexnew(j))
1205 nodempc(2,indexold(j))=nodempc(2,indexnew(j))
1206 coefmpc(indexold(j))=coefmpc(indexnew(j))
1207 nodempc(1,indexnew(j))=node
1208 nodempc(2,indexnew(j))=idir
1209 coefmpc(indexnew(j))=xcoef
1216 if(idirmax.ne.1)
then 1218 if(idirmax.eq.2)
then 1219 indexnew(1)=nodempc(3,index2)
1221 indexnew(1)=nodempc(3,nodempc(3,index2))
1225 idir=nodempc(2,indexold(j))
1226 xcoef=coefmpc(indexold(j))
1227 nodempc(2,indexold(j))=nodempc(2,indexnew(j))
1228 coefmpc(indexold(j))=coefmpc(indexnew(j))
1229 nodempc(2,indexnew(j))=idir
1230 coefmpc(indexnew(j))=xcoef
1236 idof=8*(nodemax-1)+idirmax
1237 call nident(ikmpc,idof,nmpc-1,id)
1249 &
'*ERROR reading *COUPLING: the line following' 1250 write(*,*)
' *COUPLING must contain the' 1251 write(*,*)
' *KINEMATIC keyword or the' 1252 write(*,*)
' *DISTRIBUTING keyword' subroutine shape8q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape8q.f:20
#define max(a, b)
Definition: cascade.c:32
subroutine shape3tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape3tri.f:20
subroutine nident2(x, px, n, id)
Definition: nident2.f:27
subroutine mpcadd(nodedep, is, ie, nboun, ipompc, nodempc, coefmpc, nmpc, nmpc_, mpcfree, orab, ikboun, ikmpc, ilmpc, co, labmpc, label, nodeind, iorientation)
Definition: mpcadd.f:22
static double * c1
Definition: mafillvcompmain.c:30
subroutine shape4q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape4q.f:20
subroutine getnewline(inpc, textpart, istat, n, key, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: getnewline.f:21
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine rigidmpc(ipompc, nodempc, coefmpc, irefnode, irotnode, labmpc, nmpc, nmpc_, mpcfree, ikmpc, ilmpc, nk, nk_, nodeboun, ndirboun, ikboun, ilboun, nboun, nboun_, node, typeboun, co, jmin, jmax)
Definition: rigidmpc.f:22
subroutine shape6tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape6tri.f:20