OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
i14can.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| i14can ../engine/source/interfaces/int14/i14can.F
25!||--- called by ------------------------------------------------------
26!|| i14cmp ../engine/source/interfaces/int14/i14cmp.F
27!||--- uses -----------------------------------------------------
28!|| groupdef_mod ../common_source/modules/groupdef_mod.F
29!||====================================================================
30 SUBROUTINE i14can(NSI ,KSI ,X ,
31 2 KSURF ,IGRSURF ,BUFSF,
32 3 G ,
33 4 NSC ,KSC ,NSP ,KSP ,
34 5 IMPACT,CIMP,NIMP,EW )
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
53 my_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
62 my_real
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
159 END
subroutine i14can(nsi, ksi, x, ksurf, igrsurf, bufsf, g, nsc, ksc, nsp, ksp, impact, cimp, nimp, ew)
Definition i14can.F:35
#define min(a, b)
Definition macros.h:20