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

Go to the source code of this file.

Functions/Subroutines

subroutine allocont (ncont, ntie, tieset, nset, set, istartset, iendset, ialset, lakon, ncone, tietol, ismallsliding, kind1, kind2, mortar, istep)
 

Function/Subroutine Documentation

◆ allocont()

subroutine allocont ( integer  ncont,
integer  ntie,
character*81, dimension(3,*)  tieset,
integer  nset,
character*81, dimension(*)  set,
integer, dimension(*)  istartset,
integer, dimension(*)  iendset,
integer, dimension(*)  ialset,
character*8, dimension(*)  lakon,
integer  ncone,
real*8, dimension(3,*)  tietol,
integer  ismallsliding,
character*1  kind1,
character*1  kind2,
integer  mortar,
integer  istep 
)
22 !
23 ! counting the number of triangles needed for the
24 ! triangulation of the contact master surfaces
25 !
26 ! ismallsliding = 0: large sliding
27 ! = 1: small sliding
28 !
29  implicit none
30 !
31  logical nodeslavsurf
32 !
33  character*1 kind1,kind2
34  character*8 lakon(*)
35  character*81 tieset(3,*),mastset,set(*),slavset
36 !
37  integer ncont,ntie,i,j,k,nset,istartset(*),iendset(*),ialset(*),
38  & imast,nelem,jface,ncone,islav,ismallsliding,ipos,mortar,istep,
39  & kflag,idummy,jact
40 !
41  real*8 tietol(3,*)
42 !
43 ! number of master triangles
44 !
45  ncont=0
46 !
47 ! number of slave entities (nodes for nodal surfaces and
48 ! faces for facial surfaces)
49 !
50  ncone=0
51 !
52  do i=1,ntie
53 !
54 ! check for contact conditions
55 !
56  if((tieset(1,i)(81:81).eq.kind1).or.
57  & (tieset(1,i)(81:81).eq.kind2)) then
58  if(tietol(1,i).lt.0.d0) then
59  ismallsliding=1
60  else
61  ismallsliding=0
62  endif
63  mastset=tieset(3,i)
64 !
65 ! determining the master surface
66 !
67  do j=1,nset
68  if(set(j).eq.mastset) exit
69  enddo
70  if(j.gt.nset) then
71  ipos=index(mastset,' ')
72  write(*,*) '*ERROR in allocont: master surface ',
73  & mastset(1:ipos-2)
74  write(*,*) ' does not exist or does not contain'
75  write(*,*) ' element faces'
76  call exit(201)
77  endif
78  imast=j
79 !
80 ! deleting identical entries in the master facial surface
81 ! definition (leads otherwise to problems in the triangulation
82 ! and the creation of imastop)
83 !
84  if(istep.eq.1) then
85  kflag=1
86  call isortii(ialset(istartset(imast)),idummy,
87  & iendset(imast)-istartset(imast)+1,kflag)
88  jact=istartset(imast)
89  do j=istartset(imast)+1,iendset(imast)
90  if(ialset(j).eq.ialset(j-1)) cycle
91  jact=jact+1
92  ialset(jact)=ialset(j)
93  enddo
94  iendset(imast)=jact
95  endif
96 !
97  do j=istartset(imast),iendset(imast)
98 !
99  nelem=int(ialset(j)/10.d0)
100  jface=ialset(j)-10*nelem
101 !
102  if(lakon(nelem)(4:5).eq.'20') then
103  ncont=ncont+6
104  elseif(lakon(nelem)(4:4).eq.'2') then
105  ncont=ncont+8
106  elseif(lakon(nelem)(4:4).eq.'8') then
107  ncont=ncont+2
108  elseif(lakon(nelem)(4:5).eq.'10') then
109  ncont=ncont+4
110  elseif(lakon(nelem)(4:4).eq.'4') then
111  ncont=ncont+1
112  elseif(lakon(nelem)(4:5).eq.'15') then
113  if(jface.le.2) then
114  ncont=ncont+4
115  else
116  ncont=ncont+6
117  endif
118  elseif(lakon(nelem)(4:4).eq.'6') then
119  if(jface.le.2) then
120  ncont=ncont+1
121  else
122  ncont=ncont+2
123  endif
124  endif
125  enddo
126 !
127 ! counting the slave nodes
128 !
129  slavset=tieset(2,i)
130  ipos=index(slavset,' ')-1
131  if(slavset(ipos:ipos).eq.'T') then
132 !
133 ! face-to-face penalty contact (facial slave surface)
134 !
135  mortar=1
136  nodeslavsurf=.false.
137  elseif(slavset(ipos:ipos).eq.'M') then
138 !
139 ! quad-quad Mortar contact (facial slave surface)
140 !
141  mortar=2
142  nodeslavsurf=.false.
143  elseif(slavset(ipos:ipos).eq.'P') then
144 !
145 ! quad-lin Petrov Galerkin Mortar contact (facial slave surface)
146 !
147  mortar=4
148  nodeslavsurf=.false.
149  elseif(slavset(ipos:ipos).eq.'G') then
150 !
151 ! quad-quad Petrov Galerkin Mortar contact (facial slave surface)
152 !
153  mortar=5
154  nodeslavsurf=.false.
155  elseif(slavset(ipos:ipos).eq.'O') then
156 !
157 ! quad-lin Mortar contact (facial slave surface)
158 !
159  mortar=3
160  nodeslavsurf=.false.
161  else
162 !
163 ! node-to-face contact
164 ! default is a nodal slave surface
165 !
166  nodeslavsurf=.true.
167  endif
168 !
169 ! determining the slave surface
170 !
171  do j=1,nset
172  if(set(j).eq.slavset) exit
173  enddo
174  if(j.gt.nset) then
175  if(mortar.eq.1) then
176  write(*,*)
177  & '*ERROR in allocont: element slave surface ',
178  & slavset(1:ipos-1)
179  write(*,*) ' does not exist'
180  call exit(201)
181  endif
182  do j=1,nset
183  if((set(j)(1:ipos-1).eq.slavset(1:ipos-1)).and.
184  & (set(j)(ipos:ipos).eq.'T')) then
185  nodeslavsurf=.false.
186  exit
187  endif
188  enddo
189  if(j.gt.nset) then
190  write(*,*) '*ERROR in allocont: slave surface ',
191  & slavset(1:ipos-1)
192  write(*,*) ' does not exist'
193  call exit(201)
194  endif
195  endif
196 !
197  islav=j
198 !
199 ! deleting identical entries in the slave facial surface
200 ! definition (leads otherwise to problems in the calculation
201 ! of the are corresponding to the slave nodes)
202 !
203  if((istep.eq.1).and.((mortar.eq.1).or.(.not.nodeslavsurf)))
204  & then
205  kflag=1
206  call isortii(ialset(istartset(islav)),idummy,
207  & iendset(islav)-istartset(islav)+1,kflag)
208  jact=istartset(islav)
209  do j=istartset(islav)+1,iendset(islav)
210  if(ialset(j).eq.ialset(j-1)) cycle
211  jact=jact+1
212  ialset(jact)=ialset(j)
213  enddo
214  iendset(islav)=jact
215  endif
216 !
217 ! counting the entities (nodes or faces) in the slave
218 ! surface
219 !
220  do j=istartset(islav),iendset(islav)
221  if(ialset(j).gt.0) then
222  ncone=ncone+1
223  else
224  k=ialset(j-2)
225  do
226  k=k-ialset(j)
227  if(k.ge.ialset(j-1)) exit
228  ncone=ncone+1
229  enddo
230  endif
231  enddo
232 !
233  endif
234  enddo
235 !
236  return
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
Hosted by OpenAircraft.com, (Michigan UAV, LLC)