CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
rigidmpc.f File Reference

Go to the source code of this file.

Functions/Subroutines

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)
 

Function/Subroutine Documentation

◆ rigidmpc()

subroutine rigidmpc ( integer, dimension(*)  ipompc,
integer, dimension(3,*)  nodempc,
real*8, dimension(*)  coefmpc,
integer  irefnode,
integer  irotnode,
character*20, dimension(*)  labmpc,
integer  nmpc,
integer  nmpc_,
integer  mpcfree,
integer, dimension(*)  ikmpc,
integer, dimension(*)  ilmpc,
integer  nk,
integer  nk_,
integer, dimension(*)  nodeboun,
integer, dimension(*)  ndirboun,
integer, dimension(*)  ikboun,
integer, dimension(*)  ilboun,
integer  nboun,
integer  nboun_,
integer  node,
character*1, dimension(*)  typeboun,
real*8, dimension(3,*)  co,
integer  jmin,
integer  jmax 
)
22 !
23 ! generates three rigid body MPC's for node "node" about reference
24 ! (translational) node irefnode and rotational node irotnode
25 !
26  implicit none
27 !
28  character*1 typeboun(*)
29  character*20 labmpc(*)
30 !
31  integer ipompc(*),nodempc(3,*),nmpc,nmpc_,mpcfree,nk,nk_,
32  & ikmpc(*),jmin,jmax,
33  & ilmpc(*),node,id,mpcfreeold,j,idof,l,nodeboun(*),
34  & ndirboun(*),ikboun(*),ilboun(*),nboun,nboun_,irefnode,
35  & irotnode
36 !
37  real*8 coefmpc(*),co(3,*),e(3,3,3)
38 !
39  data e /0.,0.,0.,0.,0.,-1.,0.,1.,0.,
40  & 0.,0.,1.,0.,0.,0.,-1.,0.,0.,
41  & 0.,-1.,0.,1.,0.,0.,0.,0.,0./
42 !
43  nk=nk+1
44  if(nk.gt.nk_) then
45  write(*,*) '*ERROR in rigidmpc: increase nk_'
46  call exit(201)
47  endif
48 c do j=1,3
49  do j=jmin,jmax
50  idof=8*(node-1)+j
51  call nident(ikmpc,idof,nmpc,id)
52  if(id.gt.0) then
53  if(ikmpc(id).eq.idof) then
54  cycle
55  endif
56  endif
57  nmpc=nmpc+1
58  if(nmpc.gt.nmpc_) then
59  write(*,*) '*ERROR in rigidmpc: increase nmpc_'
60  call exit(201)
61  endif
62 !
63  ipompc(nmpc)=mpcfree
64  labmpc(nmpc)='RIGID '
65 !
66  do l=nmpc,id+2,-1
67  ikmpc(l)=ikmpc(l-1)
68  ilmpc(l)=ilmpc(l-1)
69  enddo
70  ikmpc(id+1)=idof
71  ilmpc(id+1)=nmpc
72 !
73  nodempc(1,mpcfree)=node
74  nodempc(2,mpcfree)=j
75  coefmpc(mpcfree)=1.d0
76  mpcfree=nodempc(3,mpcfree)
77 !
78 ! translation term
79 !
80  nodempc(1,mpcfree)=irefnode
81  nodempc(2,mpcfree)=j
82  coefmpc(mpcfree)=-1.d0
83  mpcfree=nodempc(3,mpcfree)
84 !
85 ! rotation terms
86 !
87  nodempc(1,mpcfree)=irotnode
88  nodempc(2,mpcfree)=1
89  coefmpc(mpcfree)=e(j,1,1)*(co(1,irefnode)-co(1,node))+
90  & e(j,1,2)*(co(2,irefnode)-co(2,node))+
91  & e(j,1,3)*(co(3,irefnode)-co(3,node))
92  mpcfree=nodempc(3,mpcfree)
93  nodempc(1,mpcfree)=irotnode
94  nodempc(2,mpcfree)=2
95  coefmpc(mpcfree)=e(j,2,1)*(co(1,irefnode)-co(1,node))+
96  & e(j,2,2)*(co(2,irefnode)-co(2,node))+
97  & e(j,2,3)*(co(3,irefnode)-co(3,node))
98  mpcfree=nodempc(3,mpcfree)
99  nodempc(1,mpcfree)=irotnode
100  nodempc(2,mpcfree)=3
101  coefmpc(mpcfree)=e(j,3,1)*(co(1,irefnode)-co(1,node))+
102  & e(j,3,2)*(co(2,irefnode)-co(2,node))+
103  & e(j,3,3)*(co(3,irefnode)-co(3,node))
104  mpcfree=nodempc(3,mpcfree)
105  nodempc(1,mpcfree)=nk
106  nodempc(2,mpcfree)=j
107  coefmpc(mpcfree)=1.d0
108  mpcfreeold=mpcfree
109  mpcfree=nodempc(3,mpcfree)
110  nodempc(3,mpcfreeold)=0
111  idof=8*(nk-1)+j
112  call nident(ikboun,idof,nboun,id)
113  nboun=nboun+1
114  if(nboun.gt.nboun_) then
115  write(*,*) '*ERROR in rigidmpc: increase nboun_'
116  call exit(201)
117  endif
118  nodeboun(nboun)=nk
119  ndirboun(nboun)=j
120  typeboun(nboun)='R'
121  do l=nboun,id+2,-1
122  ikboun(l)=ikboun(l-1)
123  ilboun(l)=ilboun(l-1)
124  enddo
125  ikboun(id+1)=idof
126  ilboun(id+1)=nboun
127  enddo
128 !
129  return
subroutine nident(x, px, n, id)
Definition: nident.f:26
Hosted by OpenAircraft.com, (Michigan UAV, LLC)