36
37
38
39
40
41
42
43
44
46
47
48
49#include "implicit_f.inc"
50
51
52
53#include "com04_c.inc"
54#include "param_c.inc"
55#include "ige3d_c.inc"
56
57
58
59 INTEGER IXIG3D(*),KXIG3D(NIXIG3D,*),IAD_KNOT,NKNOT1,NKNOT2,NKNOT3,
60 . ,DEGTANG1,DEGTANG2,IEL,DIR,
61 . TAB_REMOVE(*),TAB_STAY(*),TAB_FCTCUT(*),
62 . L_TAB_FCTCUT,DECALGEO,TAB_NEWFCT(*),
63 . FLAG_PRE,NUMPATCH
64 TYPE(TABCONPATCH_IG3D_), DIMENSION(*) :: TABCONPATCH
65 my_real knotlocpc(deg_max,3,*),gama(*),newknot
66 my_real x(3,*),v(3,*),d(3,*),ms(*),wige(*)
67
68
69
70 INTEGER I,J,ITFCT,OFFSET_KNOT,DIRTANG1,DIRTANG2,
71 . IDFCTCOUPEE,IDFCTCOUPEE1,IDFCTCOUPEE2,FLAG_REMOVE,ITNCTRL
73
74
75 newknotloc = 0
76 tol = em06
77
78 IF(dir==1) THEN
79 dirtang1 = 2
80 dirtang2 = 3
81 offset_knot = iad_knot
82 ELSEIF(dir==2) THEN
83 dirtang1 = 3
84 dirtang2 = 1
85 offset_knot = iad_knot+nknot1
86 ELSEIF(dir==3) THEN
87 dirtang1 = 1
88 dirtang2 = 2
89 offset_knot = iad_knot+nknot1+nknot2
90 ENDIF
91
92 DO itfct=1,l_tab_fctcut
93
94 idfctcoupee = tab_fctcut(itfct)
95
96 IF(newknot<knotlocpc(1,dir,decalgeo+idfctcoupee).OR.
97 . newknot>knotlocpc(deg+1,dir,decalgeo+idfctcoupee)) cycle
98
99
100
101 IF(newknot>=knotlocpc(deg,dir,decalgeo+idfctcoupee)) THEN
102 alpha1=1
103 ELSE
104 alpha1=(newknot-knotlocpc(1,dir,decalgeo+idfctcoupee))/
105 / (knotlocpc(deg,dir,decalgeo+idfctcoupee)-knotlocpc(1,dir,decalgeo+idfctcoupee))
106 ENDIF
107 IF(newknot<=knotlocpc(2,dir,decalgeo+idfctcoupee)) THEN
109 ELSE
110 alpha2=(knotlocpc(deg+1,dir,decalgeo+idfctcoupee)-newknot)/
111 / (knotlocpc(deg+1,dir,decalgeo+idfctcoupee)-knotlocpc(2,dir,decalgeo+idfctcoupee))
112 ENDIF
113
114
115
116 i=deg+1
117 DO WHILE (knotlocpc(i-1,dir,decalgeo+idfctcoupee)>=newknot)
118 newknotloc(i,1)=knotlocpc(i-1,dir,decalgeo+idfctcoupee)
119 newknotloc(i,2)=knotlocpc(i,dir,decalgeo+idfctcoupee)
120 i=i-1
121 ENDDO
122 newknotloc(i,1)=newknot
123 newknotloc(i,2)=knotlocpc(i,dir,decalgeo+idfctcoupee)
124 i=i-1
125 newknotloc(i,1)=knotlocpc(i,dir,decalgeo+idfctcoupee)
126 newknotloc(i,2)=newknot
127 i=i-1
128 DO WHILE (i>2)
129 newknotloc(i,1)=knotlocpc(i-1,dir,decalgeo+idfctcoupee)
130 newknotloc(i,2)=knotlocpc(i,dir,decalgeo+idfctcoupee)
131 i=i-1
132 ENDDO
133 DO WHILE (i>=1)
134 newknotloc(i,1)=knotlocpc(i,dir,decalgeo+idfctcoupee)
135 newknotloc(i,2)=knotlocpc(i+1,dir,decalgeo+idfctcoupee)
136 i=i-1
137 ENDDO
138
139
140
141 DO j=1,l_tab_fctcut
142 idfctcoupee1 = tab_fctcut(j)
143 DO i=1,degtang1+1
144 IF(abs(knotlocpc(i,dirtang1,decalgeo+idfctcoupee)-knotlocpc(i,dirtang1,decalgeo+idfctcoupee1))>tol) EXIT
145 ENDDO
146 IF(i>degtang1+1) THEN
147 DO i=1,degtang2+1
148 IF(abs(knotlocpc(i,dirtang2,decalgeo+idfctcoupee)-knotlocpc(i,dirtang2,decalgeo+idfctcoupee1))>tol) EXIT
149 ENDDO
150 ENDIF
151 IF(i>degtang2+1) THEN
152 DO i=1,deg+1
153 IF(abs(newknotloc(i,1)-knotlocpc(i,dir,decalgeo+idfctcoupee1))>tol) EXIT
154 ENDDO
155 ENDIF
156 IF(i>deg+1) EXIT
157 ENDDO
158 IF(i>deg+1) THEN
159
160
161
162 IF(flag_pre==1) THEN
163 x(:,idfctcoupee1)=(x(:,idfctcoupee1)*gama(idfctcoupee1)+
164 . x(:,idfctcoupee)*gama(idfctcoupee)*alpha1)/
165 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
166 d(:,idfctcoupee1)=(d(:,idfctcoupee1)*gama(idfctcoupee1)+
167 . d(:,idfctcoupee)*gama(idfctcoupee)*alpha1)/
168 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
169 v(:,idfctcoupee1)=(v(:,idfctcoupee1)*gama(idfctcoupee1
170 . v(:,idfctcoupee)*gama(idfctcoupee)*alpha1)/
171 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
172 ms(idfctcoupee1)=(ms(idfctcoupee1)*gama(idfctcoupee1)+
173 . ms(idfctcoupee)*gama(idfctcoupee)*alpha1)/
174 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
175 wige(idfctcoupee1)=(wige(idfctcoupee1
176 . wige(idfctcoupee)*gama(idfctcoupee)*alpha1)/
177 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
178 ENDIF
179 gama(idfctcoupee1) = gama(idfctcoupee1)+alpha1*gama(idfctcoupee)
180 knotlocpc(:,dir,decalgeo+idfctcoupee1) = newknotloc(:,1)
181 ELSEIF(i<=deg+1) THEN
182 DO j=1,newfct
183 idfctcoupee1 = numnodige0+offset_newfct+j
184 DO i=1,degtang1+1
185 IF(abs(knotlocpc(i,dirtang1,decalgeo+idfctcoupee)-knotlocpc(i,dirtang1EXIT
186 ENDDO
187 IF(i>degtang1+1) THEN
188 DO i=1,degtang2+1
189 IF(abs(knotlocpc(i,dirtang2,decalgeo+idfctcoupee)-knotlocpc(i,dirtang2,decalgeo+idfctcoupee1))>tol) EXIT
190 ENDDO
191 ENDIF
192 IF(i>degtang2+1) THEN
193 DO i=1,deg+1
194 IF(abs(newknotloc(i,1)-knotlocpc(i,dir,decalgeo+idfctcoupee1))>tol) EXIT
195 ENDDO
196 ENDIF
197 IF(i>deg+1) EXIT
198 ENDDO
199 ENDIF
200 IF(i>deg+1) THEN
201
202
203
204 IF(flag_pre==1) THEN
205 x(:,numnodige0+offset_newfct+j)=(x(:,numnodige0+offset_newfct+j)*gama(idfctcoupee1)+
206 . x(:,idfctcoupee)*gama(idfctcoupee)*alpha1)/
207 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
208 d(:,numnodige0+offset_newfct+j)=(d(:,numnodige0+offset_newfct+j)*gama(idfctcoupee1)+
209 . d(:,idfctcoupee)*gama(idfctcoupee)*alpha1)/
210 . (gama(idfctcoupee1)+alpha1*gama
211 v(:,numnodige0+offset_newfct+j)=(v
212 . v(:,idfctcoupee)*gama(idfctcoupee)*alpha1)/
213 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
214 ms(numnodige0+offset_newfct+j)=(ms(numnodige0+offset_newfct+j)*gama(idfctcoupee1)+
215 . ms(idfctcoupee)*gama(idfctcoupee)*alpha1)/
216 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
217 wige(numnodige0+offset_newfct+j)=(wige(numnodige0+offset_newfct+j)*gama(idfctcoupee1)+
218 . wige(idfctcoupee)*gama(idfctcoupee)*alpha1)/
219 . (gama(idfctcoupee1)+alpha1*gama(idfctcoupee))
220 ENDIF
221 gama(idfctcoupee1) = gama(idfctcoupee1)+alpha1*gama(idfctcoupee)
222 knotlocpc(:,dir,decalgeo+idfctcoupee1) = newknotloc(:,1)
223 ELSE
224 newfct = newfct+1
225 l_tab_newfct = l_tab_newfct+1
226 IF(flag_pre==1) THEN
227 x(:,numnodige0+offset_newfct+newfct) = x(:,idfctcoupee)
228 d(:,numnodige0+offset_newfct+newfct) = d(:,idfctcoupee)
229 v(:,numnodige0+offset_newfct+newfct) = v(:,idfctcoupee)
230 ms(numnodige0+offset_newfct+newfct) = ms(idfctcoupee)
231 wige(numnodige0+offset_newfct+newfct) = wige(idfctcoupee)
232 ENDIF
233 gama(numnodige0+offset_newfct+newfct) = alpha1*gama(idfctcoupee)
234 knotlocpc(:,dir,decalgeo+numnodige0+offset_newfct+newfct) = newknotloc(:,1)
235 knotlocpc(:,dirtang1,decalgeo+numnodige0+offset_newfct+newfct) = knotlocpc(:,dirtang1,decalgeo+idfctcoupee)
236 knotlocpc(:,dirtang2,decalgeo+numnodige0+offset_newfct+newfct) = knotlocpc(:,dirtang2,decalgeo+idfctcoupee)
237 tab_newfct(l_tab_newfct) = numnodige0+offset_newfct+newfct
238 ENDIF
239
240 DO j=1,l_tab_fctcut
241 idfctcoupee2 = tab_fctcut(j)
242 DO i=1,degtang1+1
243 IF(abs(knotlocpc(i,dirtang1,decalgeo+idfctcoupee)-knotlocpc(i,dirtang1,decalgeo+idfctcoupee2))>tol) EXIT
244 ENDDO
245 IF(i>degtang1+1) THEN
246 DO i=1,degtang2+1
247 IF(abs(knotlocpc(i,dirtang2,decalgeo+idfctcoupee)-knotlocpc(i,dirtang2,decalgeo+idfctcoupee2))>tol) EXIT
248 ENDDO
249 ENDIF
250 IF(i>degtang2+1) THEN
251 DO i=1,deg+1
252 IF(abs(newknotloc(i,2)-knotlocpc(i,dir,decalgeo+idfctcoupee2))>tol) EXIT
253 ENDDO
254 ENDIF
255 IF(i>deg+1) EXIT
256 ENDDO
257 IF(i>deg+1) THEN
258
259
260
261 IF(flag_pre==1) THEN
262 x(:,idfctcoupee2)=(x(:,idfctcoupee2)*gama(idfctcoupee2)+
263 . x(:,idfctcoupee)*gama(idfctcoupee)*
alpha2)/
264 . (gama(idfctcoupee2)+
alpha2*gama
265 d(:,idfctcoupee2)=(d(:,idfctcoupee2)*gama(idfctcoupee2)+
266 . d(:,idfctcoupee)*gama(idfctcoupee)*
alpha2)/
267 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
268 v(:,idfctcoupee2)=(v(:,idfctcoupee2)*gama(idfctcoupee2)+
269 . v(:,idfctcoupee)*gama(idfctcoupee)*
alpha2)/
270 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
271 ms(idfctcoupee2)=(ms(idfctcoupee2)*gama(idfctcoupee2)+
272 . ms(idfctcoupee)*gama(idfctcoupee)*
alpha2)/
273 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
274 wige(idfctcoupee2)=(wige(idfctcoupee2)*gama(idfctcoupee2)+
275 . wige(idfctcoupee)*gama(idfctcoupee)*
alpha2
276 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
277 ENDIF
278 gama(idfctcoupee2) = gama(idfctcoupee2)+
alpha2*gama(idfctcoupee)
279 knotlocpc(:,dir,decalgeo+idfctcoupee2) = newknotloc(:,2)
280 ELSEIF(i<=deg+1) THEN
281 DO j=1,newfct
282 idfctcoupee2 = numnodige0+offset_newfct+j
283 DO i=1,degtang1+1
284 IF(abs(knotlocpc(i,dirtang1,decalgeo+idfctcoupeeEXIT
285 ENDDO
286 IF(i>degtang1+1) THEN
287 DO i=1,degtang2+1
288 IF(abs(knotlocpc(i,dirtang2,decalgeo+idfctcoupee)-knotlocpc(i,dirtang2EXIT
289 ENDDO
290 ENDIF
291 IF(i>degtang2+1) THEN
292 DO i=1,deg+1
293 IF(abs(newknotloc(i,2)-knotlocpc(i,dir,decalgeo+idfctcoupee2))>tol) EXIT
294 ENDDO
295 ENDIF
296 IF(i>deg+1) EXIT
297 ENDDO
298 ENDIF
299 IF(i>deg+1) THEN
300
301
302
303 IF(flag_pre==1) THEN
304 x(:,numnodige0+offset_newfct+j)=(x(:,numnodige0+offset_newfct
305 . x(:,idfctcoupee)*gama(idfctcoupee)*
alpha2)/
306 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
307 d(:,numnodige0+offset_newfct+j)=(d(:,numnodige0+offset_newfct+j)*gama(idfctcoupee2
308 . d(:,idfctcoupee)*gama(idfctcoupee)*
alpha2)/
309 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
310 v(:,numnodige0+offset_newfct+j)=(v(:,numnodige0+offset_newfct
311 . v(:,idfctcoupee)*gama(idfctcoupee)*
alpha2)/
312 . (gama(idfctcoupee2)+
alpha2
313 ms(numnodige0+offset_newfct+j)=(ms(numnodige0+offset_newfct+j
314 . ms(idfctcoupee)*gama(idfctcoupee)*
alpha2)/
315 . (gama(idfctcoupee2)+
alpha2*gama(idfctcoupee))
316 wige(numnodige0+offset_newfct+j)=(wige(numnodige0+offset_newfct+j)*gama(idfctcoupee2)+
317 . wige(idfctcoupee)*gama(idfctcoupee)*
alpha2)/
318 . (gama(idfctcoupee2)+
alpha2*gama
319 ENDIF
320 gama(idfctcoupee2) = gama(idfctcoupee2)+
alpha2*gama(idfctcoupee)
321 knotlocpc
322 ELSE
323 newfct = newfct+1
324 l_tab_newfct = l_tab_newfct+1
325 IF(flag_pre==1) THEN
326 x(:,numnodige0+offset_newfct+newfct) = x(:,idfctcoupee)
327 d(:,numnodige0+offset_newfct+newfct) = d(:,idfctcoupee)
328 v(:,numnodige0+offset_newfct+newfct) = v(:,idfctcoupee)
329 ms(numnodige0+offset_newfct+newfct) = ms(idfctcoupee)
330 wige(numnodige0+offset_newfct+newfct) = wige(idfctcoupee)
331 ENDIF
332 gama(numnodige0+offset_newfct+newfct) =
alpha2*gama(idfctcoupee)
333 knotlocpc(:,dir,decalgeo+numnodige0+offset_newfct+newfct) = newknotloc(:,2)
334 knotlocpc(:,dirtang1,decalgeo+numnodige0+offset_newfct+newfct) = knotlocpc(:,dirtang1,decalgeo+idfctcoupee)
335 knotlocpc(:,dirtang2,decalgeo+numnodige0+offset_newfct+newfct)
336 tab_newfct(l_tab_newfct) = numnodige0+offset_newfct+newfct
337 ENDIF
338
339
340
341
342
343 flag_remove=1
344 DO i=1,nbpart_ig3d
345 IF(i==numpatch) cycle
346 DO j=1,tabconpatch(i)%L_TAB_IG3D
347 DO itnctrl=1,kxig3d(3,tabconpatch(i)%TAB_IG3D(j))
348 IF(ixig3d(kxig3d(4,tabconpatch(i)%TAB_IG3D(j))+itnctrl-1)==idfctcoupee) THEN
349
350 flag_remove=0
351 ENDIF
352 ENDDO
353 ENDDO
354 ENDDO
355
356 IF(flag_remove==1) THEN
357 l_tab_remove = l_tab_remove+1
358 tab_remove(l_tab_remove) = idfctcoupee
359 ELSE
360 l_tab_stay = l_tab_stay+1
361 tab_stay(l_tab_stay) = idfctcoupee
362 ENDIF
363
364 ENDDO
365
366 RETURN