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

Go to the source code of this file.

Functions/Subroutines

subroutine rigidbodys (inpc, textpart, set, istartset, iendset, ialset, nset, nset_, nalset, nalset_, ipompc, nodempc, coefmpc, labmpc, nmpc, nmpc_, mpcfree, ikmpc, ilmpc, lakon, ipkon, kon, nk, nk_, nodeboun, ndirboun, ikboun, ilboun, nboun, nboun_, iperturb, ne_, ctrl, typeboun, istep, istat, n, iline, ipol, inl, ipoinp, inp, co, ipoinpc)
 

Function/Subroutine Documentation

◆ rigidbodys()

subroutine rigidbodys ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
character*81, dimension(*)  set,
integer, dimension(*)  istartset,
integer, dimension(*)  iendset,
integer, dimension(*)  ialset,
integer  nset,
integer  nset_,
integer  nalset,
integer  nalset_,
integer, dimension(*)  ipompc,
integer, dimension(3,*)  nodempc,
real*8, dimension(3,*)  coefmpc,
character*20, dimension(*)  labmpc,
integer  nmpc,
integer  nmpc_,
integer  mpcfree,
integer, dimension(*)  ikmpc,
integer, dimension(*)  ilmpc,
character*8, dimension(*)  lakon,
integer, dimension(*)  ipkon,
integer, dimension(*)  kon,
integer  nk,
integer  nk_,
integer, dimension(*)  nodeboun,
integer, dimension(*)  ndirboun,
integer, dimension(*)  ikboun,
integer, dimension(*)  ilboun,
integer  nboun,
integer  nboun_,
integer  iperturb,
integer  ne_,
real*8, dimension(*)  ctrl,
character*1, dimension(*)  typeboun,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
real*8, dimension(3,*)  co,
integer, dimension(0:*)  ipoinpc 
)
25 !
26 ! reading the input deck: *RIGID BODY
27 !
28  implicit none
29 !
30  character*1 typeboun(*),inpc(*)
31  character*8 lakon(*)
32  character*20 labmpc(*)
33  character*81 set(*),elset,noset
34  character*132 textpart(16)
35 !
36  integer istartset(*),iendset(*),ialset(*),ipompc(*),
37  & nodempc(3,*),
38  & nset,nset_,nalset,nalset_,nmpc,nmpc_,mpcfree,nk,nk_,ikmpc(*),
39  & ilmpc(*),ipkon(*),kon(*),inoset,ielset,i,node,ielement,id,
40  & indexe,nope,istep,istat,n,irefnode,irotnode,ne_,
41  & j,idof,k,nodeboun(*),ndirboun(*),ikboun(*),ilboun(*),
42  & nboun,nboun_,key,iperturb,ipos,iline,ipol,inl,ipoinp(2,*),
43  & inp(3,*),ipoinpc(0:*),jmin,jmax
44 !
45  real*8 coefmpc(3,*),ctrl(*),co(3,*)
46 !
47  jmin=1
48  jmax=3
49 !
50  if(istep.gt.0) then
51  write(*,*)
52  & '*ERROR reading *RIGID BODY: *RIGID BODY should be placed'
53  write(*,*) ' before all step definitions'
54  call exit(201)
55  endif
56 !
57 ! the *RIGID BODY option implies a nonlinear geometric
58 ! calculation
59 !
60  if(iperturb.eq.1) then
61  write(*,*) '*ERROR reading *RIGID BODY: the *RIGID BODY option'
62  write(*,*) ' cannot be used in a perturbation step'
63  call exit(201)
64  endif
65 !
66  elset='
67  & '
68  noset='
69  & '
70  irefnode=0
71  irotnode=0
72 !
73  do i=2,n
74  if(textpart(i)(1:6).eq.'ELSET=') then
75  if(noset(1:1).eq.' ') then
76  elset(1:80)=textpart(i)(7:86)
77  ipos=index(elset,' ')
78  elset(ipos:ipos)='E'
79  else
80  write(*,*) '*ERROR reading *RIGID BODY: either NSET or'
81  write(*,*) ' ELSET can be specified, not both'
82  call exit(201)
83  endif
84  elseif(textpart(i)(1:8).eq.'PINNSET=') then
85  if(elset(1:1).eq.' ') then
86  noset(1:80)=textpart(i)(9:88)
87  ipos=index(noset,' ')
88  noset(ipos:ipos)='N'
89  else
90  write(*,*) '*ERROR reading *RIGID BODY: either NSET or'
91  write(*,*) ' ELSET can be specified, not both'
92  call exit(201)
93  endif
94  elseif(textpart(i)(1:5).eq.'NSET=') then
95  if(elset(1:1).eq.' ') then
96  noset(1:80)=textpart(i)(6:85)
97  ipos=index(noset,' ')
98  noset(ipos:ipos)='N'
99  else
100  write(*,*) '*ERROR reading *RIGID BODY: either NSET or'
101  write(*,*) ' ELSET can be specified, not both'
102  call exit(201)
103  endif
104  elseif(textpart(i)(1:8).eq.'REFNODE=') then
105  read(textpart(i)(9:18),'(i10)',iostat=istat) irefnode
106  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
107  &"*RIGID BODY%")
108  if(irefnode.gt.nk) then
109  write(*,*) '*ERROR reading *RIGID BODY: ref node',
110  & irefnode
111  write(*,*) ' has not been defined'
112  call exit(201)
113  endif
114  elseif(textpart(i)(1:8).eq.'ROTNODE=') then
115  read(textpart(i)(9:18),'(i10)',iostat=istat) irotnode
116  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
117  &"*RIGID BODY%")
118  if(irotnode.gt.nk) then
119  write(*,*) '*ERROR reading *RIGID BODY: rot node',
120  & irotnode
121  write(*,*) ' has not been defined'
122  call exit(201)
123  endif
124  else
125  write(*,*)
126  & '*WARNING reading *RIGID BODY: parameter not recognized:'
127  write(*,*) ' ',
128  & textpart(i)(1:index(textpart(i),' ')-1)
129  call inputwarning(inpc,ipoinpc,iline,
130  &"*RIGID BODY%")
131  endif
132  enddo
133 !
134 ! check whether a set was defined
135 !
136  if((elset(1:1).eq.' ').and.
137  & (noset(1:1).eq.' ')) then
138  write(*,*) '*WARNING reading *RIGID BODY: no set defined'
139  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
140  & ipoinp,inp,ipoinpc)
141  return
142  endif
143 !
144  inoset=0
145  ielset=0
146 !
147 ! checking whether the set exists
148 !
149  if(noset(1:1).ne.' ') then
150  do i=1,nset
151  if(set(i).eq.noset) then
152  inoset=i
153  exit
154  endif
155  enddo
156  if(inoset.eq.0) then
157  write(*,*) '*WARNING reading *RIGID BODY: node set ',noset
158  write(*,*) ' does not exist'
159  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
160  & ipoinp,inp,ipoinpc)
161  return
162  endif
163  endif
164 !
165  if(elset(1:1).ne.' ') then
166  do i=1,nset
167  if(set(i).eq.elset) then
168  ielset=i
169  exit
170  endif
171  enddo
172  if(ielset.eq.0) then
173  write(*,*) '*WARNING reading *RIGID BODY: element set ',
174  & elset
175  write(*,*) ' does not exist'
176  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
177  & ipoinp,inp,ipoinpc)
178  return
179  endif
180  endif
181 !
182 ! check for the existence of irefnode and irotnode; if none were
183 ! defined, new nodes are generated
184 !
185  if(irefnode.eq.0) then
186  nk=nk+1
187  if(nk.gt.nk_) then
188  write(*,*) '*ERROR reading *RIGID BODY: increase nk_'
189  call exit(201)
190  endif
191  irefnode=nk
192 !
193 ! default position of the reference node is the origin
194 !
195  co(1,nk)=0.d0
196  co(2,nk)=0.d0
197  co(3,nk)=0.d0
198  endif
199 !
200  if(irotnode.eq.0) then
201  nk=nk+1
202  if(nk.gt.nk_) then
203  write(*,*) '*ERROR reading *RIGID BODY: increase nk_'
204  call exit(201)
205  endif
206  irotnode=nk
207  endif
208 !
209 ! check whether other equations apply to the dependent nodes
210 !
211  if(inoset.ne.0) then
212  do i=istartset(inoset),iendset(inoset)
213  node=ialset(i)
214  if(node.gt.nk_) then
215  write(*,*) '*ERROR reading *RIGID BODY: node ',node
216  write(*,*) ' belonging to set ',noset
217  write(*,*) ' has not been defined'
218  call exit(201)
219  endif
220  if((node.eq.irefnode).or.(node.eq.irotnode)) cycle
221  do j=1,3
222  idof=8*(node-1)+j
223  call nident(ikmpc,idof,nmpc,id)
224  if(id.gt.0) then
225  if(ikmpc(id).eq.idof) then
226  write(*,*) '*WARNING reading *RIGID BODY: dof ',j
227  write(*,*) ' of node ',node,' belonging'
228  write(*,*) ' to a rigid body is detected'
229  write(*,*) ' on the dependent side of '
230  write(*,*) ' another equation; no rigid'
231  write(*,*) ' body constrained applied'
232  endif
233  endif
234  enddo
235  enddo
236  endif
237 !
238  if(ielset.ne.0) then
239  do i=istartset(ielset),iendset(ielset)
240  ielement=ialset(i)
241  if(ielement.gt.ne_) then
242  write(*,*) '*ERROR reading *RIGID BODY: element ',
243  & ielement
244  write(*,*) ' belonging to set ',elset
245  write(*,*) ' has not been defined'
246  call exit(201)
247  endif
248  if(ipkon(ielement).lt.0) cycle
249  indexe=ipkon(ielement)
250  if(lakon(ielement)(4:4).eq.'2') then
251  nope=20
252  elseif(lakon(ielement)(4:4).eq.'8') then
253  nope=8
254  elseif(lakon(ielement)(4:5).eq.'10') then
255  nope=10
256  elseif(lakon(ielement)(4:4).eq.'4') then
257  nope=4
258  elseif(lakon(ielement)(4:5).eq.'15') then
259  nope=15
260  else
261  nope=6
262  endif
263  do k=indexe+1,indexe+nope
264  node=kon(k)
265  if((node.eq.irefnode).or.(node.eq.irotnode)) cycle
266  do j=1,3
267  idof=8*(node-1)+j
268  call nident(ikmpc,idof,nmpc,id)
269  if(id.gt.0) then
270  if(ikmpc(id).eq.idof) then
271  write(*,*)'*WARNING reading *RIGID BODY: dof ',
272  &j,'of node ',node,' belonging to a'
273  write(*,*)' rigid body is detected on th
274  &e dependent side of another'
275  write(*,*)' equation; no rigid body cons
276  &trained applied'
277  endif
278  endif
279  enddo
280  enddo
281  enddo
282  endif
283 !
284 ! generating the equations in basis form
285 !
286 ! node set
287 !
288  if(inoset.ne.0) then
289  do i=istartset(inoset),iendset(inoset)
290  node=ialset(i)
291  if(node.gt.0) then
292  if((node.eq.irefnode).or.(node.eq.irotnode)) cycle
293  call rigidmpc(ipompc,nodempc,coefmpc,irefnode,irotnode,
294  & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,nk,nk_,
295  & nodeboun,ndirboun,ikboun,ilboun,nboun,nboun_,node,
296  & typeboun,co,jmin,jmax)
297  else
298  node=ialset(i-2)
299  do
300  node=node-ialset(i)
301  if(node.ge.ialset(i-1)) exit
302  if((node.eq.irefnode).or.(node.eq.irotnode)) cycle
303  call rigidmpc(ipompc,nodempc,coefmpc,irefnode,
304  & irotnode,labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
305  & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,nboun,
306  & nboun_,node,typeboun,co,jmin,jmax)
307  enddo
308  endif
309  enddo
310  endif
311 !
312 ! element set
313 !
314  if(ielset.ne.0) then
315  do i=istartset(ielset),iendset(ielset)
316  ielement=ialset(i)
317  if(ielement.gt.0) then
318  if(ipkon(ielement).lt.0) cycle
319  indexe=ipkon(ielement)
320  if(lakon(ielement)(4:4).eq.'2') then
321  nope=20
322  elseif(lakon(ielement)(4:4).eq.'8') then
323  nope=8
324  elseif(lakon(ielement)(4:5).eq.'10') then
325  nope=10
326  elseif(lakon(ielement)(4:4).eq.'4') then
327  nope=4
328  elseif(lakon(ielement)(4:5).eq.'15') then
329  nope=15
330  else
331  nope=6
332  endif
333  do k=indexe+1,indexe+nope
334  node=kon(k)
335  if((node.eq.irefnode).or.(node.eq.irotnode)) cycle
336  call rigidmpc(ipompc,nodempc,coefmpc,irefnode,
337  & irotnode,labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
338  & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,nboun,
339  & nboun_,node,typeboun,co,jmin,jmax)
340  enddo
341  else
342  ielement=ialset(i-2)
343  do
344  ielement=ielement-ialset(i)
345  if(ielement.ge.ialset(i-1)) exit
346  if(ipkon(ielement).lt.0) cycle
347  indexe=ipkon(ielement)
348  if(lakon(ielement)(4:4).eq.'2') then
349  nope=20
350  elseif(lakon(ielement)(4:4).eq.'8') then
351  nope=8
352  elseif(lakon(ielement)(4:5).eq.'10') then
353  nope=10
354  elseif(lakon(ielement)(4:4).eq.'4') then
355  nope=4
356  elseif(lakon(ielement)(4:5).eq.'15') then
357  nope=15
358  else
359  nope=6
360  endif
361  do k=indexe+1,indexe+nope
362  node=kon(k)
363  if((node.eq.irefnode).or.(node.eq.irotnode)) cycle
364  call rigidmpc(ipompc,nodempc,coefmpc,irefnode,
365  & irotnode,labmpc,nmpc,nmpc_,mpcfree,ikmpc,
366  & ilmpc,nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
367  & nboun,nboun_,node,typeboun,co,jmin,jmax)
368  enddo
369  enddo
370  endif
371  enddo
372  endif
373 !
374  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
375  & ipoinp,inp,ipoinpc)
376 !
377  return
subroutine inputwarning(inpc, ipoinpc, iline, text)
Definition: inputwarning.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 inputerror(inpc, ipoinpc, iline, text)
Definition: inputerror.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)