OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_count_2d_element_seatbelt.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!|| hm_count_2d_element_seatbelt ../starter/source/devtools/hm_reader/hm_count_2d_element_seatbelt.F
25!||--- called by ------------------------------------------------------
26!|| starter0 ../starter/source/starter/starter0.F
27!||--- calls -----------------------------------------------------
28!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
29!|| hm_option_count ../starter/source/devtools/hm_reader/hm_option_count.F
30!|| hm_option_next ../starter/source/devtools/hm_reader/hm_option_next.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 hm_count_2d_element_seatbelt(NB_SHELLS,LSUBMODEL)
39C-----------------------------------------------
40C ROUTINE DESCRIPTION :
41C ===================
42C ROUTINE TO COUNT NUMBER OF /SHELLs FOR 2D SEATBELTS
43C-----------------------------------------------
44C DUMMY ARGUMENTS DESCRIPTION:
45C ===================
46C
47C NAME DESCRIPTION
48C
49C NB_SHELLS NUMBER OF /SHELLs FOR 2D SEATBELTS
50C LSUBMODEL SUBMODEL STRUCTURE
51C============================================================================
52C M o d u l e s
53C-----------------------------------------------
54 USE message_mod
58C-----------------------------------------------
59C I m p l i c i t T y p e s
60C-----------------------------------------------
61#include "implicit_f.inc"
62C-----------------------------------------------
63C D u m m y A r g u m e n t s
64C-----------------------------------------------
65C INPUT ARGUMENTS
66 INTEGER,INTENT(INOUT) :: NB_SHELLS
67 TYPE(submodel_data),INTENT(IN) :: LSUBMODEL(NSUBMOD)
68C-----------------------------------------------
69C L o c a l V a r i a b l e s
70C-----------------------------------------------
71 INTEGER :: I,J,ID,SUBMODEL_INDEX,NB_PART,NB_MAT,NB_MAT_119,MAT_ID,NB_SHELLS_PART
72 INTEGER, DIMENSION(:), ALLOCATABLE :: PART_MAT119,MAT119_IDS
73 CHARACTER(LEN=NCHARLINE) :: KEY
74 LOGICAL :: IS_AVAILABLE
75C-----------------------------------------------
76 nb_mat_119 = 0
77C-----------------------------------------------
78C Check existence of Mat laws 119 in the model
79C-----------------------------------------------
80 CALL hm_option_count('/MAT',nb_mat)
81c
82 CALL hm_option_start('/MAT')
83 DO i=1,nb_mat
84 key = ''
85 CALL hm_option_read_key(lsubmodel,keyword2 = key)
86 IF(key(1:6) == 'LAW119' .OR. key(1:11) == 'SH_SEATBELT') THEN
87 nb_mat_119 = nb_mat_119 + 1
88 ENDIF
89 ENDDO
90C-----------------------------------------------
91C Search Parts with Mat 119
92C-----------------------------------------------
93 IF (nb_mat_119 /= 0) THEN
94 ALLOCATE(mat119_ids(nb_mat_119))
95 mat119_ids(1:nb_mat_119) = 0
96 j = 0
97 CALL hm_option_start('/MAT')
98 DO i=1,nb_mat
99 key = ''
100 CALL hm_option_read_key(lsubmodel, option_id=id, keyword2=key, submodel_index=submodel_index)
101 IF(key(1:6) == 'LAW119' .OR. key(1:11) == 'SH_SEATBELT') THEN
102 j = j + 1
103 mat119_ids(j) = id
104 ENDIF
105 ENDDO
106C-----------------------------------------------
107 CALL hm_option_count('/PART',nb_part)
108 ALLOCATE(part_mat119(nb_part))
109 part_mat119(1:nb_part) = 0
110c
111 CALL hm_option_start('/PART')
112 DO i=1,nb_part
113 CALL hm_option_read_key(lsubmodel, option_id=id, submodel_index=submodel_index)
114 CALL hm_get_intv('materialid',mat_id,is_available,lsubmodel)
115 DO j=1,nb_mat_119
116 IF(mat_id == mat119_ids(j)) part_mat119(i) = mat119_ids(j)
117 ENDDO
118 ENDDO
119C-----------------------------------------------
120C Count /SHELLs
121C-----------------------------------------------
122c
123 nb_shells = 0
124 nb_shells_part = 0
125 CALL hm_option_start('/PART')
126 DO i=1,nb_part
127 CALL hm_option_next()
128 IF(part_mat119(i) /= 0) THEN
129 CALL cpp_count_elements_in_part(nb_shells_part)
130 nb_shells = nb_shells + nb_shells_part
131 ENDIF
132 ENDDO
133c
134 IF (ALLOCATED(part_mat119)) DEALLOCATE(part_mat119)
135 IF (ALLOCATED(mat119_ids)) DEALLOCATE(mat119_ids)
136C--------------------------------------------------
137 ENDIF
138 RETURN
139C
140 END
141
subroutine hm_count_2d_element_seatbelt(nb_shells, lsubmodel)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_count(entity_type, hm_option_number)
subroutine hm_option_next()
subroutine hm_option_start(entity_type)
integer, parameter ncharline
integer nsubmod