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

Go to the source code of this file.

Functions/Subroutines

subroutine i14can (nsi, ksi, x, ksurf, igrsurf, bufsf, g, nsc, ksc, nsp, ksp, impact, cimp, nimp, ew)

Function/Subroutine Documentation

◆ i14can()

subroutine i14can ( integer nsi,
integer, dimension(*) ksi,
x,
integer ksurf,
type (surf_), dimension(nsurf) igrsurf,
bufsf,
g,
integer nsc,
ksc,
integer nsp,
ksp,
integer, dimension(*) impact,
cimp,
nimp,
ew )

Definition at line 30 of file i14can.F.

35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE groupdef_mod
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42#include "implicit_f.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "com04_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER NSI, NSC, NSP, KSURF,
51 . KSI(*), IMPACT(*)
52C REAL
54 . x(3,*), bufsf(*), g, ksc(*), ksp(*),
55 . cimp(3,*),nimp(3,*),ew(*)
56 TYPE (SURF_) , DIMENSION(NSURF) :: IGRSURF
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60 INTEGER ADRBUF, I, IN, IL
61 INTEGER DGR
63 . xg, yg, zg, a, b, c, rot(9),
64 . an, bn, cn, hn,
65 . trmx, trmy, trmz, trmxn, trmyn, trmzn,
66 . xp, yp, zp,
67 . d, h, eg(6), epg
68C-----------------------------------------------
69 adrbuf=igrsurf(ksurf)%IAD_BUFR
70C
71 dgr=bufsf(adrbuf+36)
72 xg=bufsf(adrbuf+4)
73 yg=bufsf(adrbuf+5)
74 zg=bufsf(adrbuf+6)
75 a =bufsf(adrbuf+1)
76 b =bufsf(adrbuf+2)
77 c =bufsf(adrbuf+3)
78C
79 d=min(a,b,c)
80 d=one/d
81C---------------------------------
82 an=a**dgr
83 bn=b**dgr
84 cn=c**dgr
85 an=one/an
86 bn=one/bn
87 cn=one/cn
88 DO i=1,9
89 rot(i)=bufsf(adrbuf+7+i-1)
90 END DO
91C-----------------------------------------------
92 nsc=0
93 nsp=0
94C-----------------------------------------------
95C Calcul de EG (coefs de l'equation de l'ellipse
96C dans rep. global centre en G).
97C Warning : Xloc = [ROT] Xglo
98C EG(1)=ROT(1)*ROT(1)*A2+ROT(4)*ROT(4)*B2+ROT(7)*ROT(7)*C2
99C EG(2)=ROT(1)*ROT(2)*A2+ROT(4)*ROT(5)*B2+ROT(7)*ROT(8)*C2
100C EG(3)=ROT(1)*ROT(3)*A2+ROT(4)*ROT(6)*B2+ROT(7)*ROT(9)*C2
101C EG(4)=ROT(2)*ROT(2)*A2+ROT(5)*ROT(5)*B2+ROT(8)*ROT(8)*C2
102C EG(5)=ROT(2)*ROT(3)*A2+ROT(5)*ROT(6)*B2+ROT(8)*ROT(9)*C2
103C EG(6)=ROT(3)*ROT(3)*A2+ROT(6)*ROT(6)*B2+ROT(9)*ROT(9)*C2
104C------------------------
105#include "vectorize.inc"
106 DO 110 i=1,nsi
107 in=ksi(i)
108 xp=x(1,in)-xg
109 yp=x(2,in)-yg
110 zp=x(3,in)-zg
111 trmx=rot(1)*xp+rot(2)*yp+rot(3)*zp
112 trmy=rot(4)*xp+rot(5)*yp+rot(6)*zp
113 trmz=rot(7)*xp+rot(8)*yp+rot(9)*zp
114 IF (impact(i)==0) THEN
115C penetration / ellips.
116C EPG= EG(1)*XP*XP+EG(2)*XP*YP+EG(3)*XP*ZP
117C . +EG(4)*YP*YP+EG(5)*YP*ZP
118C . +EG(6)*ZP*ZP
119 trmxn=trmx**dgr
120 trmyn=trmy**dgr
121 trmzn=trmz**dgr
122 trmxn=abs(trmxn*an)
123 trmyn=abs(trmyn*bn)
124 trmzn=abs(trmzn*cn)
125 ew(in)=trmxn+trmyn+trmzn
126 ELSEIF (impact(i)>0) THEN
127C penetration / plan.
128 ew(in)= nimp(1,i)*(trmx-cimp(1,i))
129 . +nimp(2,i)*(trmy-cimp(2,i))
130 . +nimp(3,i)*(trmz-cimp(3,i))
131 ENDIF
132110 CONTINUE
133C---------------------------------
134 DO 120 i=1,nsi
135 in=ksi(i)
136 IF (impact(i)>0) THEN
137C---------------------------------
138 IF (ew(in) <= g) THEN
139 nsp=nsp+1
140 ksp(nsp)=i
141 ELSE
142 impact(i)=0
143 ENDIF
144 ELSE
145C---------------------------------
146C tri exhaustif.
147 h =one+g*d
148 hn=h**dgr
149 IF (ew(in) <= hn) THEN
150 nsc=nsc+1
151 ksc(nsc)=i
152 ELSE
153 impact(i)=0
154 END IF
155 END IF
156120 CONTINUE
157C---------------------------------
158 RETURN
#define my_real
Definition cppsort.cpp:32
#define min(a, b)
Definition macros.h:20