52
53
54
58 USE intbufdef_mod
59 use margin_reduction_mod
60
61
62
63#include "implicit_f.inc"
64
65
66
67#include "units_c.inc"
68#include "com04_c.inc"
69#include "scr06_c.inc"
70
71
72
73 INTEGER NMN, NRTM, NSN, I_STOK,IGAP,
74 . INACTI,
75 . IPARTS(*), KNOD2ELS(*), NOD2ELS(*)
76 INTEGER IRECT(4,*),NSV(*),ICODE(*),ISKEW(*)
77 INTEGER MSR(*),IDDLEVEL
78 INTEGER NBINFLG(*),MBINFLG(*),ILEV,MSEGTYP(*)
79 INTEGER KREMNODE(*),REMNODE(*)
80 INTEGER IXS(*), IXS10(*), IXS16(*), IXS20(*)
81 LOGICAL, INTENT(in) :: FLAG_REMOVED_NODE
82 INTEGER, INTENT(IN) :: IELEM_M(2,NRTM)
83 integer, intent(in) :: nin
84 integer, intent(in) :: npari
85 integer, dimension(npari), intent(inout) :: ipari
86
88 . stf(*),stfn(*),x(3,*),gap_s(*),gap_m(*),
89 . dist,bumult,gap,tzinf,maxbox,minbox,gapmin,gapmax,
90 . gap_s_l(*),gap_m_l(*),marge,gap_n(4,*)
92 . bgapsmx
93 my_real ,
INTENT(IN) :: drad, dgapload
94 INTEGER ID
95 CHARACTER(LEN=NCHARTITLE) :: TITR
96
97 INTEGER , INTENT(IN) :: NRTMT
98 type(intbuf_struct_), intent(inout) :: intbuf_tab
99 integer :: candidate_count
100
101
102
103 INTEGER I, J, L, N1, N2, N3, N4,N_SOL, ESHIFT
104 INTEGER IBID, NELS
105 INTEGER, DIMENSION(:),ALLOCATABLE :: IIX,IIY,IIZ
106
108 . dx1,dy1,dz1,
109 . dx3,dy3,dz3,
110 . dx4,dy4,dz4,
111 . dx6,dy6,dz6,
112 . dd1,dd2,dd3,dd4,dd,dd0,xmin,ymin,zmin,
113 . xmax,
ymax,zmax,tzinf0,minbox0,maxbox0,
114 . bid,tzinf_st,marge_st,dd_st,d_max,pensol,d_moy,
115 . xyzm(6),bminma(6),aaa,ledgmax
117 . DIMENSION(:), ALLOCATABLE :: edge_l2,edge_l2_tmp
118 INTEGER TAGP(NPART),IAD,N,IE,IL,IP
119 INTEGER, DIMENSION(:), ALLOCATABLE :: NPARTNS,IELEM,LPARTNS
120 INTEGER NBX,NBY,NBZ
121 INTEGER, DIMENSION(:), ALLOCATABLE :: IS_LARGE_NODE,LARGE_NODE, TAGNOD,LOCAL_NEXT_NOD
122 INTEGER :: NB_LARGE_NODES
123 INTEGER (KIND=8) :: NBX8,NBY8,NBZ8,RES8,LVOXEL8
124 INTEGER (KIND=8) :: IONE,IHUNDRED
125 my_real :: xmin_base, ymin_base, zmin_base, xmax_base, ymax_base, zmax_base
126
127 ione=1
128 ihundred=100
129 gapmax=ep30
130 gapmin=zero
131
132
133
134
135
136
137
138
139 dd=zero
140 dd_st=zero
141 pensol=ep30
142 d_moy = zero
143 n_sol = 0
144 DO 10 l=1,nrtm
145
146 n1=irect(1,l)
147 n2=irect(2,l)
148 n3=irect(3,l)
149 n4=irect(4,l)
150
151 dx1=(x(1,n1)-x(1,n2))
152 dy1=(x(2,n1)-x(2,n2))
153 dz1=(x(3,n1)-x(3,n2))
154 dd1=sqrt(dx1**2+dy1**2+dz1**2)
155
156 dx3=(x(1,n1)-x(1,n4))
157 dy3=(x(2,n1)-x(2,n4))
158 dz3=(x(3,n1)-x(3,n4))
159 dd2=sqrt(dx3**2+dy3**2+dz3**2)
160
161 dx4=(x(1,n3)-x(1,n2))
162 dy4=(x(2,n3)-x(2,n2))
163 dz4=(x(3,n3)-x(3,n2))
164 dd3=sqrt(dx4**2+dy4**2+dz4**2)
165
166 dx6=(x(1,n4)-x(1,n3))
167 dy6=(x(2,n4)-x(2,n3))
168 dz6=(x(3,n4)-x(3,n3))
169 dd4=sqrt(dx6**2+dy6**2+dz6**2)
170 dd=dd+ (dd1+dd2+dd3+dd4)
171
172 IF (msegtyp(l)==0.OR.msegtyp(l)>nrtmt) THEN
173 d_max=
max(dd1,dd2,dd3,dd4)
174 d_max=
min(d_max,gap_n(1,l))
175
176 gap_n(1,l)=d_max
177 dd_st=
max(dd_st,d_max)
178 n_sol = n_sol + 1
179 d_moy = d_moy + d_max
180 END IF
181
182 10 CONTINUE
183
184
185 dd0=dd/nrtm/four
186 IF(nrtm > 0 .AND. nrtm <= 3) THEN
187 call margin_reduction(x,numnod,irect,nrtm,nsv,nsn,drad,gap,dgapload,bumult,stfn,dd0)
188
189
190 END IF
191
192 dd=dd0
193
194
195 marge = bumult*dd
196
197
198 tzinf = marge +
max(gap+dgapload,drad)
199
200 marge_st = bmul0*dd
201
202
203 IF(iddlevel==0) marge_st = marge
204 tzinf_st = marge_st +
max(gap+dgapload,drad)
205 bid = four_over_5*dd
206 IF (inacti/=7.AND.tzinf>bid) THEN
207 ibid = nint(tzinf/dd0)
208 ibid =(2*ibid+4)*ibid*2
209 ENDIF
210
211
212 maxbox= half*(dd + 2*tzinf)
213 minbox= half*maxbox
214 tzinf0 = tzinf
215 minbox0 = minbox
216 maxbox0 = maxbox
217
218 dist = zero
219
220
221
222
223 bminma(1)=-ep30
224 bminma(2)=-ep30
225 bminma(3)=-ep30
226 bminma(4)= ep30
227 bminma(5)= ep30
228 bminma(6)= ep30
229
230 xmin=ep30
231 xmax=-ep30
232 ymin=ep30
234 zmin=ep30
235 zmax=-ep30
236
237 DO 20 i=1,nmn
238 j=msr(i)
239 xmin=
min(xmin,x(1,j))
240 ymin=
min(ymin,x(2,j))
241 zmin=
min(zmin,x(3,j))
242 xmax=
max(xmax,x(1,j))
244 zmax=
max(zmax,x(3,j))
245 20 CONTINUE
246
247 xmin=xmin-tzinf_st
248 ymin=ymin-tzinf_st
249 zmin=zmin-tzinf_st
250 xmax=xmax+tzinf_st
252 zmax=zmax+tzinf_st
253
254 DO 25 i=1,nsn
255 j=nsv(i)
256 xmin=
min(xmin,x(1,j))
257 ymin=
min(ymin,x(2,j))
258 zmin=
min(zmin,x(3,j))
259 xmax=
max(xmax,x(1,j))
261 zmax=
max(zmax,x(3,j))
262 25 CONTINUE
263
264 bminma(1) =
max(bminma(1),xmax)
265 bminma(2) =
max(bminma(2),
ymax)
266 bminma(3) =
max(bminma(3),zmax)
267 bminma(4) =
min(bminma(4),xmin)
268 bminma(5) =
min(bminma(5),ymin)
269 bminma(6) =
min(bminma(6),zmin)
270
271 xyzm(1) = bminma(4)
272 xyzm(2) = bminma(5)
273 xyzm(3) = bminma(6)
274 xyzm(4) = bminma(1)
275 xyzm(5) = bminma(2)
276 xyzm(6) = bminma(3)
277
278 aaa = sqrt(nmn /
279 . ((bminma(1)-bminma(4))*(bminma(2)-bminma(5))
280 . +(bminma(2)-bminma(5))*(bminma(3)-bminma(6))
281 . +(bminma(3)-bminma(6))*(bminma(1)-bminma(4))))
282
283 aaa = 0.75*aaa
284
285 nbx = nint(aaa*(bminma(1)-bminma(4)))
286 nby = nint(aaa*(bminma(2)-bminma(5)))
287 nbz = nint(aaa*(bminma(3)-bminma(6)))
291
292 nbx8=nbx
293 nby8=nby
294 nbz8=nbz
295 res8=(nbx8+2)*(nby8+2)*(nbz8+2)
297
298 IF(res8 > lvoxel8) THEN
300 aaa = aaa/((nbx8+2)*(nby8+2)*(nbz8+2))
301 aaa = aaa**(third)
302 nbx = int((nbx+2)*aaa)-2
303 nby = int((nby+2)*aaa)-2
304 nbz = int((nbz+2)*aaa)-2
308 ENDIF
309
310 nbx8=nbx
311 nby8=nby
312 nbz8=nbz
313 res8=(nbx8+2)*(nby8+2)*(nbz8+2)
314
315 IF(res8 > lvoxel8) THEN
316 nbx =
min(ihundred,
max(nbx8,ione))
317 nby =
min(ihundred,
max(nby8,ione))
318 nbz =
min(ihundred,
max(nbz8,ione))
319 END IF
320
321
322
323
324 ALLOCATE(npartns(nsn+1),ielem(nrtm),edge_l2(nsn))
325
326 npartns(1:nsn+1) = 0
327 ielem(1:nrtm) = 0
328 edge_l2(1:nsn) = zero
329 ledgmax = zero
330
331
332
333
334 nb_large_nodes = 0
335 ALLOCATE(large_node(nsn))
336 ALLOCATE(is_large_node(nsn))
338 is_large_node(1:nsn) = 0
339 large_node(1:nsn) = 0
340 nb_large_nodes = 0
342
343 IF(iddlevel==1)THEN
344
345
346 DO ie=1,nrtm
347
348 IF(ielem_m(1,ie)<=numels) THEN
349 ielem(ie)= ielem_m(1,ie)
350 ELSE
351 CALL insol25(irect ,ixs ,ixs10,ixs16,ixs20,
352 . knod2els ,nod2els ,nels ,ie )
353 ielem(ie)=nels
354 ENDIF
355 END DO
356
357 IF(inacti==5.OR.inacti==-1)THEN
358
359 ALLOCATE(edge_l2_tmp(numnod))
360 edge_l2_tmp(1:numnod)=zero
361 n_sol = 0
362 DO ie=1,nrtm
363 IF(stf(ie)> zero)THEN
364 DO il=1,4
365 n1=irect(il,ie)
366 n2=irect(mod(il,4)+1,ie)
367
368 aaa = (x(1,n2)-x(1,n1))*(x(1,n2)-x(1,n1))
369 . + (x(2,n2)-x(2,n1))*(x(2,n2)-x(2,n1))
370 . + (x(3,n2)-x(3,n1))*(x(3,n2)-x(3,n1))
371 edge_l2_tmp(n1) =
max(edge_l2_tmp(n1), aaa )
372 edge_l2_tmp(n2) =
max(edge_l2_tmp(n2), aaa )
373 IF (msegtyp(ie)==0.OR.msegtyp(ie)>nrtmt) THEN
375 n_sol= n_sol + 1
377 ENDIF
379 n_sol= n_sol + 1
381 ENDIF
382 ENDIF
383 END DO
384 ENDIF
385
386 END DO
387
388
389 DO i=1,nsn
390 n=nsv(i)
391 IF(stfn(i)/=zero) THEN
392 edge_l2(i) = half*sqrt(edge_l2_tmp(n))
393 IF(
tagnod(n)==1) ledgmax=ledgmax+edge_l2(i)
394 END IF
395 END DO
396
397 IF(n_sol > 0) ledgmax=half*ledgmax/n_sol
398
399
400 DEALLOCATE(edge_l2_tmp)
401
402 ENDIF
403
404
405 tagp(1:npart) =0
406
407 DO i=1,nsn
408 n=nsv(i)
409 DO iad=knod2els(n)+1,knod2els(n+1)
410 ie=nod2els(iad)
411 ip=iparts(ie)
412 IF(tagp(ip)==0)THEN
413 npartns(i)=npartns(i)+1
414 tagp(ip) =1
415 END IF
416 END DO
417 DO iad=knod2els(n)+1,knod2els(n+1)
418 ie=nod2els(iad)
419 ip=iparts(ie)
420 tagp(ip) =0
421 END DO
422 END DO
423
424 DO i=1,nsn
425 npartns(i+1) = npartns(i+1) + npartns(i)
426 END DO
427 DO i=nsn,1,-1
428 npartns(i+1) = npartns(i)
429 END DO
430 npartns(1)=0
431
432 ALLOCATE(lpartns(npartns(nsn+1)))
433
434 DO i=1,nsn
435 n=nsv(i)
436 DO iad=knod2els(n)+1,knod2els(n+1)
437 ie=nod2els(iad)
438 ip=iparts(ie)
439 IF(tagp(ip)==0)THEN
440 npartns(i)=npartns(i)+1
441 lpartns(npartns(i))=ip
442 tagp(ip) =1
443 END IF
444 END DO
445 DO iad=knod2els(n)+1,knod2els(n+1)
446 ie=nod2els(iad)
447 ip=iparts(ie)
448 tagp(ip) =0
449 END DO
450 END DO
451
452 DO i=nsn,1,-1
453 npartns(i+1) = npartns(i)
454 END DO
455 npartns(1)=0
456
457
458
459
460 ELSE
461 ALLOCATE(lpartns(0))
462 END IF
463
464
465
466 DO i=
inivoxel,(nbx+2)*(nby+2)*(nbz+2)
468 ENDDO
470
471 eshift=0
472
473 i_stok = 0
474
475 ALLOCATE(local_next_nod(nsn))
476 ALLOCATE(iix(nsn))
477 ALLOCATE(iiy(nsn))
478 ALLOCATE(iiz(nsn))
479
480
482 1 nsn ,irect ,x ,
483 2 stfn ,xyzm ,nsv ,i_stok ,
484 3 eshift ,bgapsmx ,
485 4
voxel1 ,nbx ,nby ,nbz ,nrtm ,
486 5 gap_s ,gap_m ,marge_st,
487 6 nbinflg ,mbinflg ,ilev ,msegtyp ,
488 7 igap ,gap_s_l ,gap_m_l ,edge_l2 ,ledgmax ,
489 8 kremnode,remnode,
490 9 iparts ,npartns ,lpartns ,ielem ,icode ,
491 a iskew ,drad, is_large_node, large_node, nb_large_nodes,
492 b dgapload,nrtmt,flag_removed_node,
493 c ielem_m,local_next_nod,iix,iiy,iiz,
494 d intbuf_tab,ipari,nin)
495
496 DEALLOCATE(local_next_nod)
497 DEALLOCATE(iix)
498 DEALLOCATE(iiy)
499 DEALLOCATE(iiz)
500
501 DEALLOCATE(edge_l2,npartns,ielem,lpartns)
502 DEALLOCATE(is_large_node,large_node,
tagnod)
503
504 IF(nsn/=0)THEN
505 WRITE(iout,*)' POSSIBLE IMPACT NUMBER, NSN:',i_stok,nsn
506
507 ELSE
509 . msgtype=msgwarning,
510 . anmode=aninfo_blind_2,
512 . c1=titr)
513 ENDIF
514
515 RETURN
subroutine insol25(irect, ixs, ixs10, ixs16, ixs20, knod2els, nod2els, nel, i)
subroutine i25trivox1(nsn, irect, x, stfn, xyzm, nsv, ii_stok, eshift, bgapsmx, voxel, nbx, nby, nbz, nrtm, gap_s, gap_m, marge, nbinflg, mbinflg, ilev, msegtyp, igap, gap_s_l, gap_m_l, edge_l2, ledgmax, kremnode, remnode, iparts, npartns, lpartns, ielem, icode, iskew, drad, is_large_node, large_node, nb_large_nodes, dgapload, nrtmt, flag_removed_node, ielem_m, local_next_nod, iix, iiy, iiz, intbuf_tab, ipari, nin)
subroutine ymax(idn, fac, npc, pld, stiffmin, stiffmax, stiffini, stiffavg)
integer, parameter nchartitle
integer, dimension(lvoxel) voxel1
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
subroutine tagnod(ix, nix, nix1, nix2, numel, iparte, tagbuf, npart)