OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_node_clause.F File Reference
#include "implicit_f.inc"
#include "com04_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine create_node_clause (clause, itabm1, jclause, opt_g, is_available, lsubmodel, opt_b, ibox, x, skew, set_title, keyset)
subroutine create_node_list (clause, itabm1, jclause, is_available, lsubmodel)
subroutine create_node_list_g (clause, itabm1, jclause, is_available, lsubmodel)

Function/Subroutine Documentation

◆ create_node_clause()

subroutine create_node_clause ( type (set_) clause,
integer, dimension(numnod,2), intent(in) itabm1,
integer jclause,
integer opt_g,
logical is_available,
type(submodel_data), dimension(*), intent(in) lsubmodel,
integer opt_b,
type (box_), dimension(nbbox) ibox,
x,
skew,
character(len=nchartitle) set_title,
character(len=ncharfield) keyset )

Definition at line 36 of file create_node_clause.F.

40C-----------------------------------------------
41C ROUTINE DESCRIPTION :
42C ===================
43C Treat the NODE Clause, read NODEs from HM_READER & fill clause
44C Calls CREATE_NODE_LIST (simple list)
45C Calls CREATE_NODE_LIST_G (NODE_G : All nodes from a MIN to MAX with increment)
46C------------------------------------------------------------------
47C DUMMY ARGUMENTS DESCRIPTION:
48C ===================
49C
50C NAME DESCRIPTION
51C
52C CLAUSE (SET structure) Clause to be treated
53C ITABM1 MAP Table UID -> LocalID
54C JCLAUSE parameter with HM_READER (current clause read)
55C Opt_G Opt_G operator 1 if PART_G is set, 0 else
56C IS_AVAILABLE Bool / Result of HM_interface
57C LSUBMODEL SUBMODEL Structure.
58C============================================================================
59C-----------------------------------------------
60C M o d u l e s
61C-----------------------------------------------
62 USE setdef_mod
63 USE submodel_mod
64 USE message_mod
68C-----------------------------------------------
69C I m p l i c i t T y p e s
70C-----------------------------------------------
71#include "implicit_f.inc"
72C-----------------------------------------------
73C C o m m o n B l o c k s
74C-----------------------------------------------
75#include "com04_c.inc"
76#include "param_c.inc"
77C-----------------------------------------------
78C D u m m y A r g u m e n t s
79C-----------------------------------------------
80 INTEGER JCLAUSE,OPT_G,OPT_B
81 LOGICAL :: IS_AVAILABLE
82 INTEGER, INTENT(IN), DIMENSION(NUMNOD,2) :: ITABM1
83 my_real x(3,*),skew(lskew,*)
84 CHARACTER(LEN=NCHARFIELD) :: KEYSET
85 CHARACTER(LEN=NCHARTITLE) :: SET_TITLE
86C-----------------------------------------------
87 TYPE (SET_) :: CLAUSE
88 TYPE(SUBMODEL_DATA),INTENT(IN):: LSUBMODEL(*)
89 TYPE (BOX_) , DIMENSION(NBBOX) :: IBOX
90C-----------------------------------------------
91C L o c a l V a r i a b l e s
92C-----------------------------------------------
93!
94 IF ( opt_g == 1 ) THEN
95
96 CALL create_node_list_g(clause, itabm1 ,jclause ,is_available ,lsubmodel)
97
98 ELSEIF ( opt_g == 0 .AND. opt_b == 0 ) THEN
99
100 CALL create_node_list (clause, itabm1 ,jclause ,is_available ,lsubmodel)
101
102 ELSEIF ( opt_b == 1 ) THEN
103
104 CALL create_node_box (clause ,itabm1 ,jclause ,is_available ,lsubmodel,
105 . ibox ,x ,skew ,set_title ,keyset )
106 ENDIF
107C-----------------------------------------------
#define my_real
Definition cppsort.cpp:32
subroutine create_node_box(clause, itabm1, jclause, is_available, lsubmodel, ibox, x, skew, set_title, keyset)
subroutine create_node_list_g(clause, itabm1, jclause, is_available, lsubmodel)
subroutine create_node_list(clause, itabm1, jclause, is_available, lsubmodel)
integer, parameter nchartitle
integer, parameter ncharfield

◆ create_node_list()

subroutine create_node_list ( type (set_) clause,
integer, dimension(numnod,2), intent(in) itabm1,
integer jclause,
logical is_available,
type(submodel_data), dimension(*), intent(in) lsubmodel )

Definition at line 123 of file create_node_clause.F.

125C-----------------------------------------------
126C ROUTINE DESCRIPTION :
127C ===================
128C Create NODE Clause from LIST
129C------------------------------------------------------------------
130C DUMMY ARGUMENTS DESCRIPTION:
131C ===================
132C
133C NAME DESCRIPTION
134C
135C CLAUSE (SET structure) Clause to be treated
136C ITABM1 MAP Table UID -> LocalID
137C JCLAUSE parameter with HM_READER (current clause read)
138C IS_AVAILABLE Bool / Result of HM_interface
139C LSUBMODEL SUBMODEL Structure.
140C============================================================================
141C-----------------------------------------------
142C M o d u l e s
143C-----------------------------------------------
144 USE setdef_mod
145 USE submodel_mod
146 USE message_mod
148C-----------------------------------------------
149C I m p l i c i t T y p e s
150C-----------------------------------------------
151#include "implicit_f.inc"
152C-----------------------------------------------
153C C o m m o n B l o c k s
154C-----------------------------------------------
155#include "com04_c.inc"
156C-----------------------------------------------
157C D u m m y A r g u m e n t s
158C-----------------------------------------------
159 INTEGER JCLAUSE
160 LOGICAL :: IS_AVAILABLE
161 INTEGER, INTENT(IN), DIMENSION(NUMNOD,2) :: ITABM1
162!
163 TYPE (SET_) :: CLAUSE
164 TYPE(SUBMODEL_DATA),INTENT(IN):: LSUBMODEL(*)
165C-----------------------------------------------
166C L o c a l V a r i a b l e s
167C-----------------------------------------------
168 INTEGER I,IDS,NINDX,LIST_SIZE,IDS_MAX,NODSYS
169 INTEGER IWORK(70000)
170!
171 INTEGER, ALLOCATABLE, DIMENSION(:) :: NODE_READ_TMP,INDEX,SORT
172C
173 INTEGER SET_USRTOS
174 EXTERNAL set_usrtos
175C=======================================================================
176
177 CALL hm_get_int_array_index('idsmax' ,ids_max ,jclause,is_available,lsubmodel)
178
179 ALLOCATE(node_read_tmp(ids_max))
180 node_read_tmp(1:ids_max) = 0
181 ALLOCATE(index(2*ids_max))
182 ALLOCATE(sort(ids_max))
183
184 index = 0
185
186 nindx = 0
187 list_size = 0
188
189 ! Read & convert Nodes
190 ! ---------------------
191 DO i=1,ids_max
192 CALL hm_get_int_array_2indexes('ids',ids,jclause,i,is_available,lsubmodel)
193
194 nodsys = set_usrtos(ids,itabm1,numnod)
195 IF(nodsys == 0)THEN
196 ! Node was not found. Issue a Warning & Skip.
197 CALL ancmsg(msgid=1902,anmode=aninfo,
198 . msgtype=msgwarning,
199 . i1 = clause%SET_ID,
200 . i2=ids,
201 . c1=trim(clause%TITLE),
202 . c2='NODE')
203 ELSE
204
205 nodsys=itabm1(nodsys,2)
206
207 nindx=nindx+1 ! nb of CLAUSE nodes
208 node_read_tmp(nindx) = nodsys
209 ENDIF
210
211 ENDDO ! DO K=1,IDS_MAX
212
213
214
215
216
217 ! Sort the Readed NODEs and remove eventual duplicates
218 ! ----------------------------------------------------
219
220 DO i=1,nindx
221 index(i) = i
222 sort(i) = node_read_tmp(i)
223 ENDDO
224 CALL my_orders(0,iwork,sort,index,nindx,1)
225
226 DO i=1,nindx
227 node_read_tmp(i) = sort(index(i))
228 ENDDO
229
230 CALL remove_duplicates(node_read_tmp,nindx,list_size)
231
232 ! Copy in final SET
233 ! ------------------
234 clause%NB_NODE = list_size
235 ALLOCATE( clause%NODE( list_size ) )
236
237 DO i=1,list_size
238 clause%NODE(i) = node_read_tmp(i)
239 ENDDO
240C-------------------------
241 DEALLOCATE(node_read_tmp)
242 DEALLOCATE(sort)
243 DEALLOCATE(index)
244C-------------------------
245 RETURN
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)
integer function set_usrtos(iu, ipartm1, npart)
Definition ipartm1.F:128
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
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

◆ create_node_list_g()

subroutine create_node_list_g ( type (set_) clause,
integer, dimension(numnod,2), intent(in) itabm1,
integer jclause,
logical is_available,
type(submodel_data), dimension(*), intent(in) lsubmodel )

Definition at line 261 of file create_node_clause.F.

263C-----------------------------------------------
264C ROUTINE DESCRIPTION :
265C ===================
266C Create PART Clause from Generation All parts from Min to Max with Increment (Opt_G)
267C--------------------------------------------------------------------------------------
268C DUMMY ARGUMENTS DESCRIPTION:
269C ===================
270C
271C NAME DESCRIPTION
272C
273C CLAUSE (SET structure) Clause to be treated
274C ITABM1 MAP Table UID -> LocalID
275C JCLAUSE parameter with HM_READER (current clause read)
276C IS_AVAILABLE Bool / Result of HM_interface
277C LSUBMODEL SUBMODEL Structure.
278C============================================================================
279C-----------------------------------------------
280C M o d u l e s
281C-----------------------------------------------
282 USE setdef_mod
283 USE submodel_mod
284 USE message_mod
286C-----------------------------------------------
287C I m p l i c i t T y p e s
288C-----------------------------------------------
289#include "implicit_f.inc"
290C-----------------------------------------------
291C C o m m o n B l o c k s
292C-----------------------------------------------
293#include "com04_c.inc"
294C-----------------------------------------------
295C D u m m y A r g u m e n t s
296C-----------------------------------------------
297 INTEGER JCLAUSE
298 LOGICAL :: IS_AVAILABLE
299 INTEGER, INTENT(IN), DIMENSION(NUMNOD,2) :: ITABM1
300!
301 TYPE (SET_) :: CLAUSE
302 TYPE(SUBMODEL_DATA),INTENT(IN):: LSUBMODEL(*)
303C-----------------------------------------------
304C L o c a l V a r i a b l e s
305C-----------------------------------------------
306 INTEGER I,IDS,LIST_SIZE,IDS_MAX,GENE_MAX,K,N,N1
307 INTEGER START_GENE,END_GENE,INCR_GENE,NSTART,NSTOP,STACK,STACK_ONE,NB_RESULT
308!-
309 INTEGER, ALLOCATABLE, DIMENSION(:) :: NODE_READ_TMP,
310 . NODE_READ_ONE,RESULT
311C
312 INTEGER SET_USRTOS_NEAREST
313 EXTERNAL set_usrtos_nearest
314C=======================================================================
315 CALL hm_get_int_array_index('genemax' ,gene_max ,jclause,is_available,lsubmodel)
316
317 ALLOCATE(node_read_tmp(numnod))
318 ALLOCATE(node_read_one(numnod))
319
320
321 IF (gene_max > 1) THEN
322 ALLOCATE(result(numnod))
323 ENDIF
324
325 stack=0
326
327 DO k=1,gene_max
328 CALL hm_get_int_array_2indexes('start' ,start_gene,jclause,k,is_available,lsubmodel)
329 CALL hm_get_int_array_2indexes('end' ,end_gene ,jclause,k,is_available,lsubmodel)
330 CALL hm_get_int_array_2indexes('by' ,incr_gene ,jclause,k,is_available,lsubmodel)
331
332 ! set value by default for increment to 1
333 IF (incr_gene == 0) incr_gene = 1
334
335 nstart = set_usrtos_nearest(start_gene,itabm1,numnod,1)
336 nstop = set_usrtos_nearest(end_gene,itabm1,numnod,2)
337
338 stack_one=0
339 DO n=nstart, nstop
340 n1 = itabm1(n,1)
341 IF ( mod( n1-start_gene , incr_gene) == 0)THEN
342 stack_one = stack_one+1
343 node_read_one(stack_one) = itabm1(n,2)
344 ENDIF
345 ENDDO
346
347 IF (stack==0) THEN
348 node_read_tmp(1:stack_one) = node_read_one(1:stack_one)
349 stack = stack_one
350 ELSE
351 ! This code will not go if GENE_MAX == 1 / Result does not need to be allocated
352 CALL union_2_sorted_sets( node_read_tmp, stack ,
353 * node_read_one, stack_one ,
354 * result, nb_result )
355
356 node_read_tmp(1:nb_result) = result(1:nb_result)
357 stack = nb_result
358 ENDIF
359 ENDDO
360
361 clause%NB_NODE = stack
362 ALLOCATE(clause%NODE(stack))
363 clause%NODE(1:stack) = node_read_tmp(1:stack)
364C-------------------------
365 DEALLOCATE (node_read_tmp)
366 DEALLOCATE (node_read_one)
367 IF (ALLOCATED(result)) DEALLOCATE (result)
368C-------------------------
integer function set_usrtos_nearest(ui, map, sz, uplow)
Definition ipartm1.F:197