OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
invoi3.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23C
24!||====================================================================
25!|| invoi3 ../starter/source/interfaces/inter3d1/invoi3.F
26!||--- called by ------------------------------------------------------
27!|| iniend ../starter/source/interfaces/inter3d1/iniend.f
28!|| inint3 ../starter/source/interfaces/inter3d1/inint3.F
29!||--- calls -----------------------------------------------------
30!|| ancmsg ../starter/source/output/message/message.f
31!||--- uses -----------------------------------------------------
32!|| message_mod ../starter/share/message_module/message_mod.F
33!||====================================================================
34 SUBROUTINE invoi3(X,IRECT,LMSR,MSR,NSV,ILOC,IRTL,NSEG,NSN,NMN,ITAB,ID,TITR,NRT)
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
173 END
#define my_real
Definition cppsort.cpp:32
subroutine iniend(inscr, x, ixs, ixc, pm, geo, ipari, noin, intc, itab, ms, npby, lpby, mwa, ikine, in, stifint, id, titr, intbuf_tab, stifintr)
Definition iniend.F:44
subroutine invoi3(x, irect, lmsr, msr, nsv, iloc, irtl, nseg, nsn, nmn, itab, id, titr, nrt)
Definition invoi3.F:35
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
program starter
Definition starter.F:39