OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
iombr.F File Reference
#include "implicit_f.inc"
#include "scr11_c.inc"
#include "com04_c.inc"

Go to the source code of this file.

Functions/Subroutines

integer function iombr (detonator_wave_shaper, x, iecr, ddmx, vdet_arg)

Function/Subroutine Documentation

◆ iombr()

integer function iombr ( type(detonator_wave_shaper_struct_) detonator_wave_shaper,
x,
integer, dimension(*) iecr,
ddmx,
vdet_arg )

Definition at line 31 of file iombr.F.

33C-----------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36#include "implicit_f.inc"
37C-----------------------------------------------
38C D u m m y A r g u m e n t s
39C-----------------------------------------------
40 my_real ddmx
41 INTEGER IECR(*)
42 my_real x(3,numnod)
43 my_real vdet_arg
44 TYPE(DETONATOR_WAVE_SHAPER_STRUCT_) :: DETONATOR_WAVE_SHAPER
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "scr11_c.inc"
49#include "com04_c.inc"
50C-----------------------------------------------
51C L o c a l V a r i a b l e s
52C-----------------------------------------------
53 INTEGER JOMBR, KOMBR, II, I,NPE
54 my_real yld, zld, dd, d2, eps, dd_up, dd_down,
55 . y2, z2, y1, z1, cross_prod_1,cross_prod_2,
56 . d1, y12, z12, a1, a2, a3, y3, z3, d3
57C-----------------------------------------------
58
59 npe = detonator_wave_shaper%NUMNOD !number of points
60 iombr=0 !function result
61 jombr=0
62 kombr=0
63 !YD,ZD : detonation source
64 !YL,ZL : point for which lightening time is going to be computed
65 yld=yl-yd
66 zld=zl-zd
67 dd=yld**2+zld**2 !distance from source
68
69 IF(dd > ddmx)THEN
70 iombr=2 !function result
71 GOTO 999
72 ENDIF
73
74 !--initialization first node
75 eps=em5*dd
76 dd_up=dd+eps
77 dd_down=dd-eps
78 ii=iecr(1)
79 y2=x(2,ii)
80 z2=x(3,ii)
81 cross_prod_2=yld*(z2-zd)-zld*(y2-yd)
82 d2 =(y2-yd)*yld+(z2-zd)*zld
83
84 !--loop over nodes
85 DO i=2,npe
86 y1=y2
87 z1=z2
88 cross_prod_1=cross_prod_2
89 d1 =d2
90 ii=iecr(i)
91 y2=x(2,ii)
92 z2=x(3,ii)
93 cross_prod_2=yld*(z2-zd)-zld*(y2-yd)
94 d2=(y2-yd)*yld+(z2-zd)*zld
95 IF(cross_prod_1*cross_prod_2 <= eps)THEN
96 !Pi-1 and Pi in different half planes of boundary (DL)
97 IF(d2 > dd_up .AND. d1 > dd_up)THEN
98 !Pi-1 and Pi after L
99 iombr=0
100 ELSEIF(d2 < -eps.AND.d1 < -eps)THEN
101 !Pi-1 and Pi before D
102 iombr=0
103 ELSE
104 !SEARCHING INTERSECTION [Pi-1,Pi] with [DL]
105 y12=y1-y2
106 z12=z1-z2
107 a1=yl*zld-zl*yld
108 a2=y1*z12-z1*y12
109 a3=y12*zld-z12*yld
110 IF(abs(a3) > eps)THEN
111 y3=(y12*a1-yld*a2)/a3
112 z3=(z12*a1-zld*a2)/a3
113 d3=(y3-yd)*yld+(z3-zd)*zld
114 IF(d3 > dd_up.OR.d3 < -eps)THEN
115 iombr=0
116 ELSEIF(d3 > eps.AND.d3 < dd_down)THEN
117 !intersection inside
118 iombr=1
119 GOTO 999
120 ELSEIF(abs(d3) <= eps)THEN
121 !intersection in extremity D
122 IF(a3 > eps)jombr=1
123 ELSEIF(abs(d3-dd) <= eps)THEN
124 !intersection in extremity L
125 IF(a3 < -eps)kombr=1
126 ELSE
127 iombr=0
128 ENDIF !(D3 > DD_UP.OR.D3 < -EPS)
129 ELSE
130 iombr=0
131 ENDIF !(ABS(A3) > EPS)
132 ENDIF !(D2 > DD_UP.AND.D1 > DD_UP)
133 ELSE
134 !(CROSS_PROD_1*CROSS_PROD_2 > EPS) Pi-1 and Pi are in the same half plane of boundary (DL)
135 iombr=0
136 ENDIF !(CROSS_PROD_1*CROSS_PROD_2<=EPS)
137 END DO !I=2,NPE
138
139 IF(jombr+kombr == 2)THEN
140 iombr=1
141 ELSE
142 dto=dto0+sqrt(dd)/vdet_arg
143 ENDIF
144
145 999 CONTINUE
146 IF(iombr == 0)ddmx=dd
147
148 RETURN
#define my_real
Definition cppsort.cpp:32
integer function iombr(detonator_wave_shaper, x, iecr, ddmx, vdet_arg)
Definition iombr.F:32