31 SUBROUTINE func_inters(TITR,MAT_ID,FUNC1,FUNC2,FAC1,FAC2,NPC,PLD,XINT,YINT)
39#include "implicit_f.inc"
43#include "tabsiz_c.inc"
47 CHARACTER(LEN=NCHARTITLE) :: TITR
48 INTEGER :: MAT_ID,FUNC1,FUNC2
50 INTEGER ,
DIMENSION(SNPC) :: NPC
53 INTENT(IN) :: titr,func1,func2,mat_id,npc,pld,fac1,fac2
54 INTENT(INOUT) :: xint,yint
58 INTEGER :: I,J,ID,NP1,NP2,J1,,K1,FOUND
59 my_real :: s1,s2,t1,t2,x1,x2,y1,y2,ax,bx,ay,by,cx,cy,dm,
alpha,beta
65 np1 = (npc(func1+1)-npc
66 np2 = (npc(func2+1)-npc(func2)) / 2
70 t1=pld(npc(func1)+j1+1)*fac1
74 y1=pld(npc(func2)+k1+1)*fac2
75 IF (x1 == s1 .AND. y1 == t1 .AND. x1> zero)
THEN
89 s2=pld(npc(func1)+j1+2)
90 t1=pld(npc(func1)+j1+1)*fac1
91 t2=pld(npc(func1)+j1+3)*fac1
95 x2=pld(npc(func2)+k1+2)
96 y1=pld(npc(func2)+k1+1)*fac2
97 y2=pld(npc(func2)+k1+3)*fac2
98 IF (x2 < s1 .or. s2 < x1) cycle
107 alpha = (bx * cy - by * cx) / dm
108 beta = (ax * cy - ay * cx) / dm
110 . beta < zero .and. beta >-one)
THEN
111 xint = x1 +
alpha * ax
112 yint = y1 +
alpha * ay
133 . NPC,PLD,XINT1 ,YINT1 ,XINT2 ,YINT2 )
143#include "implicit_f.inc"
147 CHARACTER(LEN=NCHARTITLE) :: TITR
149 INTEGER FUNC,FUND,NPC(*)
152 . xint1 ,yint1 ,xint2 ,yint2,fac1,fac2,pld(*)
155 INTENT(IN) :: titr,func,fund,mat_id,npc,pld,fac1,fac2
156 INTENT(INOUT) :: xint1 ,yint1 ,xint2 ,yint2
160 INTEGER I,J,ID,NP1,NP2,J1,K,K1
162 . s1,s2,t1,t2,x1,x2,y1,y2,sx,ty,dydx,dtds
171 np1 = (npc(func+1)-npc(func)) / 2
172 np2 = (npc(fund+1)-npc(fund)) / 2
176 t1=pld(npc(func)+j1+1)*fac1
180 y1=pld(npc(fund)+k1+1)*fac2
181 IF(x1 == s1 .AND. y1 == t1 .AND.x1> zero)
THEN
191 s2=pld(npc(func)+j1+2)
192 t1=pld(npc(func)+j1+1)*fac1
193 t2=pld(npc(func)+j1+3)*fac1
197 x2=pld(npc(fund)+k1+2)
198 y1=pld(npc(fund)+k1+1)*fac2
199 y2=pld(npc(fund)+k1+3)*fac2
200 IF(x1>zero.AND.x2>zero.AND.s1>zero.AND.s2>zero)
THEN
201 IF (y2>=t1 .AND. y1<=t2 .AND. x2>=s1 .AND. x1<=s2)
THEN
202 dydx = (y2-y1) / (x2-x1)
203 dtds = (t2-t1) / (s2-s1)
204 IF (dydx > dtds)
THEN
207 sx = (t1-y1-dtds*s1+dydx*x1) / (dydx-dtds)
208 ty = t1 + dtds*(sx - s1)
209 IF (ty>=y1 .AND. ty<=y2 .AND. sx>=x1 .AND. sx<=x2.AND.sx/=zero)
THEN
223 t1=pld(npc(func)+j1+1)*fac1
227 y1=pld(npc(fund)+k1+1)*fac2
228 IF(x1 == s1 .AND. y1 == t1 .AND.x1 < zero)
THEN
238 s2=pld(npc(func)+j1+2)
239 t1=pld(npc(func)+j1+1)*fac1
240 t2=pld(npc(func)+j1+3)*fac1
244 x2=pld(npc(fund)+k1+2)
245 y1=pld(npc(fund)+k1+1)*fac2
246 y2=pld(npc(fund)+k1+3)*fac2
247 IF(x1<zero.AND.x2<zero.AND.s1<zero.AND.s2<zero)
THEN
248 IF (y2>=t1 .AND. y1<=t2 .AND. x2>=s1 .AND. x1<=s2)
THEN
249 dydx = (y2-y1) / (x2-x1)
250 dtds = (t2-t1) / (s2-s1)
251 IF (dydx > dtds)
THEN
254 sx = (t1-y1-dtds*s1+dydx*x1) / (dydx-dtds)
255 ty = t1 + dtds*(sx - s1)
256 IF (ty>=y1 .AND. ty<=y2 .AND. sx>=x1 .AND. sx<=x2.AND.sx/=zero)
THEN
278 SUBROUTINE func_inters_c(TITR,MAT_ID ,FUNC,FUND,FAC1,FAC2,NPC,PLD,XINC,YINC )
288#include "implicit_f.inc"
292 CHARACTER(LEN=NCHARTITLE) :: TITR
293 INTEGER FUNC,FUND,NPC(*)
295 my_real xinc,yinc,fac1,fac2,pld(*)
297 INTENT(IN) :: titr,func,fund,mat_id,npc,pld,fac1,fac2
298 INTENT(INOUT) :: xinc,yinc
302 INTEGER I,J,ID,NP1,NP2,J1,K,K1
304 . s1,s2,t1,t2,x1,x2,y1,y2,sx,ty,dydx,dtds,det,b1,b2,x,y
311 np1 = (npc(func+1)-npc(func)) / 2
312 np2 = (npc(fund+1)-npc(fund)) / 2
316 t1=pld(npc(func)+j1+1)*fac1
320 y1=pld(npc(fund)+k1+1)*fac2
321 IF(x1 == s1 .AND. y1 == t1 .AND.x1 < zero)
THEN
331 s1=pld(npc(func)+j1+2)
332 t2=pld(npc(func)+j1+1)*fac1
333 t1=pld(npc(func)+j1+3)*fac1
334 IF(s1 < zero .OR. s2 < zero)
THEN
338 x1=pld(npc(fund)+k1+2)
339 y2=pld(npc(fund)+k1+1)*fac2
340 y1=pld(npc(fund)+k1+3)*fac2
341 IF(x1 < zero .OR. x2 < zero)
THEN
342 dydx = (y2-y1) / (x2-x1)
343 dtds = (t2-t1) / (s2-s1)
349 y = (-dydx*b2 + b1*dtds)/det
350 IF(x <= x1 .AND. x >= x2 .AND. x <= s1 .AND. x >= s2 .AND.
351 . y <= y1 .AND. y >= y2 .AND. y <= t1 .AND. y >= t2 )
THEN
380#include "implicit_f.inc"
384#include "com04_c.inc"
388 INTEGER :: FUNC1,FUNC2
390 TYPE(
ttable),
DIMENSION(NTABLE) :: TABLE
392 INTENT(IN) :: func1,func2,fac1,fac2
393 INTENT(INOUT) :: xint,yint
397 INTEGER :: J,K,NP1,NP2,NDIM,FOUND
398 my_real :: s1,s2,t1,t2,x1,x2,y1,y2,ax,bx,ay,by,cx,cy,dm,
alpha,beta
401 ndim = table(func1)%NDIM
402 np1 =
SIZE(table(func1)%X(1)%VALUES
403 np2 =
SIZE(table(func2)%X(1)%VALUES)
408 s1 = table(func1)%X(1)%VALUES(j)
409 t1 = table(func1)%Y%VALUES(j)*fac1
411 x1 = table(func2)%X(1)%VALUES(k)
412 y1 = table(func2)%Y%VALUES(k)*fac2
413 IF (s1 > zero .and. x1 == s1 .and. y1 == t1)
THEN
425 s1 = table(func1)%X(1)%VALUES(j-1)
426 s2 = table(func1)%X(1)%VALUES(j)
427 t1 = table(func1)%Y%VALUES(j-1)*fac1
428 t2 = table(func1)%Y%VALUES(j)*fac1
430 x1 = table(func2)%X(1)%VALUES(k-1)
431 x2 = table(func2)%X(1)%VALUES(k)
432 y1 = table(func2)%Y%VALUES(k
433 y2 = table(func2)%Y%VALUES(k)*fac2
434 IF (x2 < s1 .or. s2 < x1) cycle
443 alpha = (bx * cy - by * cx) / dm
444 beta = (ax * cy - ay * cx) / dm
446 . beta <= zero .and. beta >-one .and.
448 xint = x1 +
alpha * ax
449 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 law88_upd(iout, titr, uparam, npc, pld, nfunc, ifunc, mat_id, func_id, pm, nfunct)