OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
invoi3.F File Reference
#include "implicit_f.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine invoi3 (x, irect, lmsr, msr, nsv, iloc, irtl, nseg, nsn, nmn, itab, id, titr, nrt)

Function/Subroutine Documentation

◆ invoi3()

subroutine invoi3 ( dimension(3,*), intent(in) x,
integer, dimension(4,*), intent(in) irect,
integer, dimension(*), intent(in) lmsr,
integer, dimension(*), intent(in) msr,
integer, dimension(*), intent(in) nsv,
integer, dimension(*), intent(inout) iloc,
integer, dimension(*), intent(inout) irtl,
integer, dimension(*), intent(in) nseg,
integer, intent(in) nsn,
integer, intent(in) nmn,
integer, dimension(*), intent(in) itab,
integer, intent(in) id,
character(len=nchartitle) titr,
integer, intent(in) nrt )

Definition at line 34 of file invoi3.F.

35 USE message_mod
37C-----------------------------------------------------------------------
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41#include "implicit_f.inc"
42C-----------------------------------------------
43C D u m m y A r g u m e n t s
44C-----------------------------------------------
45 INTEGER, INTENT(IN) :: NSN, NMN, NRT, ID
46 INTEGER, INTENT(IN) :: IRECT(4,*), LMSR(*), MSR(*), NSV(*), NSEG(*), ITAB(*)
47 INTEGER, INTENT(INOUT) :: ILOC(*), IRTL(*)
48 my_real, INTENT(IN) :: x(3,*)
49 CHARACTER(LEN=NCHARTITLE)::TITR
50C-----------------------------------------------
51C L o c a l V a r i a b l e s
52C-----------------------------------------------
53 INTEGER I, J, K, L, M, N, II, JJ, KK, LL
54 INTEGER LG, MG, NG, J1, J2, K1, K2, KKK, JNEW
55 INTEGER KM1(4), KN1(4), LSEG, LSEG_NEW
56 my_real cms, dms, ems, fms, bmin, bmax
57C
58 DATA km1/2,3,4,1/
59 DATA kn1/4,1,2,3/
60C-------------------------------------------------------------------------------------
61 IF(nrt==0) RETURN
62C
63 DO ii=1,nsn
64 i=nsv(ii)
65 j=iloc(ii)
66 jnew=j
67 k=msr(j)
68 cms=(x(1,i)-x(1,k))**2+(x(2,i)-x(2,k))**2+(x(3,i)-x(3,k))**2
69 j1=nseg(j)
70 j2=nseg(j+1)-1
71 DO jj=j1,j2
72 ll=lmsr(jj)
73 IF(j==irect(1,ll)) THEN
74 l=irect(2,ll)
75 m=irect(3,ll)
76 n=irect(4,ll)
77 ELSEIF(j==irect(2,ll)) THEN
78 l=irect(1,ll)
79 m=irect(3,ll)
80 n=irect(4,ll)
81 ELSEIF(j==irect(3,ll)) THEN
82 l=irect(1,ll)
83 m=irect(2,ll)
84 n=irect(4,ll)
85 ELSEIF(j==irect(4,ll)) THEN
86 l=irect(1,ll)
87 m=irect(2,ll)
88 n=irect(3,ll)
89 ELSE
90 CALL ancmsg(msgid=105,
91 . msgtype=msgerror,
92 . anmode=aninfo,
93 . i1=id,
94 . c1=titr,
95 . i2=itab(msr(irect(1,ll))),
96 . i3=itab(msr(irect(2,ll))),
97 . i4=itab(msr(irect(3,ll))),
98 . i5=itab(msr(irect(4,ll))))
99 l=irect(1,ll)
100 m=irect(2,ll)
101 n=irect(3,ll)
102 ENDIF
103C
104 lg=msr(l)
105 mg=msr(m)
106 ng=msr(n)
107 dms=(x(1,i)-x(1,lg))**2+(x(2,i)-x(2,lg))**2+(x(3,i)-x(3,lg))**2
108 ems=(x(1,i)-x(1,mg))**2+(x(2,i)-x(2,mg))**2+(x(3,i)-x(3,mg))**2
109 fms=(x(1,i)-x(1,ng))**2+(x(2,i)-x(2,ng))**2+(x(3,i)-x(3,ng))**2
110 IF(dms<=cms) THEN
111 cms=dms
112 jnew=l
113 k=lg
114 ENDIF
115 IF(ems<=cms) THEN
116 cms=ems
117 jnew=m
118 k=mg
119 ENDIF
120 IF(fms<=cms) THEN
121 cms=fms
122 jnew=n
123 k=ng
124 ENDIF
125 ENDDO !JJ=J1,J2
126 j=jnew
127 iloc(ii)=j
128C
129C
130 bmax=-ep30
131 lseg_new=0
132 l=irtl(ii)
133 IF(l==0) GO TO 100
134 lseg=l
135 DO kkk=1,4
136 kk=kkk
137 IF(irect(kk,l)==j) EXIT
138 ENDDO
139 j1=km1(kk)
140 j2=kn1(kk)
141 IF(kk==3.AND.irect(3,l)==irect(4,l)) j1=1
142 m=msr(irect(j1,l))
143 n=msr(irect(j2,l))
144 CALL nearest_seg(x, i, k, m, n, lseg, lseg_new, bmin, bmax)
145 IF(bmin >= zero) GO TO 200
146C
147 100 CONTINUE ! L=0
148 j1=nseg(j)
149 j2=nseg(j+1)-1
150 DO jj=j1,j2
151 ll=lmsr(jj)
152 lseg=ll
153 IF(l==ll) cycle
154 DO kkk=1,4
155 kk=kkk
156 IF(irect(kk,ll)==j) EXIT
157 ENDDO
158 k1=km1(kk)
159 k2=kn1(kk)
160 IF(kk==3.AND.irect(3,ll)==irect(4,ll)) k1=1
161 m=msr(irect(k1,ll))
162 n=msr(irect(k2,ll))
163 CALL nearest_seg(x, i, k, m, n, lseg, lseg_new, bmin, bmax)
164 IF(bmin < zero) cycle
165 irtl(ii)=lseg_new
166 GO TO 200
167 ENDDO
168 irtl(ii)=lseg_new
169 200 CONTINUE
170 ENDDO !II=1,NSN
171
172 RETURN
#define my_real
Definition cppsort.cpp:32
initmumps id
integer, parameter nchartitle
subroutine nearest_seg(x, is, m1, m2, m3, lseg, lseg_new, bmin, bmax)
Definition nearest_seg.F:30
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:889