OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
read_box_box.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!|| read_box_box ../starter/source/model/box/read_box_box.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_box ../starter/source/model/box/hm_read_box.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!|| submodel_mod ../starter/share/modules1/submodel_mod.F
37!||====================================================================
38 SUBROUTINE read_box_box(IBOX ,IAD ,NBOX ,LSUBMODEL)
39C-----------------------------------------------
40C M o d u l e s
41C-----------------------------------------------
42 USE my_alloc_mod
43 USE submodel_mod
44 USE message_mod
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52C-----------------------------------------------
53C C o m m o n B l o c k s
54C-----------------------------------------------
55#include "com04_c.inc"
56C-----------------------------------------------
57C D u m m y A r g u m e n t s
58C-----------------------------------------------
59 INTEGER :: IAD,NBOX
60 TYPE (BOX_) ,DIMENSION(NBBOX) :: IBOX
61 TYPE(submodel_data),DIMENSION(*) ,INTENT(IN) :: LSUBMODEL
62C-----------------------------------------------
63C L o c a l V a r i a b l e s
64C-----------------------------------------------
65 INTEGER I,II,J,KK,BOXID,SUB_ID,IDNEG,NLIST,NBOX_POS,NBOX_NEG
66 CHARACTER(LEN=NCHARKEY) :: KEY
67 CHARACTER(LEN=NCHARTITLE) :: TITR
68 LOGICAL :: IS_AVAILABLE
69C-----------------------------------------------
70C IBOX(I)%ID : BOX IDENTIFIER
71C IBOX(I)%TITLE : BOX title
72C IBOX(I)%NBOXBOX : NUMBER OF SUB BOXES (BOXES OF BOXES)
73C IBOX(I)%ISKBOX : BOX SKEW_ID (RECTA)
74C IBOX(I)%NOD1 : FIRST NODE for box limit definition - N1 -
75C IBOX(I)%NOD2 : SECOND NODE for box limit definition - N2 -
76C IBOX(I)%TYPE : BOX SHAPE (1='RECTA',2='CYLIN' ,3='SPHER')
77C IBOX(I)%NBLEVELS : TEMPORARY LEVEL NB OF BOXES
78C IBOX(I)%LEVEL : FLAG "SUBLEVEL DONE" FOR BOX OF BOXES
79C IBOX(I)%ACTIBOX : FLAG FOR ACTIVATED BOX FOR (GRNOD,GRSHEL,LINE,SURF...)
80C IBOX(I)%NENTITY : NUMBER OF BOX ENTITIES (NODES,ELEMS,LINES,SURF)
81C WITHIN ACTIVATED BOX
82C IBOX(I)%SURFIAD : temporary address for solid external surface (in box)
83C IBOX(I)%BOXIAD : temporary address
84C IBOX(I)%DIAM : BOX diameter (CYLIN + SPHER)
85C IBOX(I)%X1 : coord.X for N1
86C IBOX(I)%Y1 : coord.Y for N1
87C IBOX(I)%Z1 : coord.Z for N1
88C IBOX(I)%X2 : coord.X for N2
89C IBOX(I)%Y2 : coord.Y for N2
90C IBOX(I)%Z2 : coord.Z for N2
91C IBOX(I)%IBOXBOX(NBOXBOX) : LIST OF BOXES (in /box/box)
92C IBOX(I)%ENTITY(NENTITY) : LIST OF ENTITIES (NODES,ELEMS,LINES,SURF)
93C=======================================================================
94c
95 CALL hm_option_start('/BOX/BOX')
96c
97c--------------------------------------------------
98 kk = 0
99 DO i = 1,nbox
100c
101 CALL hm_option_read_key(lsubmodel, option_id = boxid ,
102 . submodel_id = sub_id,
103 . option_titr = titr ,
104 . keyword2 = key )
105c-----------------------
106 CALL hm_get_intv ('Nbox' ,nbox_pos ,is_available, lsubmodel)
107 CALL hm_get_intv ('Nboxneg' ,nbox_neg ,is_available, lsubmodel)
108c
109 nlist = nbox_pos + nbox_neg
110c
111 iad = iad + 1
112 ibox(iad)%NBOXBOX = nlist
113 CALL my_alloc(ibox(iad)%IBOXBOX ,nlist)
114c
115 ii = 0
116 IF (nbox_pos > 0) THEN
117 DO j=1,nbox_pos
118 ii = ii + 1
119 CALL hm_get_int_array_index('box_ID',ibox(iad)%IBOXBOX(ii),j,is_available,lsubmodel)
120 END DO
121 END IF
122c
123 IF (nbox_neg > 0) THEN
124 DO j=1,nbox_neg
125 ii = ii + 1
126 CALL hm_get_int_array_index('box_IDneg',idneg,j,is_available,lsubmodel)
127 ibox(iad)%IBOXBOX(ii) = -idneg
128 END DO
129 END IF
130c
131 IF (nlist == 0) THEN
132 CALL ancmsg(msgid=801, msgtype= msgerror,
133 . anmode = aninfo ,
134 . i1 = boxid ,
135 . c1 = titr )
136 END IF
137c
138 ibox(iad)%TITLE = trim(titr)
139 ibox(iad)%ID = boxid
140 ibox(iad)%ISKBOX = 0
141 ibox(iad)%NBLEVELS=-1
142 ibox(iad)%LEVEL = 0
143 ibox(iad)%TYPE = 0
144 ibox(iad)%ACTIBOX = 0
145 ibox(iad)%NOD1 = 0
146 ibox(iad)%NOD2 = 0
147 ibox(iad)%DIAM = zero
148 ibox(iad)%X1 = zero
149 ibox(iad)%Y1 = zero
150 ibox(iad)%Z1 = zero
151 ibox(iad)%X2 = zero
152 ibox(iad)%Y2 = zero
153 ibox(iad)%Z2 = zero
154 ibox(iad)%SURFIAD = 0
155 ibox(iad)%NENTITY = 0
156 ibox(iad)%BOXIAD = 0
157c
158 ENDDO
159c-----------
160 RETURN
161 END
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)
integer, parameter nchartitle
integer, parameter ncharkey
subroutine read_box_box(ibox, iad, nbox, lsubmodel)
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