28 SUBROUTINE i7norm(NRTM,IRECT,NUMNOD,X,NOD_NORMAL,
33#include "implicit_f.inc"
37 INTEGER NRTM,NUMNOD,IRECT(4,NRTM),NMN,MSR(*)
40 . x(3,numnod), nod_normal(3,numnod)
44 INTEGER I ,N1,N2,N3,N4
46 . surfx,surfy,surfz,x13,y13,z13,x24,y24,z24
51 nod_normal(1,n1) = zero
52 nod_normal(2,n1) = zero
53 nod_normal(3,n1) = zero
62 x13 = x(1,n3) - x(1,n1)
63 y13 = x(2,n3) - x(2,n1)
64 z13 = x(3,n3) - x(3,n1)
66 x24 = x(1,n4) - x(1,n2)
67 y24 = x(2,n4) - x(2,n2)
68 z24 = x(3,n4) - x(3,n2)
70 surfx = y13*z24 - z13*y24
71 surfy = z13*x24 - x13*z24
72 surfz = x13*y24 - y13*x24
74 nod_normal(1,n1) = nod_normal(1,n1) + surfx
75 nod_normal(2,n1) = nod_normal(2,n1) + surfy
76 nod_normal(3,n1) = nod_normal(3,n1) + surfz
77 nod_normal(1,n2) = nod_normal(1,n2) + surfx
78 nod_normal(2,n2) = nod_normal(2,n2) + surfy
79 nod_normal(3,n2) = nod_normal(3,n2) + surfz
80 nod_normal(1,n3) = nod_normal(1,n3) + surfx
81 nod_normal(2,n3) = nod_normal(2,n3) + surfy
82 nod_normal(3,n3) = nod_normal(3,n3) + surfz
83 nod_normal(1,n4) = nod_normal(1,n4) + surfx
84 nod_normal(2,n4) = nod_normal(2,n4) + surfy
85 nod_normal(3,n4) = nod_normal(3,n4) + surfz
99 SUBROUTINE i7normp(NRTM ,IRECT ,NUMNOD ,X ,NOD_NORMAL,
100 . NMN ,MSR ,LENT ,MAXCC,ISDSIZ ,
101 . IRCSIZ,IAD_ELEM,FR_ELEM,ITAG )
105#include "implicit_f.inc"
109#include "com01_c.inc"
113 INTEGER NRTM,NUMNOD,NMN,MAXCC,LENT,
114 . IRECT(4,NRTM),MSR(*),
115 . IAD_ELEM(2,*),FR_ELEM(*),ISDSIZ(*),IRCSIZ(*),ITAG(*)
118 . x(3,numnod), nod_normal(3,numnod)
122 INTEGER I ,J ,N1,N2,N3,N4, IAD, LENR, LENS, CC, ERROR,
125 . surfx,surfy,surfz,x13,y13,z13,x24,y24,z24,
126 . fskyt(3,lent), fskyt2(maxcc)
127 INTEGER :: PERM(MAXCC)
132 adskyt(n1+1) = adskyt(n1)+itag(n1)
133 itag(n1) = adskyt(n1)
134 nod_normal(1,n1) = zero
135 nod_normal(2,n1) = zero
136 nod_normal(3,n1) = zero
145 x13 = x(1,n3) - x(1,n1)
146 y13 = x(2,n3) - x(2,n1)
147 z13 = x(3,n3) - x(3,n1)
149 x24 = x(1,n4) - x(1,n2)
150 y24 = x(2,n4) - x(2,n2)
151 z24 = x(3,n4) - x(3,n2)
153 surfx = y13*z24 - z13*y24
154 surfy = z13*x24 - x13*z24
155 surfz = x13*y24 - y13*x24
158 adskyt(n1) = adskyt(n1)+1
163 adskyt(n2) = adskyt(n2)+1
168 adskyt(n3) = adskyt(n3)+1
173 adskyt(n4) = adskyt(n4)+1
180 lenr = ircsiz(nspmd+1)*3+iad_elem(1,nspmd+1)-iad_elem(1,1)
181 lens = isdsiz(nspmd+1)*3+iad_elem(1,nspmd+1)-iad_elem(1,1)
183 . isdsiz,ircsiz,itag ,lenr ,lens )
195 fskyt2(cc-n2+1) = fskyt(j,cc)
198 CALL myqsort(n4,fskyt2,perm,error)
200 nod_normal(j,n1) = nod_normal(j,n1) + fskyt2(cc-n2+1)
204 nod_normal(1,n1) = fskyt(1,n2)
205 nod_normal(2,n1) = fskyt(2,n2)
206 nod_normal(3,n1) = fskyt(3,n2)
265 SUBROUTINE i7cmaj(JLT ,CMAJ ,IRECT ,NOD_NORMAL,CAND_E,
269 5 NNX1 ,NNX2 ,NNX3 ,NNX4 ,
270 6 NNY1 ,NNY2 ,NNY3 ,NNY4 ,
271 7 NNZ1 ,NNZ2 ,NNZ3 ,NNZ4 )
294#include "implicit_f.inc"
298#include "mvsiz_p.inc"
302 INTEGER JLT ,IRECT(4,*),CAND_E(*)
305 . NNX1(MVSIZ), NNX2(MVSIZ), NNX3(MVSIZ), NNX4(MVSIZ),
306 . NNY1(MVSIZ), NNY2(MVSIZ), NNY3(MVSIZ), NNY4(MVSIZ),
307 . NNZ1(MVSIZ), NNZ2(MVSIZ), NNZ3(MVSIZ), NNZ4(MVSIZ),
308 . X1(MVSIZ), X2(MVSIZ), X3(MVSIZ), X4(MVSIZ),
309 . Y1(MVSIZ), Y2(MVSIZ), Y3(MVSIZ), Y4(MVSIZ),
310 . Z1(MVSIZ), Z2(MVSIZ), Z3(), Z4(MVSIZ),
311 . cmaj(mvsiz),nod_normal(3,*)
317 . X12,Y12,Z12,X23,Y23,Z23,X34,Y34,Z34,X41,Y41,Z41,
318 . L12L12,L23L23,L34L34,L41L41,N1N1,N2N2,N3N3,N4N4,NL,
319 . N1L12N1L12,N2L12N2L12,N2L23N2L23,N3L23N3L23,
320 . N3L34N3L34,N4L34N4L34,N4L41N4L41,N1L41N1L41,AAA
327 nnx1(i)=nod_normal(1,ix)
328 nny1(i)=nod_normal(2,ix)
329 nnz1(i)=nod_normal(3,ix)
332 nnx2(i)=nod_normal(1,ix)
333 nny2(i)=nod_normal(2,ix)
334 nnz2(i)=nod_normal(3,ix)
337 nnx3(i)=nod_normal(1,ix)
338 nny3(i)=nod_normal(2,ix)
339 nnz3(i)=nod_normal(3,ix)
342 nnx4(i)=nod_normal(1,ix)
343 nny4(i)=nod_normal(2,ix)
344 nnz4(i)=nod_normal(3,ix)
362 l12l12 = x12*x12 + y12*y12 + z12*z12
363 l23l23 = x23*x23 + y23*y23 + z23*z23
364 l34l34 = x34*x34 + y34*y34 + z34*z34
365 l41l41 = x41*x41 + y41*y41 + z41*z41
367 n1n1 = nnx1(i)*nnx1(i)
370 n2n2 = nnx2(i)*nnx2(i)
373 n3n3 = nnx3(i)*nnx3(i)
376 n4n4 = nnx4(i)*nnx4(i)
414 aaa =
max(n1l12n1l12*l12l12 / (n1n1*l12l12 - n1l12n1l12),
415 . n2l12n2l12*l12l12 / (n2n2*l12l12 - n2l12n2l12),
416 . n2l23n2l23*l23l23 / (n2n2*l23l23 - n2l23n2l23),
417 . n3l23n3l23*l23l23 / (n3n3*l23l23 - n3l23n3l23),
418 . n3l34n3l34*l34l34 / (n3n3*l34l34 - n3l34n3l34),
419 . n4l34n4l34*l34l34 / (n4n4*l34l34 - n4l34n4l34),
420 . n4l41n4l41*l41l41 / (n4n4*l41l41 - n4l41n4l41),
421 . n1l41n1l41*l41l41 / (n1n1*l41l41 - n1l41n1l41))
422 cmaj(i) = half*sqrt(aaa)
437 1 N3 ,GAPV ,X ,NOD_NORMAL,
438 2 IX1 ,IX2 ,IX3 ,IX4 ,
440 4 X1 ,X2 ,X3 ,X4 ,Y1 ,
441 5 Y2 ,Y3 ,Y4 ,Z1 ,Z2 ,
442 6 Z3 ,Z4 ,XI ,YI ,ZI )
446#include "implicit_f.inc"
450#include "mvsiz_p.inc"
455 . IX1(MVSIZ),IX2(MVSIZ),IX3(MVSIZ),IX4(MVSIZ)
458 . X(3,*),NOD_NORMAL(3,*),
459 . H1(MVSIZ), H2(MVSIZ), H3(MVSIZ), H4(MVSIZ),
460 . PENE(MVSIZ),GAPV(MVSIZ),N1(MVSIZ),N2(MVSIZ),N3(MVSIZ),
461 . X1(MVSIZ), X2(MVSIZ), X3(MVSIZ), X4(MVSIZ),
462 . Y1(MVSIZ), Y2(MVSIZ), Y3(MVSIZ), Y4(MVSIZ),
463 . Z1(MVSIZ), Z2(MVSIZ), Z3(MVSIZ), Z4(),
464 . (MVSIZ), YI(MVSIZ), ZI(MVSIZ)
471 . nnx1(mvsiz), nnx2(mvsiz), nnx3(mvsiz), nnx4(mvsiz),
472 . nny1(mvsiz), nny2(mvsiz), nny3(mvsiz), nny4(mvsiz),
473 . nnz1(mvsiz), nnz2(mvsiz), nnz3(mvsiz), nnz4(mvsiz),
474 . x12(mvsiz),y12(mvsiz),z12(mvsiz),
476 . x23(mvsiz),y23(mvsiz),z23(mvsiz),
477 . x14(mvsiz),y14(mvsiz),z14(mvsiz),
478 . nnx12(mvsiz),nny12(mvsiz),nnz12(mvsiz),
479 . nnx43(mvsiz),nny43(mvsiz),nnz43(mvsiz),
480 . nnx23(mvsiz),nny23(mvsiz),nnz23(mvsiz),
481 . nnx14(mvsiz),nny14(mvsiz),nnz14(mvsiz),
482 . xa(mvsiz),ya(mvsiz),za(mvsiz),
483 . xb(mvsiz),yb(mvsiz),zb(mvsiz),
484 . nnxa(mvsiz),nnya(mvsiz),nnza(mvsiz),
485 . nnxb(mvsiz),nnyb(mvsiz),nnzb(mvsiz),
486 . csx(mvsiz),csy(mvsiz),csz(mvsiz),
487 . crx(mvsiz),cry(mvsiz),crz(mvsiz),
488 . r(mvsiz),s(mvsiz),tt(mvsiz),ta(mvsiz),tb(mvsiz),aaa,
489 . bbb,ccc,ddd,eee,rm,rp,sm,sp,rpmm,spmm,rppm,sppm,
490 . nx,ny,nz,dist,eps,xp,yp,zp,xx
498 nnx1(i)=nod_normal(1,ix1(i))
499 nny1(i)=nod_normal(2,ix1(i))
500 nnz1(i)=nod_normal(3,ix1(i))
502 nnx2(i)=nod_normal(1,ix2(i))
503 nny2(i)=nod_normal(2,ix2(i))
504 nnz2(i)=nod_normal(3,ix2(i))
506 nnx3(i)=nod_normal(1,ix3(i))
507 nny3(i)=nod_normal(2,ix3(i))
508 nnz3(i)=nod_normal(3,ix3(i))
510 nnx4(i)=nod_normal(1,ix4(i))
511 nny4(i)=nod_normal(2,ix4(i))
512 nnz4(i)=nod_normal(3,ix4(i))
517 rm = (h2(i)-h1(i))/
max(em20,h2(i)+h1(i))
518 rp = (h3(i)-h4(i))/
max(em20,h3(i)+h4(i))
520 IF(h2(i)+h1(i)<eps) rm = rp
521 IF(h3(i)+h4(i)<eps) rp = rm
523 sm = (h4(i)-h1(i))/
max(em20,h4(i)+h1(i))
524 sp = (h3(i)-h2(i))/
max(em20,h3(i)+h2(i))
525 IF(h4(i)+h1(i)<eps) sm = sp
526 IF(h3(i)+h2(i)<eps) sp = sm
530 aaa = four - rpmm*spmm
534 r(i)= (rppm + rppm + sppm*rpmm) / aaa
535 s(i)= (sppm + sppm + rppm*spmm) / aaa
540 . x1,nnx1,x2,nnx2,x12,nnx12,csx,
541 . y1,nny1,y2,nny2,y12,nny12,csy,
542 . z1,nnz1,z2,nnz2,z12,nnz12,csz)
545 . x4,nnx4,x3,nnx3,x43,nnx43,csx,
546 . y4,nny4,y3,nny3,y43,nny43,csy,
547 . z4,nnz4,z3,nnz3,z43,nnz43,csz)
550 . x12,nnx12,x43,nnx43,xa,nnxa,csx,
551 . y12,nny12,y43,nny43,ya,nnya,csy,
552 . z12,nnz12,z43,nnz43,za,nnza,csz)
555 . x1,nnx1,x4,nnx4,x14,nnx14,crx,
556 . y1,nny1,y4,nny4,y14,nny14,cry,
557 . z1,nnz1,z4,nnz4,z14,nnz14,crz)
560 . x2,nnx2,x3,nnx3,x23,nnx23,crx,
561 . y2,nny2,y3,nny3,y23,nny23,cry,
562 . z2,nnz2,z3,nnz3,z23,nnz23,crz)
565 . x14,nnx14,x23,nnx23,xb,nnxb,crx,
566 . y14,nny14,y23,nny23,yb,nnyb,cry,
567 . z14,nnz14,z23,nnz23,zb,nnzb,crz)
575 nx = cry(i)*csz(i)-crz(i)*csy(i)
576 ny = crz(i)*csx(i)-crx(i)*csz(i)
577 nz = crx(i)*csy(i)-cry(i)*csx(i)
578 aaa = one / sqrt(nx*nx+ny*ny+nz*nz)
586 xa(i) = half*(xa(i)+xb(i))
587 ya(i) = half*(ya(i)+yb(i))
588 za(i) = half*(za(i)+zb(i))
599 dist = nx*xd + ny*yd + nz*zd
615 bbb = xxp*xx + yyp*yy + zzp*zz
616 ccc = xx*xx + yy*yy + zz*zz
632 ddd = xxp*xx + yyp*yy + zzp*zz
633 eee = xx*xx + yy*yy + zz*zz
648 pene(i) = gapv(i) - dist
653 pene(i) = gapv(i) + dist
671 . X1,NNX1,X2,NNX2,X12,NNX12,CX,
672 . Y1,NNY1,Y2,NNY2,Y12,NNY12,CY,
673 . Z1,NNZ1,Z2,NNZ2,Z12,NNZ12,CZ)
677#include "implicit_f.inc"
681#include "mvsiz_p.inc"
688 . x1(mvsiz), x2(mvsiz),
689 . y1(mvsiz), y2(mvsiz),
690 . z1(mvsiz), z2(mvsiz),
691 . nnx1(mvsiz), nnx2(mvsiz),
692 . nny1(mvsiz), nny2(mvsiz),
693 . nnz1(mvsiz), nnz2(mvsiz),
694 . x12(mvsiz),y12(mvsiz),z12(mvsiz),
695 . nnx12(mvsiz),nny12(mvsiz),nnz12(mvsiz),
696 . cx(mvsiz),cy(mvsiz),cz(mvsiz),
703 . aaa,a1,rr,dtdr,dtdr1,dtdr2,nx,ny,nz,r2,
704 . upr2,umr2,a3rr2,a2rr,
705 . erx,ery,erz,esx,esy,esz,etx,ety,etz
745 r2 = sqrt(erx*erx+ery*ery+erz*erz)
751 etx = nnx1(i)+nnx2(i)
752 ety = nny1(i)+nny2(i)
753 etz = nnz1(i)+nnz2(i)
755 aaa = erx*etx + ery*ety + erz*etz
760 aaa = one / sqrt(etx*etx+ety*ety+etz*etz)
765 esx = ety*erz-etz*ery
766 esy = etz*erx-etx*erz
767 esz = etx*ery-ety*erx
772 dtdr1 = -(nnx1(i)*erx+nny1(i)*ery+nnz1(i)*erz)
773 . / (nnx1(i)*etx+nny1(i)*ety+nnz1(i)*etz)
775 dtdr2 = -(nnx2(i)*erx+nny2(i)*ery+nnz2(i)*erz)
776 . / (nnx2(i)*etx+nny2(i)*ety+nnz2(i)*etz)
781 dtdr1 = dtdr1/
max(one,abs(dtdr1))
782 dtdr2 = dtdr2/
max(one,abs(dtdr2))
784 upr2 = half*(one+r(i))
785 umr2 = half*(one-r(i))
800 a2rr = -(dtdr2 + dtdr1 + dtdr1)*upr2
801 a3rr2 = (dtdr2 + dtdr1)*upr2*upr2
803 tt(i) = ((a3rr2 + a2rr) + a1) * rr
808 x12(i) = x1(i) + rr*erx + tt(i)*etx
809 y12(i) = y1(i) + rr*ery + tt(i)*ety
810 z12(i) = z1(i) + rr*erz + tt(i)*etz
812 dtdr = three*a3rr2 + a2rr + a2rr + a1
817 cx(i) = erx + dtdr*etx
818 cy(i) = ery + dtdr*ety
819 cz(i) = erz + dtdr*etz
821 nx = umr2*nnx1(i) + upr2*nnx2(i)
822 ny = umr2*nny1(i) + upr2*nny2(i)
823 nz = umr2*nnz1(i) + upr2*nnz2(i)
825 aaa = (nx*cx(i)+ny*cy(i)+nz*cz(i))
826 . / (cx(i)*cx(i)+cy(i)*cy(i)+cz(i)*cz(i))
831 nnx12(i) = nx - cx(i)*aaa
832 nny12(i) = ny - cy(i)*aaa
833 nnz12(i) = nz - cz(i)*aaa