OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_seg_clause.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!|| create_seg_clause ../starter/source/model/sets/create_seg_clause.F
25!||--- called by ------------------------------------------------------
26!|| hm_set ../starter/source/model/sets/hm_set.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_int_array_2indexes ../starter/source/devtools/hm_reader/hm_get_int_array_2indexes.F
30!|| hm_get_int_array_index ../starter/source/devtools/hm_reader/hm_get_int_array_index.F
31!|| set_usrtos ../starter/source/model/sets/ipartm1.F
32!||--- uses -----------------------------------------------------
33!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
34!|| message_mod ../starter/share/message_module/message_mod.F
35!|| submodel_mod ../starter/share/modules1/submodel_mod.F
36!||====================================================================
37 SUBROUTINE create_seg_clause(CLAUSE, ITABM1 ,JCLAUSE ,IS_AVAILABLE ,LSUBMODEL)
38C-----------------------------------------------
39C D e s c r i p t i o n
40C-----------------------------------------------
41C ===================
42C Create PART Clause from LIST
43C-----------------------------------------------
44C DUMMY ARGUMENTS DESCRIPTION:
45C ===================
46C
47C NAME DESCRIPTION
48C
49C CLAUSE (SET structure) Clause to be treated
50C IPARTM1 MAP Table UID -> LocalID
51C JCLAUSE parameter with HM_READER (current clause read)
52C IS_AVAILABLE Bool / Result of HM_interface
53C LSUBMODEL SUBMODEL Structure.
54C-----------------------------------------------
55C M o d u l e s
56C-----------------------------------------------
57 USE setdef_mod
58 USE submodel_mod
59 USE message_mod
61C-----------------------------------------------
62C I m p l i c i t T y p e s
63C-----------------------------------------------
64#include "implicit_f.inc"
65C-----------------------------------------------
66C C o m m o n B l o c k s
67C-----------------------------------------------
68#include "com04_c.inc"
69C-----------------------------------------------
70C D u m m y A r g u m e n t s
71C-----------------------------------------------
72 INTEGER JCLAUSE
73 LOGICAL :: IS_AVAILABLE
74 INTEGER, INTENT(IN), DIMENSION(NUMNOD,2) :: ITABM1
75 TYPE (SET_) :: CLAUSE
76 TYPE(SUBMODEL_DATA),INTENT(IN):: LSUBMODEL(NSUBMOD)
77C-----------------------------------------------
78C L o c a l V a r i a b l e s
79C-----------------------------------------------
80 INTEGER I,J,NINDX,SEG_MAX,NOD_1,NOD_2,NOD_3,NOD_4,NODSYS_1,NODSYS_2,NODSYS_3,NODSYS_4,SEG_ID,LINE_SEG
81 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: BUFSURF
82 INTEGER,EXTERNAL :: SET_USRTOS
83C-----------------------------------------------
84C S o u r c e L i n e s
85C-----------------------------------------------
86 line_seg = 0
87 CALL hm_get_int_array_index('segmax' ,seg_max ,jclause,is_available,lsubmodel)
88 ALLOCATE(bufsurf(4,seg_max))
89 nindx = 0
90!
91 ! Read & convert Segs
92 ! ---------------------
93 DO i=1,seg_max ! always = 1 for clause 'SEG'
94 CALL hm_get_int_array_2indexes('segid',seg_id,jclause ,i,is_available,lsubmodel)
95 CALL hm_get_int_array_2indexes('ids1' ,nod_1 ,jclause ,i,is_available,lsubmodel)
96 CALL hm_get_int_array_2indexes('ids2' ,nod_2 ,jclause ,i,is_available,lsubmodel)
97 CALL hm_get_int_array_2indexes('ids3' ,nod_3 ,jclause ,i,is_available,lsubmodel)
98 CALL hm_get_int_array_2indexes('ids4' ,nod_4 ,jclause ,i,is_available,lsubmodel)
99 nodsys_1 = set_usrtos(nod_1,itabm1,numnod)
100 IF (nodsys_1 == 0) THEN
101 ! Node was not found. Issue an error.
102 CALL ancmsg(msgid=1903,anmode=aninfo,msgtype=msgerror,
103 . i1 = clause%SET_ID,
104 . i2=seg_id,
105 . i3=nod_1,
106 . c1=trim(clause%TITLE),
107 . c2='NODE')
108 ELSE
109 nodsys_1 = itabm1(nodsys_1,2)
110 ENDIF
111
112 nodsys_2 = set_usrtos(nod_2,itabm1,numnod)
113 IF (nodsys_2 == 0) THEN
114 ! Node was not found. Issue an error.
115 CALL ancmsg(msgid=1903,anmode=aninfo,msgtype=msgerror,
116 . i1 = clause%SET_ID,
117 . i2=seg_id,
118 . i3=nod_2,
119 . c1=trim(clause%TITLE),
120 . c2='node')
121 ELSE
122 NODSYS_2 = ITABM1(NODSYS_2,2)
123 ENDIF
124
125 LINE_SEG = 0
126.AND. IF (NOD_3 == 0 NOD_4 == 0) THEN
127 LINE_SEG = 1 ! Line SEG
128 NODSYS_3 = 0
129 NODSYS_4 = 0
130 ELSE
131 NODSYS_3 = SET_USRTOS(NOD_3,ITABM1,NUMNOD)
132 NODSYS_4 = SET_USRTOS(NOD_4,ITABM1,NUMNOD)
133 ENDIF
134
135 IF (LINE_SEG == 0) THEN! Surf SEG --> continue Node check existence
136 IF (NODSYS_3 == 0) THEN
137 ! Node was not found. Issue an error.
138 CALL ANCMSG(MSGID=1903,ANMODE=ANINFO,MSGTYPE=MSGERROR,
139 . I1 = CLAUSE%SET_ID,
140 . I2=SEG_ID,
141 . I3=NOD_3,
142 . C1=TRIM(CLAUSE%TITLE),
143 . C2='node')
144 ELSE
145 ! Node found
146 NODSYS_3 = ITABM1(NODSYS_3,2)
147 ENDIF
148
149 IF (NOD_4 == 0) THEN
150 ! correction to allow for 3 noded surface (triangle)
151 NODSYS_4 = NODSYS_3
152 ELSE IF (NODSYS_4 == 0) THEN
153 ! Node was not found. Issue an error.
154 CALL ANCMSG(MSGID=1903,ANMODE=ANINFO,MSGTYPE=MSGERROR,
155 . I1 = CLAUSE%SET_ID,
156 . I2=SEG_ID,
157 . I3=NOD_4,
158 . C1=TRIM(CLAUSE%TITLE),
159 . C2='node')
160 ELSE IF (NODSYS_4 /= 0) THEN
161 ! Node found
162 NODSYS_4 = ITABM1(NODSYS_4,2)
163 ENDIF
164
165 ENDIF ! IF (LINE_SEG == 0)
166
167 NINDX = NINDX+1 ! nb of CLAUSE SEGs
168 BUFSURF(1,NINDX) = NODSYS_1
169 BUFSURF(2,NINDX) = NODSYS_2
170 BUFSURF(3,NINDX) = NODSYS_3
171 BUFSURF(4,NINDX) = NODSYS_4
172
173 ENDDO ! DO I=1,SEG_MAX
174
175 ! Copy in final SET
176 ! ------------------
177
178 !------------------------------------!
179 ! create SURF clause or LINE clause !
180 !------------------------------------!
181
182 IF (LINE_SEG == 0) THEN
183
184 ! SURF seg (4-node SEG)
185 CLAUSE%NB_SURF_SEG = NINDX
186 ALLOCATE(CLAUSE%SURF_NODES(NINDX,4))
187 ALLOCATE(CLAUSE%SURF_ELTYP(NINDX))
188 ALLOCATE(CLAUSE%SURF_ELEM(NINDX))
189
190 DO I=1,NINDX
191 CLAUSE%SURF_NODES(I,1) = BUFSURF(1,I) ! N1
192 CLAUSE%SURF_NODES(I,2) = BUFSURF(2,I) ! N2
193 CLAUSE%SURF_NODES(I,3) = BUFSURF(3,I) ! N3
194 CLAUSE%SURF_NODES(I,4) = BUFSURF(4,I) ! N4
195 CLAUSE%SURF_ELTYP(I) = 0 ! ELTYP
196 CLAUSE%SURF_ELEM(I) = 0 ! ELEM
197 ENDDO
198
199 ELSE
200
201 ! LINE seg (2-node SEG)
202 CLAUSE%NB_LINE_SEG = NINDX
203 ALLOCATE(CLAUSE%LINE_NODES(NINDX,2))
204 ALLOCATE(CLAUSE%LINE_ELTYP(NINDX))
205 ALLOCATE(CLAUSE%LINE_ELEM(NINDX))
206
207 DO I=1,NINDX
208 CLAUSE%LINE_NODES(I,1) = BUFSURF(1,I) ! N1
209 CLAUSE%LINE_NODES(I,2) = BUFSURF(2,I) ! N2
210 CLAUSE%LINE_ELTYP(I) = 0 ! ELTYP
211 CLAUSE%LINE_ELEM(I) = 0 ! ELEM
212 ENDDO
213
214 ENDIF ! IF (LINE_SEG == 0)
215
216C-------------------------
217 DEALLOCATE(BUFSURF)
218C-------------------------
219 RETURN
220 END
subroutine create_seg_clause(clause, itabm1, jclause, is_available, lsubmodel)
subroutine hm_get_int_array_2indexes(name, ival, index1, index2, is_available, lsubmodel)
subroutine hm_get_int_array_index(name, ival, index, is_available, 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