OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
iqel03.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!|| iqel03 ../engine/source/ale/ale3d/iqel03.F
25!||--- called by ------------------------------------------------------
26!|| intal2 ../engine/source/ale/inter/intal2.F
27!||====================================================================
28 SUBROUTINE iqel03(X,IRECT,LMSR,MSR,NSV,ILOC,IRTL,NSN,NSEG,CRST,NOR)
29C-----------------------------------------------
30C I m p l i c i t T y p e s
31C-----------------------------------------------
32#include "implicit_f.inc"
33C-----------------------------------------------
34C D u m m y A r g u m e n t s
35C-----------------------------------------------
36 INTEGER,INTENT(IN) :: NSN
37 INTEGER,INTENT(IN) :: IRECT(4,*), LMSR(*), MSR(*), NSV(*), ILOC(*), IRTL(*),NSEG(*)
38 my_real,INTENT(IN) :: x(3,numnod), crst(2,*)
39 my_real,INTENT(INOUT) :: nor(3,*)
40C-----------------------------------------------
41C C o m m o n B l o c k s
42C-----------------------------------------------
43#include "scr08_a_c.inc"
44#include "com04_c.inc"
45C-----------------------------------------------
46C L o c a l V a r i a b l e s
47C-----------------------------------------------
48 INTEGER II, I, J, K, L, JJ, NN, LK, NUM, NPT, K1, K2, K3, NODE1,NODE2, KK
49 my_real n1, n2, n3, xx112, xx212, xx312, xx114, xx214, xx314, xx123,
50 . xx223, xx323, xx134, xx234, xx334, ss, tt, tp, tm, fs1, fs2,
51 . fs3, sp, sm, ft1, ft2, ft3, sck, tck, aj4, aj5, aj6, aj7, aj8,
52 . aj9, v1, v2, v3, xmg, xm1, xm2,
53 . xs1,ys1,zs1
54C-----------------------------------------------
55C S o u r c e L i n e s
56C-----------------------------------------------
57 DO ii=1,nsn
58 i=nsv(ii)
59 j=iloc(ii)
60 k=msr(j)
61 l=irtl(ii)
62 DO jj=1,4
63 nn = msr(irect(jj,l))
64 ix(jj) = nn
65 xx1(jj) = x(1,nn)
66 xx2(jj) = x(2,nn)
67 xx3(jj) = x(3,nn)
68 ENDDO !next JJ
69 xs1=x(1,i)
70 ys1=x(2,i)
71 zs1=x(3,i)
72 xx112=xx1(1)-xx1(2)
73 xx212=xx2(1)-xx2(2)
74 xx312=xx3(1)-xx3(2)
75 xx114=xx1(1)-xx1(4)
76 xx214=xx2(1)-xx2(4)
77 xx314=xx3(1)-xx3(4)
78 xx123=xx1(2)-xx1(3)
79 xx223=xx2(2)-xx2(3)
80 xx323=xx3(2)-xx3(3)
81 xx134=xx1(3)-xx1(4)
82 xx234=xx2(3)-xx2(4)
83 xx334=xx3(3)-xx3(4)
84 ss=crst(1,ii)
85 tt=crst(2,ii)
86 tp=fourth*(one + tt)
87 tm=fourth*(one - tt)
88 fs1=tp*xx134-tm*xx112
89 fs2=tp*xx234-tm*xx212
90 fs3=tp*xx334-tm*xx312
91 ! Specific Case
92 IF(ix(3) == ix(4) .AND. tm == zero) THEN
93 fs1=-xx112
94 fs2=-xx212
95 fs3=-xx312
96 ENDIF
97
98 sp=one + ss
99 sm=one - ss
100 ft1=-sm*xx114-sp*xx123
101 ft2=-sm*xx214-sp*xx223
102 ft3=-sm*xx314-sp*xx323
103
104 n1=fs2*ft3-fs3*ft2
105 n2=fs3*ft1-fs1*ft3
106 n3=fs1*ft2-fs2*ft1
107
108 sck=abs(ss) - one
109 tck=abs(tt) - one
110
111 lk=l
112 num=nseg(j+1)-nseg(j)
113 IF(num <= 4 .AND. (abs(sck) <= fiveem2.OR.abs(tck) <= fiveem2) ) THEN
114 npt = nseg(j)-1
115 n1 = zero
116 n2 = zero
117 n3 = zero
118 IF(abs(sck) > fiveem2 .OR. abs(tck) > fiveem2) THEN
119 !C----------------------------------------------------
120 !C TREATMENT SPECIFIC TO CORNERS
121 !C---------------------------------------------------
122 IF(k == ix(1)) THEN
123 k1=1
124 k2=2
125 k3=4
126 ELSEIF(k == ix(2)) THEN
127 k1=2
128 k2=3
129 k3=1
130 ELSEIF(k == ix(3)) THEN
131 k1=3
132 k2=4
133 k3=2
134 IF(ix(3) == ix(4)) k2=1
135 ELSE
136 k1=4
137 k2=1
138 k3=3
139 ENDIF
140 aj4=xx1(k2)-xx1(k1)
141 aj5=xx2(k2)-xx2(k1)
142 aj6=xx3(k2)-xx3(k1)
143 aj7=xx1(k3)-xx1(k1)
144 aj8=xx2(k3)-xx2(k1)
145 aj9=xx3(k3)-xx3(k1)
146 n1=n1+aj5*aj9-aj6*aj8
147 n2=n2+aj6*aj7-aj4*aj9
148 n3=n3+aj4*aj8-aj5*aj7
149 v1=xs1-xx1(k1)
150 v2=ys1-xx2(k1)
151 v3=zs1-xx3(k1)
152 xmg=sqrt(aj4**2+aj5**2+aj6**2)
153 xm1=(v1*aj4+v2*aj5+v3*aj6)/xmg
154 xmg=sqrt(aj7**2+aj8**2+aj9**2)
155 xm2=(v1*aj7+v2*aj8+v3*aj9)/xmg
156 node1=ix(k1)
157 node2=ix(k2)
158 IF(xm2 > xm1) node2=ix(k3)
159 DO jj=1,num
160 l=lmsr(npt+jj)
161 IF(l /= lk) THEN
162 DO kk=1,4
163 nn=msr(irect(kk,l))
164 ix(kk)=nn
165 xx1(kk)=x(1,nn)
166 xx2(kk)=x(2,nn)
167 xx3(kk)=x(3,nn)
168 ENDDO !next KK
169 IF(k == ix(1))THEN
170 k1=1
171 k2=2
172 k3=4
173 ELSEIF(k == ix(2))THEN
174 k1=2
175 k2=3
176 k3=1
177 ELSEIF(k == ix(3))THEN
178 k1=3
179 k2=4
180 k3=2
181 IF(ix(3) == ix(4)) k2=1
182 ELSE
183 k1=4
184 k2=1
185 k3=3
186 ENDIF
187 IF(node2 == ix(k2) .OR. node2 == ix(k3)) THEN
188 aj4 = xx1(k2)-xx1(k1)
189 aj5 = xx2(k2)-xx2(k1)
190 aj6 = xx3(k2)-xx3(k1)
191 aj7 = xx1(k3)-xx1(k1)
192 aj8 = xx2(k3)-xx2(k1)
193 aj9 = xx3(k3)-xx3(k1)
194 n1 = n1+aj5*aj9-aj6*aj8
195 n2 = n2+aj6*aj7-aj4*aj9
196 n3 = n3+aj4*aj8-aj5*aj7
197 ENDIF
198 endif!IF(L /= LK)
199 ENDDO !next JJ
200 ELSE
201 !C------------------------------------------------------
202 !C TREATMENT SPECIFIC TO CORNERS
203 !C------------------------------------------------------
204 DO jj=1,num
205 l=lmsr(npt+jj)
206 DO kk=1,4
207 nn=msr(irect(kk,l))
208 ix(kk) = nn
209 xx1(kk) = x(1,nn)
210 xx2(kk) = x(2,nn)
211 xx3(kk) = x(3,nn)
212 ENDDO !next KK
213 IF(k == ix(1)) THEN
214 k1=1
215 k2=2
216 k3=4
217 ELSEIF(k == ix(2))THEN
218 k1=2
219 k2=3
220 k3=1
221 ELSEIF(k == ix(3))THEN
222 k1=3
223 k2=4
224 k3=2
225 IF(ix(3) == ix(4)) k2=1
226 ELSE
227 k1=4
228 k2=1
229 k3=3
230 ENDIF
231 aj4=xx1(k2)-xx1(k1)
232 aj5=xx2(k2)-xx2(k1)
233 aj6=xx3(k2)-xx3(k1)
234 aj7=xx1(k3)-xx1(k1)
235 aj8=xx2(k3)-xx2(k1)
236 aj9=xx3(k3)-xx3(k1)
237 n1=n1+aj5*aj9-aj6*aj8
238 n2=n2+aj6*aj7-aj4*aj9
239 n3=n3+aj4*aj8-aj5*aj7
240 ENDDO !next JJ
241 ENDIF
242 ENDIF
243 xmg = sqrt(n1*n1+n2*n2+n3*n3)
244 n1 = n1/xmg
245 n2 = n2/xmg
246 n3 = n3/xmg
247 nor(1,ii) = n1
248 nor(2,ii) = n2
249 nor(3,ii) = n3
250 ENDDO !next II
251C-----------------------------------------------
252 RETURN
253 END
#define my_real
Definition cppsort.cpp:32
subroutine iqel03(x, irect, lmsr, msr, nsv, iloc, irtl, nsn, nseg, crst, nor)
Definition iqel03.F:29