30 SUBROUTINE func_inters(TITR,MAT_ID,FUNC1,FUNC2,FAC1,FAC2,NPC,PLD,XINT,YINT)
38#include "implicit_f.inc"
42#include "tabsiz_c.inc"
46 CHARACTER(LEN=NCHARTITLE) :: TITR
47 INTEGER :: MAT_ID,FUNC1,FUNC2
49 INTEGER ,
DIMENSION(SNPC) :: NPC
52 INTENT(IN) :: titr,func1,func2,mat_id,npc,pld,fac1,fac2
53 INTENT(INOUT) :: xint,yint
57 INTEGER :: J,NP1,NP2,J1,K,K1,FOUND
58 my_real :: s1,s2,t1,t2,x1,x2,y1,y2,ax,bx,ay,by,cx,cy,dm,
alpha,beta
64 np1 = (npc(func1+1)-npc(func1)) / 2
65 np2 = (npc(func2+1)-npc(func2)) / 2
69 t1=pld(npc(func1)+j1+1)*fac1
73 y1=pld(npc(func2)+k1+1)*fac2
74 IF (x1 == s1 .AND. y1 == t1 .AND. x1> zero)
THEN
88 s2=pld(npc(func1)+j1+2)
89 t1=pld(npc(func1)+j1+1)*fac1
90 t2=pld(npc(func1)+j1+3)*fac1
94 x2=pld(npc(func2)+k1+2)
95 y1=pld(npc(func2)+k1+1)*fac2
96 y2=pld(npc(func2)+k1+3)*fac2
97 IF (x2 < s1 .or. s2 < x1) cycle
106 alpha = (bx * cy - by * cx) / dm
107 beta = (ax * cy - ay * cx) / dm
109 . beta < zero .and. beta >-one)
THEN
110 xint = x1 +
alpha * ax
111 yint = y1 +
alpha * ay
132 . NPC,PLD,XINT1 ,YINT1 ,XINT2 ,YINT2 )
142#include "implicit_f.inc"
146 CHARACTER(LEN=NCHARTITLE) :: TITR
148 INTEGER FUNC,FUND,NPC(*)
151 . xint1 ,yint1 ,xint2 ,yint2,fac1,fac2,pld(*)
154 INTENT(IN) :: titr,func,fund,mat_id,npc,pld,fac1,fac2
155 INTENT(INOUT) :: xint1 ,yint1 ,xint2 ,yint2
159 INTEGER J,NP1,NP2,J1,K,
161 . s1,s2,t1,t2,x1,x2,y1,y2,sx,ty,dydx,dtds
170 np1 = (npc(func+1)-npc(func)) / 2
171 np2 = (npc(fund+1)-npc(fund)) / 2
175 t1=pld(npc(func)+j1+1)*fac1
179 y1=pld(npc(fund)+k1+1)*fac2
180 IF(x1 == s1 .AND. y1 == t1 .AND.x1> zero)
THEN
190 s2=pld(npc(func)+j1+2)
191 t1=pld(npc(func)+j1+1)*fac1
192 t2=pld(npc(func)+j1+3)*fac1
196 x2=pld(npc(fund)+k1+2)
197 y1=pld(npc(fund)+k1+1)*fac2
198 y2=pld(npc(fund)+k1+3)*fac2
199 IF(x1>zero.AND.x2>zero.AND.s1>zero.AND.s2>zero)
THEN
200 IF (y2>=t1 .AND. y1<=t2 .AND. x2>=s1 .AND. x1<=s2)
THEN
201 dydx = (y2-y1) / (x2-x1)
202 dtds = (t2-t1) / (s2-s1)
203 IF (dydx > dtds)
THEN
206 sx = (t1-y1-dtds*s1+dydx*x1) / (dydx-dtds)
207 ty = t1 + dtds*(sx - s1)
208 IF (ty>=y1 .AND. ty<=y2 .AND. sx>=x1 .AND. sx<=x2.AND.sx/=zero)
THEN
222 t1=pld(npc(func)+j1+1)*fac1
226 y1=pld(npc(fund)+k1+1)*fac2
227 IF(x1 == s1 .AND. y1 == t1 .AND.x1 < zero)
THEN
237 s2=pld(npc(func)+j1+2)
238 t1=pld(npc(func)+j1+1)*fac1
239 t2=pld(npc(func)+j1+3)*fac1
243 x2=pld(npc(fund)+k1+2)
244 y1=pld(npc(fund)+k1+1)*fac2
245 y2=pld(npc(fund)+k1+3)*fac2
246 IF(x1<zero.AND.x2<zero.AND.s1<zero.AND.s2<zero)
THEN
247 IF (y2>=t1 .AND. y1<=t2 .AND. x2>=s1 .AND. x1<=s2)
THEN
248 dydx = (y2-y1) / (x2-x1)
249 dtds = (t2-t1) / (s2-s1)
250 IF (dydx > dtds)
THEN
253 sx = (t1-y1-dtds*s1+dydx*x1) / (dydx-dtds)
254 ty = t1 + dtds*(sx - s1)
255 IF (ty>=y1 .AND. ty<=y2 .AND. sx>=x1 .AND. sx<=x2.AND.sx/=zero)
THEN
275 SUBROUTINE func_inters_c(TITR,MAT_ID ,FUNC,FUND,FAC1,FAC2,NPC,PLD,XINC,YINC )
285#include "implicit_f.inc"
289 CHARACTER(LEN=NCHARTITLE) :: TITR
290 INTEGER FUNC,FUND,NPC(*)
292 my_real xinc,yinc,fac1,fac2,pld(*)
294 INTENT(IN) :: titr,func,fund,mat_id,npc,pld,fac1,fac2
295 INTENT(INOUT) :: xinc,yinc
299 INTEGER J,NP1,NP2,J1,K,K1
301 . s1,s2,t1,t2,x1,x2,y1,y2,dydx,dtds,det,b1,b2,x,y
308 np1 = (npc(func+1)-npc(func)) / 2
309 np2 = (npc(fund+1)-npc(fund)) / 2
313 t1=pld(npc(func)+j1+1)*fac1
317 y1=pld(npc(fund)+k1+1)*fac2
318 IF(x1 == s1 .AND. y1 == t1 .AND.x1 < zero)
THEN
328 s1=pld(npc(func)+j1+2)
329 t2=pld(npc(func)+j1+1)*fac1
330 t1=pld(npc(func)+j1+3)*fac1
331 IF(s1 < zero .OR. s2 < zero)
THEN
335 x1=pld(npc(fund)+k1+2)
336 y2=pld(npc(fund)+k1+1)*fac2
337 y1=pld(npc(fund)+k1+3)*fac2
338 IF(x1 < zero .OR. x2 < zero)
THEN
339 dydx = (y2-y1) / (x2-x1)
340 dtds = (t2-t1) / (s2-s1)
342 IF(det /= zero )
THEN
346 y = (-dydx*b2 + b1*dtds)/det
347 IF(x <= x1 .AND. x >= x2 .AND. x <= s1 .AND. x >= s2 .AND.
348 . y <= y1 .AND. y >= y2 .AND. y <= t1 .AND. y
THEN
377#include "implicit_f.inc"
381#include "com04_c.inc"
385 INTEGER :: FUNC1,FUNC2
387 TYPE(
ttable),
DIMENSION(NTABLE) :: TABLE
389 INTENT(IN) :: func1,func2,fac1,fac2
390 INTENT(INOUT) :: xint,yint
394 INTEGER :: J,K,NP1,NP2,NDIM,FOUND
395 my_real :: s1,s2,t1,t2,x1,x2,y1,y2,ax,bx,ay,by,cx,cy,dm,
alpha,beta
398 ndim = table(func1)%NDIM
399 np1 =
SIZE(table(func1)%X(1)%VALUES)
400 np2 =
SIZE(table(func2)%X(1)%VALUES)
405 s1 = table(func1)%X(1)%VALUES(j)
406 t1 = table(func1)%Y%VALUES(j)*fac1
408 x1 = table(func2)%X(1)%VALUES(k)
409 y1 = table(func2)%Y%VALUES(k)*fac2
410 IF (s1 > zero .and. x1 == s1 .and. y1 == t1)
THEN
422 s1 = table(func1)%X(1)%VALUES(j-1)
423 s2 = table(func1)%X(1)%VALUES(j)
424 t1 = table(func1)%Y%VALUES(j-1)*fac1
425 t2 = table(func1)%Y%VALUES(j)*fac1
427 x1 = table(func2)%X(1)%VALUES(k-1)
428 x2 = table(func2)%X(1)%VALUES(k)
429 y1 = table(func2)%Y%VALUES(k-1)*fac2
430 y2 = table(func2)%Y%VALUES(k)*fac2
431 IF (x2 < s1 .or. s2 < x1) cycle
437 IF (dm /= zero)
THEN ! check
if segments are not parallel
440 alpha = (bx * cy - by * cx) / dm
441 beta = (ax * cy - ay * cx) / dm
443 . beta <= zero .and. beta >-one .and.
445 xint = x1 +
alpha * ax
446 yint = y1 +
alpha * ay
subroutine func_inters(titr, mat_id, func1, func2, fac1, fac2, npc, pld, xint, yint)
subroutine func_inters_shear(titr, mat_id, func, fund, fac1, fac2, npc, pld, xint1, yint1, xint2, yint2)
subroutine func_inters_c(titr, mat_id, func, fund, fac1, fac2, npc, pld, xinc, yinc)
subroutine law36_upd(iout, titr, mat_id, nuparam, uparam, nfunc, ifunc, func_id, npc, pld, mtag, nfunct)