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

Go to the source code of this file.

Functions/Subroutines

subroutine sensor_user_convert_local_id (itabm1, pointer_entity, number_entity, list_entity, mode0, ipart)

Function/Subroutine Documentation

◆ sensor_user_convert_local_id()

subroutine sensor_user_convert_local_id ( integer, dimension(*), intent(in) itabm1,
integer, intent(inout) pointer_entity,
integer, intent(inout) number_entity,
integer, dimension(*), intent(inout) list_entity,
integer, intent(in) mode0,
integer, dimension(lipart1,*), intent(in) ipart )

Definition at line 30 of file sensor_user_convert_local_id.F.

31!$COMMENT
32! SENSOR_USER_CONVERT_LOCAL_I description
33! convert a list of User ID into a local ID
34!
35! SENSOR_USER_CONVERT_LOCAL_I organization :
36! - sort the list
37! - remove the duplicated ID
38! - compact the list
39!$ENDCOMMENT
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C A n a l y s e M o d u l e
50C-----------------------------------------------
51#include "com04_c.inc"
52#include "scr17_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER, INTENT(in) :: MODE0
57 INTEGER, INTENT(inout) :: POINTER_ENTITY
58 INTEGER, INTENT(inout) :: NUMBER_ENTITY
59 INTEGER, DIMENSION(*), INTENT(inout) :: LIST_ENTITY
60 INTEGER ,DIMENSION(*) ,INTENT(IN) :: ITABM1
61 INTEGER,INTENT(IN)::IPART(LIPART1,*)
62C-----------------------------------------------
63C E x t e r n a l F u n c t i o n s
64C-----------------------------------------------
65 INTEGER USR2SYS
66C-----------------------------------------------
67C L o c a l V a r i a b l e s
68C-----------------------------------------------
69 INTEGER :: SIZE_LOCAL
70 INTEGER :: MODE,WORK(70000)
71 INTEGER, DIMENSION(:), ALLOCATABLE :: LOCAL_ARRAY,INDX
72 INTEGER :: N1,NS,U_PART
73 INTEGER :: I,J,K,IJK
74 CHARACTER MESS*40
75 DATA mess/'SENSOR DEFINITION '/
76! -------------------------------
77 ns = 1
78
79 ! -------------------
80 ! sort the list of ID
81 mode=0
82 size_local = pointer_entity
83 ALLOCATE( indx(2*size_local) )
84 ALLOCATE( local_array(size_local) )
85 DO i=1,size_local
86 indx(i) = i
87 local_array(i) = list_entity(i)
88 ENDDO
89 CALL my_orders(mode,work,list_entity,indx,size_local,1)
90 DO i=1,size_local
91 j = indx(i)
92 list_entity(i) = local_array(j)
93 ENDDO
94 ! -------------------
95 ! remove the duplicated ID
96
97 ! example of list :
98 ! position in the list + list
99 ! 1 2 3 4 5 6 7 8 9 10 <-- position
100 ! a a a b c c d d d e <-- list
101 ! if node(i)/=node(i+1) --> save i
102 ! 1 4 5 7 10 <-- index of saved nodes
103 ! a b c d e <-- compacted list
104
105 ! compute the index of saved nodes
106 k = 1
107 local_array(1) = 1
108 j = 0
109 DO i=2,size_local
110 j = j + 1
111 IF(list_entity(i)/=list_entity(i-1)) THEN
112 k = k + 1
113 local_array(k) = local_array(k-1) + j
114 j = 0
115 ENDIF
116 ENDDO
117
118 ! compact the list of node & save the new number of node + pointer
119 DO i=1,k
120 list_entity(i) = list_entity(local_array(i))
121 ENDDO
122 pointer_entity = k
123 number_entity = k
124 ! -------------------
125 ! convert User node ID --> Local node ID
126 IF(mode0==1)THEN
127 DO i=1,number_entity
128 n1 = list_entity(i)
129 list_entity(i) = usr2sys(n1,itabm1,mess,ns)
130 ENDDO
131 ! -------------------
132 ! convert User part ID --> Local part ID
133 ELSEIF(mode0==2) THEN
134 DO i=1,number_entity
135 u_part = list_entity(i)
136 ijk = 0
137 DO j=1,npart
138 IF(u_part == ipart(4,j)) THEN
139 ijk = j
140 EXIT
141 ENDIF
142 ENDDO
143 list_entity(i) = ijk
144 ENDDO
145 ENDIF
146 ! -------------------
147
148 DEALLOCATE( indx )
149 DEALLOCATE( local_array )
150 RETURN
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
integer function usr2sys(iu, itabm1, mess, id)
Definition sysfus.F:160