2
! CalculiX - A 3-dimensional finite element program
3
! Copyright (C) 1998-2015 Guido Dhondt
5
! This program is free software; you can redistribute it and/or
6
! modify it under the terms of the GNU General Public License as
7
! published by the Free Software Foundation(version 2);
10
! This program is distributed in the hope that it will be useful,
11
! but WITHOUT ANY WARRANTY; without even the implied warranty of
12
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
! GNU General Public License for more details.
15
! You should have received a copy of the GNU General Public License
16
! along with this program; if not, write to the Free Software
17
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
subroutine createmddof(imddof,nmddof,istartset,iendset,
20
& ialset,nactdof,ithermal,mi,imdnode,nmdnode,ikmpc,
21
& ilmpc,ipompc,nodempc,nmpc,
22
& imdmpc,nmdmpc,imdboun,nmdboun,ikboun,nboun,
23
& nset,ntie,tieset,set,lakon,kon,ipkon,labmpc,
24
& ilboun,filab,prlab,prset,nprint,ne,cyclicsymmetry)
26
! creating a set imddof containing the degrees of freedom
27
! selected by the user for modal dynamic calculations. The
28
! solution will be calculated for these dof's only in order
29
! to speed up the calculation.
37
character*20 labmpc(*)
38
character*81 tieset(3,*),rightset,set(*),slavset,noset,prset(*)
41
integer imddof(*),nmddof,nrset,istartset(*),iendset(*),mi(*),
42
& ialset(*),nactdof(0:mi(2),*),node,ithermal,j,k,l,
43
& ikmpc(*),ilmpc(*),ipompc(*),nodempc(3,*),nmpc,
44
& imdnode(*),nmdnode,imdmpc(*),nmdmpc,nprint,ipos,
45
& imdboun(*),nmdboun,ikboun(*),nboun,indexe1,indexe,islav,
46
& jface,nset,ntie,nnodelem,nope,nodef(8),nelem,nface,imast,
47
& ifaceq(8,6),ifacet(6,4),ifacew1(4,5),ifacew2(8,5),kon(*),
48
& ipkon(*),i,ilboun(*),nlabel,ne,cyclicsymmetry
50
! nodes per face for hex elements
52
data ifaceq /4,3,2,1,11,10,9,12,
53
& 5,6,7,8,13,14,15,16,
55
& 2,3,7,6,10,19,14,18,
56
& 3,4,8,7,11,20,15,19,
57
& 4,1,5,8,12,17,16,20/
59
! nodes per face for tet elements
61
data ifacet /1,3,2,7,6,5,
66
! nodes per face for linear wedge elements
68
data ifacew1 /1,3,2,0,
74
! nodes per face for quadratic wedge elements
76
data ifacew2 /1,3,2,9,8,7,0,0,
84
! if 1d/2d elements are part of the mesh, no node selection
85
! is performed (because of the renumbering due to the
86
! expansion node selection is excessively difficult)
89
if((lakon(i)(7:7).eq.'E').or.
90
& (lakon(i)(7:7).eq.'S').or.
91
& ((lakon(i)(7:7).eq.'A').and.(lakon(i)(1:1).eq.'C')).or.
92
& (lakon(i)(7:7).eq.'L').or.
93
& (lakon(i)(7:7).eq.'B')) then
102
! storing the nodes for which *NODE FILE or *EL FILE was selected
106
! CDIS,CSTR und CELS are not taken into account:
107
! contact area is treated separately (no set can
108
! be specified for CDIS, CSTR und CELS)
110
if((i.eq.26).or.(i.eq.27)) cycle
112
if(filab(i)(1:1).ne.' ') then
113
read(filab(i)(7:87),'(a81)') noset
116
if(set(k).eq.noset) then
122
! if output for all nodes is selected, use
123
! of imdnode is deactivated
126
if(cyclicsymmetry.eq.1) then
127
write(*,*) '*ERROR in createmddof: in a cylic'
128
write(*,*) ' symmetric modal dynamic or'
129
write(*,*) ' steady static dynamics calculation'
130
write(*,*) ' a node set MUST be defined on each'
131
write(*,*) ' *NODE FILE, *NODE OUTPUT, *EL FILE'
132
write(*,*) ' or *ELEMENT OUTPUT card.'
133
write(*,*) ' Justification: in a steady state'
134
write(*,*) ' dynamics calculation with cyclic'
135
write(*,*) ' symmetry the segment is expanded'
136
write(*,*) ' into 360 °. Storing results for'
137
write(*,*) ' this expansion may lead to huge'
138
write(*,*) ' frd-files. Specifying a set can'
139
write(*,*) ' reduce this output.'
149
! adding the nodes belonging to nrset
151
do j=istartset(nrset),iendset(nrset)
152
if(ialset(j).gt.0) then
154
call addimd(imdnode,nmdnode,node)
155
if(ithermal.ne.2) then
157
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
158
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
159
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
160
& ikboun,nboun,ilboun)
164
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
165
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
166
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,ikboun,
173
if(node.ge.ialset(j-1)) exit
174
call addimd(imdnode,nmdnode,node)
175
if(ithermal.ne.2) then
177
call addimdnodedof(node,k,ikmpc,ilmpc,
178
& ipompc,nodempc,nmpc,imdnode,nmdnode,imddof,
179
& nmddof,nactdof,mi,imdmpc,nmdmpc,imdboun,
180
& nmdboun,ikboun,nboun,ilboun)
184
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
185
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
186
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
187
& ikboun,nboun,ilboun)
196
! storing the nodes for which *NODE PRINT was selected
199
if((prlab(i)(1:4).eq.'U ').or.
200
& (prlab(i)(1:4).eq.'NT ').or.
201
& (prlab(i)(1:4).eq.'RF ').or.
202
& (prlab(i)(1:4).eq.'RFL ').or.
203
& (prlab(i)(1:4).eq.'PS ').or.
204
& (prlab(i)(1:4).eq.'PN ').or.
205
& (prlab(i)(1:4).eq.'MF ').or.
206
& (prlab(i)(1:4).eq.'V ')) then
210
if(set(k).eq.noset) then
216
! adding the nodes belonging to nrset
218
do j=istartset(nrset),iendset(nrset)
219
if(ialset(j).gt.0) then
221
call addimd(imdnode,nmdnode,node)
222
if(ithermal.ne.2) then
224
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
225
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
226
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
227
& ikboun,nboun,ilboun)
231
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
232
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
233
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,ikboun,
240
if(node.ge.ialset(j-1)) exit
241
call addimd(imdnode,nmdnode,node)
242
if(ithermal.ne.2) then
244
call addimdnodedof(node,k,ikmpc,ilmpc,
245
& ipompc,nodempc,nmpc,imdnode,nmdnode,imddof,
246
& nmddof,nactdof,mi,imdmpc,nmdmpc,imdboun,
247
& nmdboun,ikboun,nboun,ilboun)
251
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
252
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
253
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
254
& ikboun,nboun,ilboun)
262
! check whether all contact slave and master nodes were selected
266
! check for contact conditions
267
! 'C' are active contact conditions
268
! '-' are temporarily deactivated contact conditions
270
if((tieset(1,i)(81:81).eq.'C').or.
271
& (tieset(1,i)(81:81).eq.'-')) then
274
! determining the master surface
277
if(set(j).eq.rightset) exit
280
write(*,*) '*ERROR in createmddof: master surface',
282
write(*,*) ' does not exist'
287
do j=istartset(imast),iendset(imast)
289
nelem=int(ialset(j)/10.d0)
290
jface=ialset(j)-10*nelem
294
if(lakon(nelem)(4:4).eq.'2') then
297
elseif(lakon(nelem)(4:4).eq.'8') then
300
elseif(lakon(nelem)(4:5).eq.'10') then
303
elseif(lakon(nelem)(4:4).eq.'4') then
306
elseif(lakon(nelem)(4:5).eq.'15') then
314
elseif(lakon(nelem)(4:4).eq.'6') then
326
! determining the master nodes
330
nodef(k)=kon(indexe+ifacet(k,jface))
332
elseif(nface.eq.5) then
335
nodef(k)=kon(indexe+ifacew1(k,jface))
337
elseif(nope.eq.15) then
339
nodef(k)=kon(indexe+ifacew2(k,jface))
342
elseif(nface.eq.6) then
344
nodef(k)=kon(indexe+ifaceq(k,jface))
350
call addimd(imdnode,nmdnode,node)
351
if(ithermal.ne.2) then
353
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
354
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
355
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
356
& ikboun,nboun,ilboun)
362
! determining the slave nodes
366
! check whether facial slave surface;
368
ipos=index(slavset,' ')-1
370
! default for node-to-surface contact is
371
! a nodal slave surface
373
if(slavset(ipos:ipos).eq.'S') then
377
! determining the slave surface
380
if(set(j).eq.slavset) exit
384
if((set(j)(1:ipos-1).eq.slavset(1:ipos-1)).and.
385
& (set(j)(ipos:ipos).eq.'T')) then
394
if(nodeslavsurf) then
396
! nodal slave surface
398
do j=istartset(islav),iendset(islav)
399
if(ialset(j).gt.0) then
401
call addimd(imdnode,nmdnode,node)
402
if(ithermal.ne.2) then
404
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
405
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
406
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
407
& ikboun,nboun,ilboun)
414
if(k.ge.ialset(j-1)) exit
416
call addimd(imdnode,nmdnode,node)
417
if(ithermal.ne.2) then
419
call addimdnodedof(node,k,ikmpc,ilmpc,
420
& ipompc,nodempc,nmpc,imdnode,nmdnode,
421
& imddof,nmddof,nactdof,mi,imdmpc,nmdmpc,
422
& imdboun,nmdboun,ikboun,nboun,ilboun)
430
! facial slave surface
432
do j=istartset(islav),iendset(islav)
434
nelem=int(ialset(j)/10.d0)
435
jface=ialset(j)-10*nelem
439
if(lakon(nelem)(4:4).eq.'2') then
442
elseif(lakon(nelem)(4:4).eq.'8') then
445
elseif(lakon(nelem)(4:5).eq.'10') then
448
elseif(lakon(nelem)(4:4).eq.'4') then
451
elseif(lakon(nelem)(4:5).eq.'15') then
459
elseif(lakon(nelem)(4:4).eq.'6') then
471
! determining the slave nodes
475
nodef(k)=kon(indexe+ifacet(k,jface))
477
elseif(nface.eq.5) then
480
nodef(k)=kon(indexe+ifacew1(k,jface))
482
elseif(nope.eq.15) then
484
nodef(k)=kon(indexe+ifacew2(k,jface))
487
elseif(nface.eq.6) then
489
nodef(k)=kon(indexe+ifaceq(k,jface))
495
call addimd(imdnode,nmdnode,node)
496
if(ithermal.ne.2) then
498
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
499
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
500
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
501
& ikboun,nboun,ilboun)
511
! adding nodes belonging to nonlinear MPC's (why only dependent nodes?)
514
if((labmpc(i)(1:20).ne.' ').and.
515
& (labmpc(i)(1:7).ne.'CONTACT').and.
516
& (labmpc(i)(1:6).ne.'CYCLIC').and.
517
& (labmpc(i)(1:9).ne.'SUBCYCLIC')) then
519
if(indexe1.eq.0) cycle
520
node=nodempc(1,indexe1)
521
call addimd(imdnode,nmdnode,node)
522
if(ithermal.ne.2) then
524
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
525
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
526
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,
527
& ikboun,nboun,ilboun)
531
call addimdnodedof(node,k,ikmpc,ilmpc,ipompc,
532
& nodempc,nmpc,imdnode,nmdnode,imddof,nmddof,
533
& nactdof,mi,imdmpc,nmdmpc,imdboun,nmdboun,ikboun,
539
! subtracting 1 to comply with the C-convention
542
c imddof(j)=imddof(j)-1
545
c write (*,*) 'nmddof, nmdnode',nmddof,nmdnode