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

Go to the source code of this file.

Functions/Subroutines

subroutine surfacebehaviors (inpc, textpart, elcon, nelcon, imat, ntmat_, ncmat_, irstrt, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc, npmat_, plicon, nplicon, nstate_, ichangesurfacebehavior)
 

Function/Subroutine Documentation

◆ surfacebehaviors()

subroutine surfacebehaviors ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
real*8, dimension(0:ncmat_,ntmat_,*)  elcon,
integer, dimension(2,*)  nelcon,
integer  imat,
integer  ntmat_,
integer  ncmat_,
integer  irstrt,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer, dimension(0:*)  ipoinpc,
integer  npmat_,
real*8, dimension(0:2*npmat_,ntmat_,*)  plicon,
integer, dimension(0:ntmat_,*)  nplicon,
integer  nstate_,
integer  ichangesurfacebehavior 
)
23 !
24 ! reading the input deck: *SURFACE BEHAVIOR
25 !
26 ! nint(elcon(3,1,imat))=1: exponential
27 ! nint(elcon(3,1,imat))=2: linear
28 ! nint(elcon(3,1,imat))=3: tabular
29 ! nint(elcon(3,1,imat))=4: tied
30 !
31  implicit none
32 !
33  character*1 inpc(*),pressureoverclosure
34  character*132 textpart(16)
35 !
36  integer nelcon(2,*),imat,ntmat_,istep,istat,ipoinpc(0:*),
37  & n,key,i,ncmat_,irstrt,iline,ipol,inl,ipoinp(2,*),inp(3,*),
38  & ntmat,npmat,npmat_,nplicon(0:ntmat_,*),nstate_,
39  & ichangesurfacebehavior
40 !
41  real*8 elcon(0:ncmat_,ntmat_,*),plicon(0:2*npmat_,ntmat_,*),
42  & temperature
43 !
44  if((istep.gt.0).and.(irstrt.ge.0).and.
45  & (ichangesurfacebehavior.eq.0)) then
46  write(*,*) '*ERROR reading *SURFACE BEHAVIOR:'
47  write(*,*) ' *SURFACE BEHAVIOR should be placed'
48  write(*,*) ' before all step definitions'
49  call exit(201)
50  endif
51 !
52  if(imat.eq.0) then
53  write(*,*) '*ERROR reading *SURFACE BEHAVIOR:'
54  write(*,*) ' *SURFACE BEHAVIOR should be preceded'
55  write(*,*) ' by a *SURFACE INTERACTION card'
56  call exit(201)
57  endif
58  pressureoverclosure=' '
59 !
60  do i=2,n
61  if(textpart(i)(1:27).eq.'PRESSURE-OVERCLOSURE=LINEAR') then
62  pressureoverclosure='L'
63  elseif(textpart(i)(1:32).eq.'PRESSURE-OVERCLOSURE=EXPONENTIAL')
64  & then
65  pressureoverclosure='E'
66  elseif(textpart(i)(1:38).eq.'PRESSURE-OVERCLOSURE=TABULAR')
67  & then
68  pressureoverclosure='T'
69  elseif(textpart(i)(1:35).eq.'PRESSURE-OVERCLOSURE=TIED')
70  & then
71  pressureoverclosure='D'
72  else
73  write(*,*)
74  & '*WARNING reading *SURFACE BEHAVIOR: parameter not recognized:'
75  write(*,*) ' ',
76  & textpart(i)(1:index(textpart(i),' ')-1)
77  call inputwarning(inpc,ipoinpc,iline,
78  &"*SURFACE BEHAVIOR%")
79  endif
80  enddo
81  if(pressureoverclosure.eq.' ') then
82  write(*,*) '*ERROR reading *SURFACE BEHAVIOR:'
83  write(*,*) ' no PRESSURE-OVERCLOSURE defined on the'
84  write(*,*) ' *SURFACE BEHAVIOR card'
85  call exit(201)
86  endif
87 !
88  if(nelcon(1,imat).ne.-51) nelcon(1,imat)=max(nelcon(1,imat),2)
89  nelcon(2,imat)=1
90 !
91  if(pressureoverclosure.eq.'E') then
92 !
93  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
94  & ipoinp,inp,ipoinpc)
95  if((istat.lt.0).or.(key.eq.1)) then
96  write(*,*) '*ERROR reading *SURFACE BEHAVIOR: data'
97  write(*,*) ' line is lacking for exponential'
98  write(*,*) ' behavior'
99  call inputerror(inpc,ipoinpc,iline,
100  &"*SURFACE BEHAVIOR%")
101  endif
102 !
103  elcon(3,1,imat)=1.5d0
104 !
105 ! exponential overclosure
106 !
107  do i=1,2
108  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
109  & elcon(i,1,imat)
110  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
111  &"*SURFACE BEHAVIOR%")
112  enddo
113 !
114 ! checking the values
115 !
116  if(elcon(1,1,imat).le.0.d0) then
117  write(*,*) '*ERROR reading *SURFACE BEHAVIOR: c_0 must'
118  write(*,*) ' exceed zero'
119  call exit(201)
120  endif
121  if(elcon(2,1,imat).lt.0.d0) then
122  write(*,*) '*ERROR reading *SURFACE BEHAVIOR: p_0 must'
123  write(*,*) ' not be smaller than zero'
124  call exit(201)
125  endif
126 !
127 ! transforming the parameters c_0 into
128 ! beta such that the pressure p satisfies:
129 ! p=p_0*dexp(-beta*distance)
130 ! where n is the normal to the master surface, and
131 ! distance is the distance between slave node and
132 ! master surface (negative for penetration)
133 !
134  elcon(1,1,imat)=dlog(100.d0)/elcon(1,1,imat)
135 !
136  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
137  & ipoinp,inp,ipoinpc)
138 !
139  elseif((pressureoverclosure.eq.'L').or.
140  & (pressureoverclosure.eq.'D')) then
141 !
142  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
143  & ipoinp,inp,ipoinpc)
144  if((istat.lt.0).or.(key.eq.1)) then
145  write(*,*) '*ERROR reading *SURFACE BEHAVIOR: data'
146  write(*,*) ' line is lacking for linear'
147  write(*,*) ' behavior'
148  call inputerror(inpc,ipoinpc,iline,
149  &"*SURFACE BEHAVIOR%")
150  endif
151 !
152  if(pressureoverclosure.eq.'L') then
153  elcon(3,1,imat)=2.5d0
154  else
155  nstate_=max(nstate_,9)
156  elcon(3,1,imat)=4.5d0
157  endif
158 !
159 ! linear overclosure
160 !
161 ! linear spring stiffness
162 !
163  read(textpart(1)(1:20),'(f20.0)',iostat=istat)
164  & elcon(2,1,imat)
165  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
166  &"*SURFACE BEHAVIOR%")
167 !
168  if(elcon(2,1,imat).le.0.d0) then
169  write(*,*) '*ERROR reading *SURFACE BEHAVIOR: K must'
170  write(*,*) ' be strictly positive'
171  call exit(201)
172  endif
173 !
174 ! tension at large clearances
175 !
176  read(textpart(2)(1:20),'(f20.0)',iostat=istat)
177  & elcon(1,1,imat)
178  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
179  &"*SURFACE BEHAVIOR%")
180 !
181 c elcon(1,1,imat)=-elcon(1,1,imat)
182 !
183 ! value of c0coef. If the clearance is inferior to
184 ! c0coef*sqrt(slave_area) a contact spring element
185 ! is generated
186 !
187  read(textpart(3)(1:20),'(f20.0)',iostat=istat)
188  & elcon(4,1,imat)
189  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
190  &"*SURFACE BEHAVIOR%")
191 !
192 ! default value
193 !
194  if(elcon(4,1,imat).le.0.d0) then
195  elcon(4,1,imat)=1.d-3
196  endif
197 !
198  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
199  & ipoinp,inp,ipoinpc)
200 !
201  elseif(pressureoverclosure.eq.'T') then
202  elcon(3,1,imat)=3.5d0
203  elcon(4,1,imat)=1.d-3
204  nelcon(1,imat)=-51
205 !
206 ! tabular
207 !
208  ntmat=0
209  npmat=0
210 !
211  do
212 !
213  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
214  & ipoinp,inp,ipoinpc)
215  if((istat.lt.0).or.(key.eq.1)) exit
216  read(textpart(3)(1:20),'(f20.0)',iostat=istat)temperature
217  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
218  &"*SURFACE BEHAVIOR%")
219 !
220 ! first temperature
221 !
222  if(ntmat.eq.0) then
223  npmat=0
224  ntmat=ntmat+1
225  if(ntmat.gt.ntmat_) then
226  write(*,*) '*ERROR reading *SURFACE BEHAVIOR:'
227  write(*,*) ' increase ntmat_'
228  call exit(201)
229  endif
230  nplicon(0,imat)=ntmat
231  plicon(0,ntmat,imat)=temperature
232 !
233 ! new temperature
234 !
235  elseif(plicon(0,ntmat,imat).ne.temperature) then
236  npmat=0
237  ntmat=ntmat+1
238  if(ntmat.gt.ntmat_) then
239  write(*,*) '*ERROR reading *SURFACE BEHAVIOR:'
240  write(*,*) ' increase ntmat_'
241  call exit(201)
242  endif
243  nplicon(0,imat)=ntmat
244  plicon(0,ntmat,imat)=temperature
245  endif
246  do i=1,2
247  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
248  & plicon(2*npmat+i,ntmat,imat)
249  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
250  &"*SURFACE BEHAVIOR%")
251  enddo
252  npmat=npmat+1
253  if(npmat.gt.npmat_) then
254  write(*,*)
255  & '*ERROR reading *SURFACE BEHAVIOR: increase npmat_'
256  call exit(201)
257  endif
258  nplicon(ntmat,imat)=npmat
259  enddo
260 !
261  if(ntmat.eq.0) then
262  write(*,*)
263  & '*ERROR reading *SURFACE BEHAVIOR: *SURFACE BEHAVIOR'
264  write(*,*) ' card without data'
265  call exit(201)
266  endif
267 !
268 ! check whether the difference between the overclosure data
269 ! points is at least equal to the smallest difference in
270 ! double precision numbers (no vertical slope in the pressure
271 ! versus overclosure curve allowed)
272 !
273  do i=1,npmat-1
274  if(plicon(2*i+2,1,imat)-plicon(2*i,1,imat).lt.1.d-10) then
275  plicon(2*i+2,1,imat)=plicon(2*i,1,imat)+1.d-10
276  endif
277  enddo
278 !
279  endif
280 !
281  elcon(0,1,imat)=0.d0
282 !
283  return
#define max(a, b)
Definition: cascade.c:32
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 inputerror(inpc, ipoinpc, iline, text)
Definition: inputerror.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)