32 character*1 type,typeboun(*)
34 character*20 labmpc(*),label
36 integer ikboun(*),ilboun(*),nboun,nboun_,nodeboun(*),nodeact,
37 & ndirboun(*),idim,ier,matz,ncgnodes,lstart,lend,linc,nnodes,
38 & iamboun(*),iponoel(*),inoel(3,*),iponoelmax,kon(*),ipkon(*),ne,
39 & iponor(2,*),knor(*),ipompc(*),nodempc(3,*),nmpc,nmpc_,mpcfree,
40 & ikmpc(*),ilmpc(*),rig(*),ntrans,inotr(2,*),nbounold,i,node,
41 & index,ielem,j,indexe,indexk,idir,iamplitude,irotnode,nk,nk_,
42 & newnode,idof,id,mpcfreenew,k,nam,nmethod,iperturb,ndepnodes,
43 & idepnodes(80),l,iexpnode,indexx,irefnode,imax,isol,mpcfreeold,
44 & nod,impc,istep,nrhs,ipiv(3),info,m,mi(*),itr,idirref,id1,nnode
46 real*8 xboun(*),xnor(*),coefmpc(*),trab(7,*),val,co(3,*),
47 & xnoref(3),dmax,d(3,3),e(3,3,3),alpha,q(3),w(3),xn(3),
48 & a1(3),a2(3),dd,
c1,c2,c3,ww,c(3,3),vold(0:mi(2),*),a(3,3),
49 & e1(3),e2(3),t1(3),b(3,3),x(3),y(3),fv1(3),dot,
50 & fv2(3),z(3,3),xi1,xi2,xi3,u(3,3),r(3,3),xnode
52 data d /1.,0.,0.,0.,1.,0.,0.,0.,1./
53 data e /0.,0.,0.,0.,0.,-1.,0.,1.,0.,
54 & 0.,0.,1.,0.,0.,0.,-1.,0.,0.,
55 & 0.,-1.,0.,1.,0.,0.,0.,0.,0./
63 if(node.gt.iponoelmax)
then 99 indexk=iponor(2,indexe+j)
102 if(nam.gt.0) iamplitude=iamboun(i)
104 if(rig(node).ne.0)
then 109 if(rig(node).lt.0)
then 110 write(*,*)
'*ERROR in gen3dboun: in node ',node
111 write(*,*)
' a rotational DOF is constrained' 112 write(*,*)
' by a SPC; however, the elements' 113 write(*,*)
' to which this node belongs do not' 114 write(*,*)
' have rotational DOFs' 120 call bounadd(irotnode,j,j,val,nodeboun,
121 & ndirboun,xboun,nboun,nboun_,iamboun,
122 & iamplitude,nam,ipompc,nodempc,coefmpc,
123 & nmpc,nmpc_,mpcfree,inotr,trab,ntrans,
124 & ikboun,ilboun,ikmpc,ilmpc,co,nk,nk_,labmpc,
125 &
type,typeboun,nmethod,iperturb,fixed,vold,
140 if((idir.gt.3).and.((nmethod.eq.4).and.(iperturb.gt.1)))
then 145 if(lakon(ielem)(7:7).eq.
'L')
then 147 ndepnodes=ndepnodes+1
148 idepnodes(ndepnodes)=knor(indexk+k)
151 elseif(lakon(ielem)(7:7).eq.
'B')
then 153 ndepnodes=ndepnodes+1
154 idepnodes(ndepnodes)=knor(indexk+k)
159 &
'*ERROR in gen3dboun: a rotational DOF was applied' 161 &
'* to node',node,
' without rotational DOFs' 172 call nident(ikmpc,idof,nmpc,id)
174 if(ikmpc(id).eq.idof)
then 176 call mpcrem(impc,mpcfree,nodempc,nmpc,
177 & ikmpc,ilmpc,labmpc,coefmpc,ipompc)
188 write(*,*)
'*ERROR in rigidbodies: increase nk_' 195 write(*,*)
'*ERROR in rigidbodies: increase nk_' 200 call knotmpc(ipompc,nodempc,coefmpc,irefnode,
202 & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,nk,nk_,
203 & nodeboun,ndirboun,ikboun,ilboun,nboun,nboun_,
204 & idepnodes,typeboun,co,xboun,istep,k,ndepnodes,
215 if(ndepnodes.eq.3)
then 220 w(l)=w(l)+vold(l,nod)
232 w(l)=w(l)+vold(l,nod)
243 dd=dsqrt(w(1)*w(1)+w(2)*w(2)+w(3)*w(3))
244 if(dd.lt.1.d-20)
then 246 vold(l,irefnode)=0.d0
247 vold(l,irotnode)=0.d0
248 vold(l,iexpnode)=0.d0
258 dd=(co(1,nod)-q(1))**2
259 & +(co(2,nod)-q(2))**2
260 & +(co(3,nod)-q(3))**2
261 if(dd.lt.1.d-20)
then 266 & ((co(1,nod)+vold(1,nod)-q(1)-w(1))**2
267 & +(co(2,nod)+vold(2,nod)-q(2)-w(2))**2
268 & +(co(3,nod)+vold(3,nod)-q(3)-w(3))**2)/dd)
270 if(ndepnodes-ncgnodes.gt.0)
then 271 alpha=alpha/(ndepnodes-ncgnodes)
289 a2(l)=vold(l,nod)-w(l)
293 if(dd.lt.1.d-10)
then 301 xn(1)=xn(1)+(a1(2)*a2(3)-a1(3)*a2(2))
302 xn(2)=xn(2)+(a1(3)*a2(1)-a1(1)*a2(3))
303 xn(3)=xn(3)+(a1(1)*a2(2)-a1(2)*a2(1))
306 if(ndepnodes-ncgnodes.gt.0)
then 308 xn(l)=xn(l)/(ndepnodes-ncgnodes)
318 xn(l)=dasin(dd/alpha)*xn(l)/dd
323 ww=dsqrt(xn(1)*xn(1)+xn(2)*xn(2)+xn(3)*xn(3))
326 if(ww.gt.1.d-10)
then 342 & c2*(e(k,1,l)*xn(1)+e(k,2,l)*xn(2)+
343 & e(k,3,l)*xn(3))+c3*xn(k)*xn(l)
350 vold(l,irefnode)=w(l)
351 vold(l,irotnode)=xn(l)
353 vold(1,iexpnode)=alpha-1.d0
375 if(lakon(ielem)(7:7).eq.
'L')
then 379 elseif(lakon(ielem)(7:7).eq.
'B')
then 389 elseif(inotr(1,node).eq.0)
then 404 y(l)=x(l)+vold(l,nod)-w(l)
408 c(l,m)=c(l,m)+x(l)*x(m)
409 b(l,m)=b(l,m)+x(l)*y(m)
418 call dgesv(m,nrhs,c,m,ipiv,b,m,info)
420 write(*,*)
'*ERROR in gen3dforc:' 421 write(*,*)
' singular system of equations' 432 u(l,m)=b(l,1)*r(1,m)+b(l,2)*r(2,m)+
445 call rs(m,m,u,w,matz,z,fv1,fv2,ier)
448 &
'*ERROR in knotmpc while calculating the' 449 write(*,*)
' eigenvalues/eigenvectors' 453 if((dabs(w(1)-1.d0).lt.dabs(w(2)-1.d0)).and.
454 & (dabs(w(1)-1.d0).lt.dabs(w(3)-1.d0)))
then 457 elseif((dabs(w(2)-1.d0).lt.dabs(w(1)-1.d0)).and.
458 & (dabs(w(2)-1.d0).lt.dabs(w(3)-1.d0)))
then 466 & ((z(1,l)*e2(1)+z(2,l)*e2(2)+z(3,l)*e2(2)),
467 & (z(1,l)*e1(1)+z(2,l)*e1(2)+z(3,l)*e1(2)))
481 call bounadd(irotnode,idir,idir,val,nodeboun,
482 & ndirboun,xboun,nboun,nboun_,iamboun,
483 & iamplitude,nam,ipompc,nodempc,coefmpc,
484 & nmpc,nmpc_,mpcfree,inotr,trab,ntrans,
485 & ikboun,ilboun,ikmpc,ilmpc,co,nk,nk_,labmpc,
486 &
type,typeboun,nmethod,iperturb,fixed,vold,
492 if(lakon(ielem)(7:7).eq.
'L')
then 493 indexx=iponor(1,indexe+j)
495 xnoref(j)=xnor(indexx+j)
500 if(dabs(xnoref(j)).gt.dmax)
then 508 if(dabs(1.d0-dmax).lt.1.d-3)
then 510 if(nam.gt.0) iamplitude=0
512 call bounadd(irotnode,imax,imax,val,nodeboun,
513 & ndirboun,xboun,nboun,nboun_,iamboun,
514 & iamplitude,nam,ipompc,nodempc,coefmpc,
515 & nmpc,nmpc_,mpcfree,inotr,trab,ntrans,
516 & ikboun,ilboun,ikmpc,ilmpc,co,nk,nk_,labmpc,
517 &
type,typeboun,nmethod,iperturb,fixed,vold,
525 idof=8*(node-1)+3+imax
526 call nident(ikboun,idof,nboun,id)
527 if((id.gt.0).and.(ikboun(id).eq.idof))
then 529 if(imax.gt.3) imax=imax-3
542 idof=8*(irotnode-1)+imax
543 call nident(ikmpc,idof,nmpc,id)
545 if(nmpc.gt.nmpc_)
then 547 &
'*ERROR in gen3dboun: increase nmpc_' 561 nodempc(1,mpcfree)=irotnode
562 nodempc(2,mpcfree)=imax
563 coefmpc(mpcfree)=xnoref(imax)
564 mpcfree=nodempc(3,mpcfree)
566 if(imax.gt.3) imax=imax-3
567 nodempc(1,mpcfree)=irotnode
568 nodempc(2,mpcfree)=imax
569 coefmpc(mpcfree)=xnoref(imax)
570 mpcfree=nodempc(3,mpcfree)
572 if(imax.gt.3) imax=imax-3
573 nodempc(1,mpcfree)=irotnode
574 nodempc(2,mpcfree)=imax
575 coefmpc(mpcfree)=xnoref(imax)
577 mpcfree=nodempc(3,mpcfree)
578 nodempc(3,mpcfreeold)=0
593 if((idir.gt.3).and.((nmethod.ne.4).or.(iperturb.le.1)))
then 604 call nident(ikboun,idof,nboun,id)
605 if(ilboun(id).ne.i) cycle
609 if(lakon(ielem)(7:7).eq.
'L')
then 618 xn(j)=co(j,knor(indexk+3))-co(j,knor(indexk+1))
620 dd=dsqrt(xn(1)*xn(1)+xn(2)*xn(2)+xn(3)*xn(3))
625 elseif(lakon(ielem)(7:7).eq.
'B')
then 635 elseif(inotr(1,node).eq.0)
then 657 if(lakon(ielem)(7:7).eq.
'L')
then 658 dot=a(1,idirref)*xn(1)+a(2,idirref)*xn(2)+
667 if(dabs(dot).gt.0.05)
then 668 if(xboun(i).gt.1.d-10)
then 669 write(*,*)
'*ERROR in gen3dboun: rotation' 670 write(*,*)
' vector in node ',node
671 write(*,*)
' and direction ',idir-1
672 write(*,*)
' has a significant' 674 &
' component along the drilling' 675 write(*,*)
' direction and a nonzero' 676 write(*,*)
' boundary value; this is not' 677 write(*,*)
' allowed' 685 if(dabs(dot).gt.0.70710678d0) cycle
690 a(k,idirref)=a(k,idirref)-dot*xn(k)
694 dd=dd+a(k,idirref)**2
698 a(k,idirref)=a(k,idirref)/dd
707 do j=lstart,lend,linc
708 nodeact=knor(indexk+j)
711 call usermpc(ipompc,nodempc,coefmpc,
712 & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
713 & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
714 & nboun,nboun_,nnodes,nodeact,co,label,
715 & typeboun,iperturb,node,idirref,xboun)
723 co(k,nodeact)=a(k,idirref)
726 call usermpc(ipompc,nodempc,coefmpc,
727 & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
728 & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
729 & nboun,nboun_,nnodes,nodeact,co,label,
730 & typeboun,iperturb,node,idirref,xboun)
735 call usermpc(ipompc,nodempc,coefmpc,
736 & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
737 & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
738 & nboun,nboun_,nnodes,nodeact,co,label,
739 & typeboun,iperturb,node,idirref,xboun)
745 if(nodeact.ne.-1)
then 748 call bounadd(nk,idir,idir,val,nodeboun,
749 & ndirboun,xboun,nboun,nboun_,iamboun,
750 & iamplitude,nam,ipompc,nodempc,coefmpc,
751 & nmpc,nmpc_,mpcfree,inotr,trab,ntrans,
752 & ikboun,ilboun,ikmpc,ilmpc,co,nk,nk_,labmpc,
753 &
type,typeboun,nmethod,iperturb,fixed,vold,
772 if(lakon(ielem)(7:7).eq.
'L')
then 773 newnode=knor(indexk+1)
774 idof=8*(newnode-1)+idir
775 call nident(ikmpc,idof,nmpc,id)
776 if((id.le.0).or.(ikmpc(id).ne.idof))
then 778 if(nmpc.gt.nmpc_)
then 780 &
'*ERROR in gen3dboun: increase nmpc_' 791 nodempc(1,mpcfree)=newnode
792 nodempc(2,mpcfree)=idir
793 coefmpc(mpcfree)=1.d0
794 mpcfree=nodempc(3,mpcfree)
795 if(mpcfree.eq.0)
then 797 &
'*ERROR in gen3dboun: increase memmpc_' 800 nodempc(1,mpcfree)=knor(indexk+3)
801 nodempc(2,mpcfree)=idir
802 coefmpc(mpcfree)=1.d0
803 mpcfree=nodempc(3,mpcfree)
804 if(mpcfree.eq.0)
then 806 &
'*ERROR in gen3dboun: increase memmpc_' 809 nodempc(1,mpcfree)=node
810 nodempc(2,mpcfree)=idir
811 coefmpc(mpcfree)=-2.d0
812 mpcfreenew=nodempc(3,mpcfree)
813 if(mpcfreenew.eq.0)
then 815 &
'*ERROR in gen3dboun: increase memmpc_' 824 newnode=knor(indexk+2)
825 idof=8*(newnode-1)+idir
826 call nident(ikmpc,idof,nmpc,id)
827 if((id.le.0).or.(ikmpc(id).ne.idof))
then 829 if(nmpc.gt.nmpc_)
then 831 &
'*ERROR in gen3dboun: increase nmpc_' 842 nodempc(1,mpcfree)=newnode
843 nodempc(2,mpcfree)=idir
844 coefmpc(mpcfree)=1.d0
845 mpcfree=nodempc(3,mpcfree)
846 if(mpcfree.eq.0)
then 848 &
'*ERROR in gen3dboun: increase memmpc_' 851 nodempc(1,mpcfree)=node
852 nodempc(2,mpcfree)=idir
853 coefmpc(mpcfree)=-1.d0
854 mpcfreenew=nodempc(3,mpcfree)
855 if(mpcfreenew.eq.0)
then 857 &
'*ERROR in gen3dboun: increase memmpc_' 870 newnode=knor(indexk+3)
871 idof=8*(newnode-1)+idir
872 call nident(ikmpc,idof,nmpc,id)
873 if((id.le.0).or.(ikmpc(id).ne.idof))
then 875 if(nmpc.gt.nmpc_)
then 877 &
'*ERROR in gen3dboun: increase nmpc_' 888 nodempc(1,mpcfree)=newnode
889 nodempc(2,mpcfree)=idir
890 coefmpc(mpcfree)=1.d0
891 mpcfree=nodempc(3,mpcfree)
892 if(mpcfree.eq.0)
then 894 &
'*ERROR in gen3dboun: increase memmpc_' 897 nodempc(1,mpcfree)=node
898 nodempc(2,mpcfree)=idir
899 coefmpc(mpcfree)=-1.d0
900 mpcfreenew=nodempc(3,mpcfree)
901 if(mpcfreenew.eq.0)
then 903 &
'*ERROR in gen3dboun: increase memmpc_' 910 elseif(lakon(ielem)(7:7).eq.
'B')
then 918 newnode=knor(indexk+1)
919 idof=8*(newnode-1)+idir
920 call nident(ikmpc,idof,nmpc,id)
921 if((id.le.0).or.(ikmpc(id).ne.idof))
then 923 if(nmpc.gt.nmpc_)
then 925 &
'*ERROR in gen3dboun: increase nmpc_' 936 nodempc(1,mpcfree)=newnode
937 nodempc(2,mpcfree)=idir
938 coefmpc(mpcfree)=1.d0
939 mpcfree=nodempc(3,mpcfree)
940 if(mpcfree.eq.0)
then 942 &
'*ERROR in gen3dboun: increase memmpc_' 946 nodempc(1,mpcfree)=knor(indexk+k)
947 nodempc(2,mpcfree)=idir
948 coefmpc(mpcfree)=1.d0
949 mpcfree=nodempc(3,mpcfree)
950 if(mpcfree.eq.0)
then 952 &
'*ERROR in gen3dboun: increase memmpc_' 956 nodempc(1,mpcfree)=node
957 nodempc(2,mpcfree)=idir
958 coefmpc(mpcfree)=-xnode
959 mpcfreenew=nodempc(3,mpcfree)
960 if(mpcfreenew.eq.0)
then 962 &
'*ERROR in gen3dboun: increase memmpc_' 976 newnode=knor(indexk+k)
977 idof=8*(newnode-1)+idir
978 call nident(ikmpc,idof,nmpc,id)
979 if((id.le.0).or.(ikmpc(id).ne.idof))
then 981 if(nmpc.gt.nmpc_)
then 983 &
'*ERROR in gen3dboun: increase nmpc_' 994 nodempc(1,mpcfree)=newnode
995 nodempc(2,mpcfree)=idir
996 coefmpc(mpcfree)=1.d0
997 mpcfree=nodempc(3,mpcfree)
998 if(mpcfree.eq.0)
then 1000 &
'*ERROR in gen3dboun: increase memmpc_' 1003 nodempc(1,mpcfree)=node
1004 nodempc(2,mpcfree)=idir
1005 coefmpc(mpcfree)=-1.d0
1006 mpcfreenew=nodempc(3,mpcfree)
1007 if(mpcfreenew.eq.0)
then 1009 &
'*ERROR in gen3dboun: increase memmpc_' 1012 nodempc(3,mpcfree)=0
1022 newnode=knor(indexk+2)
1023 idof=8*(newnode-1)+idir
1024 call nident(ikmpc,idof,nmpc,id)
1025 if(((id.le.0).or.(ikmpc(id).ne.idof)).and.
1028 if(nmpc.gt.nmpc_)
then 1030 &
'*ERROR in gen3dmpc: increase nmpc_' 1034 ipompc(nmpc)=mpcfree
1041 nodempc(1,mpcfree)=newnode
1042 nodempc(2,mpcfree)=idir
1043 coefmpc(mpcfree)=1.d0
1044 mpcfree=nodempc(3,mpcfree)
1045 if(mpcfree.eq.0)
then 1047 &
'*ERROR in gen3dmpc: increase memmpc_' 1050 nodempc(1,mpcfree)=node
1051 nodempc(2,mpcfree)=idir
1052 coefmpc(mpcfree)=-1.d0
1053 mpcfreenew=nodempc(3,mpcfree)
1054 if(mpcfreenew.eq.0)
then 1056 &
'*ERROR in gen3dmpc: increase memmpc_' 1059 nodempc(3,mpcfree)=0
subroutine knotmpc(ipompc, nodempc, coefmpc, irefnode, irotnode, iexpnode, labmpc, nmpc, nmpc_, mpcfree, ikmpc, ilmpc, nk, nk_, nodeboun, ndirboun, ikboun, ilboun, nboun, nboun_, idepnodes, typeboun, co, xboun, istep, k, ndepnodes, idim, e1, e2, t1)
Definition: knotmpc.f:24
subroutine rs(nm, n, a, w, matz, z, fv1, fv2, ierr)
Definition: rs.f:27
static double * c1
Definition: mafillvcompmain.c:30
subroutine dgesv(N, NRHS, A, LDA, IPIV, B, LDB, INFO)
Definition: dgesv.f:58
subroutine mpcrem(i, mpcfree, nodempc, nmpc, ikmpc, ilmpc, labmpc, coefmpc, ipompc)
Definition: mpcrem.f:21
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine usermpc(ipompc, nodempc, coefmpc, labmpc, nmpc, nmpc_, mpcfree, ikmpc, ilmpc, nk, nk_, nodeboun, ndirboun, ikboun, ilboun, nboun, nboun_, nnodes, node, co, label, typeboun, iperturb, noderef, idirref, xboun)
Definition: usermpc.f:23
subroutine bounadd(node, is, ie, val, nodeboun, ndirboun, xboun, nboun, nboun_, iamboun, iamplitude, nam, ipompc, nodempc, coefmpc, nmpc, nmpc_, mpcfree, inotr, trab, ntrans, ikboun, ilboun, ikmpc, ilmpc, co, nk, nk_, labmpc, type, typeboun, nmethod, iperturb, fixed, vold, nodetrue, mi, label)
Definition: bounadd.f:24