OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
i10optcd.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!|| i10optcd ../engine/source/interfaces/intsort/i10optcd.F
25!||--- called by ------------------------------------------------------
26!|| i10main_opt_tri ../engine/source/interfaces/intsort/i10opt_opt_tri.F
27!||--- calls -----------------------------------------------------
28!|| sync_data ../engine/source/system/machine.F
29!||--- uses -----------------------------------------------------
30!|| tri7box ../engine/share/modules/tri7box.F
31!||====================================================================
32 SUBROUTINE i10optcd(NSV ,CAND_E,CAND_N,X ,I_STOK,
33 1 IRECT,GAP ,GAP_S ,GAP_M ,IGAP ,
34 2 ITASK,NIN ,NSN ,STFN ,STF ,
35 3 COUNT_REMSLV, LSKYI_SMS_NEW)
36C============================================================================
37C M o d u l e s
38C-----------------------------------------------
39 USE tri7box
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43#include "implicit_f.inc"
44#include "comlock.inc"
45C-----------------------------------------------
46C G l o b a l P a r a m e t e r s
47C-----------------------------------------------
48#include "mvsiz_p.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 INTEGER IRECT(4,*), NSV(*), CAND_E(*), CAND_N(*),
53 . I_STOK, IGAP, ITASK, NSN, NIN,COUNT_REMSLV(*)
54 my_real
55 . x(3,*),gap,gap_s(*),gap_m(*),stfn(*),stf(*)
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "task_c.inc"
60#include "param_c.inc"
61#include "com01_c.inc"
62#include "parit_c.inc"
63C-----------------------------------------------
64C L o c a l V a r i a b l e s
65C-----------------------------------------------
66 INTEGER I , L
67 my_real
68 . XI,X1,X2,X3,X4,YI,Y1,Y2,Y3,Y4,ZI,Z1,Z2,Z3,Z4,
69 . xmin,xmax,ymin,ymax,zmin,zmax
70 INTEGER MSEG
71 INTEGER LIST(MVSIZ), LISTI(MVSIZ)
72 INTEGER IS,JS,LS,NLS,NLT,NSEG, II, NLF, NLS2
73 INTEGER IG(MVSIZ),IX1(MVSIZ),IX2(MVSIZ),IX3(MVSIZ),IX4(MVSIZ)
74 INTEGER SG, FIRST, LAST,COUNT_CAND,CT
75 my_real
76 . gapv(mvsiz)
77 INTEGER,INTENT(INOUT) :: LSKYI_SMS_NEW
78C-----------------------------------------------
79 count_cand=0
80 ct = 0
81 mseg = nvsiz
82 first = 1 + i_stok*itask / nthread
83 last = i_stok*(itask+1) / nthread
84 js = first-1
85 DO sg = first,last,mseg
86 nseg = min(mseg,last-js)
87 nls=0
88 IF(nspmd>1) THEN
89C
90C Partage cand_n local / frontiere
91C
92 nls = 0
93 nls2 = nseg+1
94 DO is = 1, nseg
95 i=js+is
96 IF(cand_n(i)<=nsn)THEN
97 nls=nls+1
98 listi(nls)=is
99 ELSE
100 nls2=nls2-1
101 listi(nls2) = is
102 ENDIF
103 ENDDO
104 IF(igap==0)THEN
105 DO ls = 1, nls
106 is = listi(ls)
107 gapv(is)=gap
108 ENDDO
109 ELSE
110 DO ls = 1, nls
111 is = listi(ls)
112 i=js+is
113 gapv(is)=gap_s(cand_n(i))+gap_m(cand_e(i))
114 gapv(is)=max(gapv(is),gap)
115 ENDDO
116 ENDIF
117 ELSE
118 nls = nseg
119C
120 IF(igap==0)THEN
121 DO is=1,nseg
122 gapv(is)=gap
123 listi(is)=is
124 ENDDO
125 ELSE
126 DO is=1,nseg
127 i=js+is
128 gapv(is)=gap_s(cand_n(i))+gap_m(cand_e(i))
129 gapv(is)=max(gapv(is),gap)
130 ENDDO
131 ENDIF
132 ENDIF
133C
134 nlf = 1
135 nlt = nls
136 nls=0
137 DO ls = nlf, nlt
138C conserver LISTI et LIST pour optimiser le code genere (IA64)
139 is = listi(ls)
140 i=js+is
141 l = cand_e(i)
142 IF(stf(l)/=zero.AND.stfn(cand_n(i))/=zero) THEN
143 ig(is) = nsv(cand_n(i))
144 zi = x(3,ig(is))
145 ix1(is)=irect(1,l)
146 z1=x(3,ix1(is))
147 ix2(is)=irect(2,l)
148 z2=x(3,ix2(is))
149 ix3(is)=irect(3,l)
150 z3=x(3,ix3(is))
151 ix4(is)=irect(4,l)
152 z4=x(3,ix4(is))
153 zmin = min(z1,z2,z3,z4)-gapv(is)
154 zmax = max(z1,z2,z3,z4)+gapv(is)
155 IF (zmin<=zi.AND.zmax>=zi) THEN
156 nls=nls+1
157 list(nls)=is
158 ENDIF
159 END IF
160 ENDDO
161C
162 nlt=nls
163 nls=0
164 DO ls=nlf,nlt
165 is=list(ls)
166 yi=x(2,ig(is))
167 y1=x(2,ix1(is))
168 y2=x(2,ix2(is))
169 y3=x(2,ix3(is))
170 y4=x(2,ix4(is))
171 ymin = min(y1,y2,y3,y4)-gapv(is)
172 ymax = max(y1,y2,y3,y4)+gapv(is)
173 IF (ymin<=yi.AND.ymax>=yi) THEN
174 nls=nls+1
175 list(nls)=is
176 ENDIF
177 ENDDO
178C
179 DO ls=nlf,nls
180 is=list(ls)
181 xi=x(1,ig(is))
182 x1=x(1,ix1(is))
183 x2=x(1,ix2(is))
184 x3=x(1,ix3(is))
185 x4=x(1,ix4(is))
186 xmin = min(x1,x2,x3,x4)-gapv(is)
187 xmax = max(x1,x2,x3,x4)+gapv(is)
188 IF (xmin<=xi.AND.xmax>=xi) THEN
189 i=js+is
190 cand_n(i) = -cand_n(i)
191 count_cand = count_cand+1
192 ENDIF
193 ENDDO
194 IF(nspmd>1)THEN
195 nlf = nls2
196 nlt = nseg
197 IF(igap==0)THEN
198 DO ls = nlf, nlt
199 is = listi(ls)
200 gapv(is)=gap
201 ENDDO
202 ELSE
203 DO ls = nlf, nlt
204 is = listi(ls)
205 i=js+is
206 gapv(is)=gapfi(nin)%P(cand_n(i)-nsn)+gap_m(cand_e(i))
207 gapv(is)=max(gapv(is),gap)
208 ENDDO
209 ENDIF
210 nls=0
211 DO ls = nlf, nlt
212 is = listi(ls)
213 i=js+is
214 ii = cand_n(i)-nsn
215 l = cand_e(i)
216 IF(stf(l)/=zero.AND.stifi(nin)%P(ii)/=zero) THEN
217 zi = xfi(nin)%P(3,ii)
218 ix1(is)=irect(1,l)
219 z1=x(3,ix1(is))
220 ix2(is)=irect(2,l)
221 z2=x(3,ix2(is))
222 ix3(is)=irect(3,l)
223 z3=x(3,ix3(is))
224 ix4(is)=irect(4,l)
225 z4=x(3,ix4(is))
226 zmin = min(z1,z2,z3,z4)-gapv(is)
227 zmax = max(z1,z2,z3,z4)+gapv(is)
228 IF (zmin<=zi.AND.zmax>=zi) THEN
229 nls=nls+1
230 list(nls)=is
231 ENDIF
232 END IF
233 ENDDO
234C
235 nlf=1
236 nlt=nls
237 nls=0
238 DO ls=nlf,nlt
239 is=list(ls)
240 i=js+is
241 ii=cand_n(i)-nsn
242 yi=xfi(nin)%P(2,ii)
243 y1=x(2,ix1(is))
244 y2=x(2,ix2(is))
245 y3=x(2,ix3(is))
246 y4=x(2,ix4(is))
247 ymin = min(y1,y2,y3,y4)-gapv(is)
248 ymax = max(y1,y2,y3,y4)+gapv(is)
249 IF (ymin<=yi.AND.ymax>=yi) THEN
250 nls=nls+1
251 list(nls)=is
252 ENDIF
253 ENDDO
254C
255 DO ls=nlf,nls
256 is=list(ls)
257 i=js+is
258 ii = cand_n(i)-nsn
259 xi = xfi(nin)%P(1,ii)
260 x1=x(1,ix1(is))
261 x2=x(1,ix2(is))
262 x3=x(1,ix3(is))
263 x4=x(1,ix4(is))
264 xmin = min(x1,x2,x3,x4)-gapv(is)
265 xmax = max(x1,x2,x3,x4)+gapv(is)
266 IF (xmin<=xi.AND.xmax>=xi) THEN
267 cand_n(i) = -cand_n(i)
268 count_cand = count_cand+1
269 ct = ct + 1
270 ENDIF
271 ENDDO
272 ELSE
273 CALL sync_data(nls2)
274 ENDIF
275 js = js + nseg
276 ENDDO
277C
278 IF (count_cand > 0)THEN
279#include "lockon.inc"
280 lskyi_count=lskyi_count+count_cand*5
281 count_remslv(nin)=count_remslv(nin)+ct
282 lskyi_sms_new = lskyi_sms_new + count_cand
283#include "lockoff.inc"
284 ENDIF
285
286 RETURN
287 END
288
subroutine sync_data(ii)
Definition machine.F:381
subroutine i10optcd(nsv, cand_e, cand_n, x, i_stok, irect, gap, gap_s, gap_m, igap, itask, nin, nsn, stfn, stf, count_remslv, lskyi_sms_new)
Definition i10optcd.F:36
subroutine ymax(idn, fac, npc, pld, stiffmin, stiffmax, stiffini, stiffavg)
Definition law100_upd.F:272
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
type(real_pointer), dimension(:), allocatable stifi
Definition tri7box.F:449
type(real_pointer), dimension(:), allocatable gapfi
Definition tri7box.F:449
type(real_pointer2), dimension(:), allocatable xfi
Definition tri7box.F:459