OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
lecextlnk.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/.
23!||====================================================================
24!|| lecextlnk ../starter/source/coupling/rad2rad/lecextlnk.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.f
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_int_array_index ../starter/source/devtools/hm_reader/hm_get_int_array_index.F
30!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
31!|| hm_option_read_key ../starter/source/devtools/hm_reader/hm_option_read_key.F
32!|| hm_option_start ../starter/source/devtools/hm_reader/hm_option_start.F
33!||--- uses -----------------------------------------------------
34!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
35!|| message_mod ../starter/share/message_module/message_mod.F
36!|| r2r_mod ../starter/share/modules1/r2r_mod.F
37!|| reader_old_mod ../starter/share/modules1/reader_old_mod.F90
38!|| submodel_mod ../starter/share/modules1/submodel_mod.F
39!||====================================================================
40 SUBROUTINE lecextlnk(IEXTER,IPART,LSUBMODEL)
41C-----------------------------------------------
42C M o d u l e s
43C-----------------------------------------------
44 USE message_mod
45 USE r2r_mod
46 USE submodel_mod
49 USE reader_old_mod , ONLY : irec
50C-------------------------------------
51C Read radioss link for external process coupling.
52C-----------------------------------------------
53C I m p l i c i t T y p e s
54C-----------------------------------------------
55#include "implicit_f.inc"
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "com04_c.inc"
60#include "units_c.inc"
61#include "scr17_c.inc"
62#include "param_c.inc"
63#include "r2r_c.inc"
64C-----------------------------------------------
65C D u m m y A r g u m e n t s
66C-----------------------------------------------
67 INTEGER IEXTER(NR2R,*),IPART(LIPART1,*)
68 TYPE(submodel_data),INTENT(IN)::LSUBMODEL(*)
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72 INTEGER NUSER, IGR, STAT,I,COMPT,SET
73 CHARACTER MESS*40
74 CHARACTER(LEN=NCHARKEY)::KEY
75 CHARACTER(LEN=NCHARTITLE)::TITR
76 INTEGER J,ADD,K
77 INTEGER FLAG_OK,FOUND,NEL,ID,NELN
78 INTEGER, DIMENSION(:), ALLOCATABLE :: ID_SUB_TEMP
79 LOGICAL IS_AVAILABLE
80 DATA mess/' ** ERROR EXTERNAL COUPLING DEFINITION '/
81 WRITE(iout,1000)
82 IF (nr2rlnk>0) WRITE(iout,1200)
83C
84C IEXTER(1,M) ............... Id of GRNOD of the Link
85C IEXTER(2,M) ............... Link ser Id
86C IEXTER(3,M) ............... Id of 1st domain
87C IEXTER(4,M) ............... Id of 2nd domain
88C IEXTER(5,M) ............... Type du Link (4 ou 5)
89C -> pour fulldomain IEXTER(4,M) = 0
90C -> pour link classique IEXTER(4,M) = IEXTER(4,M) = -1
91C
92C
93C ISUBDOM(1,N) .............. Id of subdomain
94C ISUBDOM(2,N) .............. Nb of parts of the subdomain
95C ISUBDOM(3,N) .............. Adress of the parts of the subdomain in ISUBDOM_PART
96C ISUBDOM(4,N) .............. Id of principal link of subdomain
97C ISUBDOM(5,N) .............. Nb of nodes of subdomain
98C ISUBDOM(6,N) .............. Nb of elements of subdomain
99C ISUBDOM(7,N) .............. ROOTLEN
100C
101C ISUBDOM_PART() ............ List of parts of the subdomain
102C-----------------------------------------------
103C
104 IF (nr2rlnk > 0) THEN
105C------------------------------------------------------------------
106C------------------------READING OF LINKS--------------------------
107C------------------------------------------------------------------
108C
109 is_available = .false.
110 CALL hm_option_start('/EXTERN/LINK')
111
112 DO i=1,nr2rlnk
113 CALL hm_option_read_key(lsubmodel,option_id = nuser,option_titr = titr)
114 CALL hm_get_intv('grnod_id',igr,is_available,lsubmodel)
115C-------- CHECK NODE GROUP
116 iexter(1,i) = igr
117 iexter(2,i) = nuser
118 iexter(3,i) = -1
119 iexter(4,i) = -1
120C----- PRINTOUT
121 WRITE(iout,1100) nuser,igr
122 ENDDO
123
124 ENDIF
125
126 IF (nsubdom>0) THEN
127C------------------------------------------------------------------
128C------------------------READING OF SUBDOMAINS---------------------
129C------------------------------------------------------------------
130C
131 is_available = .false.
132 CALL hm_option_start('/SUBDOMAIN')
133 ALLOCATE (isubdom_part(nb_part_sub),stat=stat)
134 ALLOCATE (id_sub_temp(nb_part_sub),stat=stat)
135 set = 0
136 r2r_flag_err_off = 0
137
138 DO i=1,nsubdom
139 CALL hm_option_read_key(lsubmodel,option_id = nuser,option_titr = titr,keyword2 = key)
140 CALL hm_get_intv('idsmax',nel,is_available,lsubmodel)
141 CALL hm_get_intv('negativeIdsmax',neln,is_available,lsubmodel)
142 IF (i>1) set = set+isubdom(1,i-1)
143 isubdom(3,i)=set
144 compt = 0
145 DO j=1,nel
146 CALL hm_get_int_array_index('ids',id,j,is_available,lsubmodel)
147 compt=compt+1
148 id_sub_temp(compt+set)=id
149C----- CHECK PART ID
150 flag_ok = 0
151 DO k=1,npart
152 IF(id==ipart(4,k)) THEN
153 flag_ok=1
154 isubdom_part(compt+set)=k
155 END IF
156 END DO
157 IF (flag_ok==0) THEN
158 CALL ancmsg(msgid=783,msgtype=msgerror,anmode=aninfo,i1=nuser,c1=titr,i2=id)
159 ENDIF
160 END DO
161C-- if ID < 0 in list of part -> error message for size of interface is deactivated
162 IF (neln > 0) r2r_flag_err_off = 1
163C
164C----- STORAGE OF DATA FOR SUBDOMAINS
165 isubdom(1,i) = compt
166 isubdom(2,i) = nuser
167C
168 ENDDO
169
170 DO i=1,nsubdom
171 WRITE(iout,1300) isubdom(2,i),isubdom(1,i)
172 WRITE(iout,1301)
173 add = isubdom(3,i)
174 WRITE(iout,1302) (id_sub_temp(j+add),j=1,isubdom(1,i))
175 END DO
176
177 IF (flg_swale==1) THEN
178C------------------------------------------------------------------
179C-------------SWITCH OF FULL/SUB PARTS FOR ALE---------------------
180C------------------------------------------------------------------
181 nb_part_sub = npart - isubdom(1,1)
182 DO i=1,isubdom(1,1)
183 id_sub_temp(i) = isubdom_part(i)
184 END DO
185
186 DEALLOCATE (isubdom_part)
187 ALLOCATE (isubdom_part(nb_part_sub),stat=stat)
188 compt = 0
189 DO i=1,npart
190 found = 0
191 DO j=1,isubdom(1,1)
192 IF (id_sub_temp(j)==i) found = 1
193 END DO
194 IF (found==1) cycle
195 compt = compt + 1
196 isubdom_part(compt) = i
197 END DO
198 isubdom(1,1) = compt
199
200 ENDIF
201
202 DEALLOCATE (id_sub_temp)
203
204 ENDIF
205
206C------------------------------------------------------------------
207 irec=irec+1
208
209 RETURN
210C------------------------------------------------------------------
211 1000 FORMAT(
212 . //' MULTIDOMAINS COUPLING DEFINITIONS '/
213 . ' --------------------------------- '/)
214 1100 FORMAT(/10x,'EXTERNAL LINK IDENTIFIER . . . .',i10,
215 . /10x,'RADIOSS NODE GROUP ID . . . . . ',i10)
216 1300 FORMAT(/10x,'SUBDOMAIN IDENTIFIER . . . . . .',i10,
217 . /10x,'NUMBER OF PARTS . . . . . . . . ',i10)
218 1301 FORMAT( 10x,'LIST OF PARTS : ')
219 1302 FORMAT( 9x,10i9)
220 1200 FORMAT(' ** INFO : DATA RELATED TO EXTERNAL',
221 . ' COUPLING WILL BE CHECKED IN RADIOSS ENGINE.')
222 END SUBROUTINE lecextlnk
subroutine hm_get_int_array_index(name, ival, index, is_available, lsubmodel)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_start(entity_type)
subroutine lecextlnk(iexter, ipart, lsubmodel)
Definition lecextlnk.F:41
integer, parameter nchartitle
integer, parameter ncharkey
integer, dimension(:), allocatable isubdom_part
Definition r2r_mod.F:131
integer, dimension(:,:), allocatable isubdom
Definition r2r_mod.F:144
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
subroutine lectur(multi_fvm, lsubmodel, is_dyna, detonators, ebcs_tab, seatbelt_converted_elements, nb_seatbelt_shells, nb_dyna_include, user_windows, output, mat_elem, names_and_titles, defaults, glob_therm, pblast, sensor_user_struct)
Definition lectur.F:533
program starter
Definition starter.F:39