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

Go to the source code of this file.

Functions/Subroutines

subroutine check_surface_state (itask, surfarce_nb, surface_id, shift_interface, intbuf_tab, ipari, geo, ixs, ixc, ixt, ixp, ixr, ixtg, ixs10, addcnel, cnel, tag_node, tag_elem, shoot_struct)

Function/Subroutine Documentation

◆ check_surface_state()

subroutine check_surface_state ( integer, intent(in) itask,
integer, intent(in) surfarce_nb,
integer, dimension(surfarce_nb), intent(in) surface_id,
integer, dimension(ninter+1,2), intent(in) shift_interface,
type(intbuf_struct_), dimension(ninter), intent(inout) intbuf_tab,
integer, dimension(npari,ninter), intent(in) ipari,
intent(in) geo,
integer, dimension(nixs,numels), intent(in) ixs,
integer, dimension(nixc,numelc), intent(in) ixc,
integer, dimension(nixt,numelt), intent(in) ixt,
integer, dimension(nixp,numelp), intent(in) ixp,
integer, dimension(nixr,numelr), intent(in) ixr,
integer, dimension(nixtg,numeltg), intent(in) ixtg,
integer, dimension(6,numels10), intent(in) ixs10,
integer, dimension(0:numnod+1), intent(in) addcnel,
integer, dimension(0:lcnel), intent(in) cnel,
integer, dimension(numnod), intent(inout) tag_node,
integer, dimension(numels+numelq+numelc+numelt+numelp+numelr+numeltg), intent(inout) tag_elem,
type(shooting_node_type), intent(inout) shoot_struct )
Parameters
[in]ixs10tetra10 data

Definition at line 35 of file check_surface_state.F.

39!$COMMENT
40! CHECK_SURFACE_STATE description
41! check the state of an surface (active or not)
42! CHECK_SURFACE_STATE organization
43! loop over a list of surface :
44! -check if 1 or more element associated to the surface is/are active
45! - if there is no active element, the surface is deactivate
46! - additional treatment for interface type 24 & 25 : save the list of deactivated surface
47! --> need to send them to remote proc for neighbouring surface deactivation
48!$ENDCOMMENT
49 USE intbufdef_mod
51C-----------------------------------------------
52C I m p l i c i t T y p e s
53C-----------------------------------------------
54#include "implicit_f.inc"
55C-----------------------------------------------
56C C o m m o n B l o c k s
57C-----------------------------------------------
58#include "task_c.inc"
59#include "com04_c.inc"
60#include "scr17_c.inc"
61#include "param_c.inc"
62C-----------------------------------------------
63C D u m m y A r g u m e n t s
64C-----------------------------------------------
65 INTEGER, INTENT(in) :: ITASK ! omp thread ID
66 INTEGER, INTENT(in) :: SURFARCE_NB ! number of local deactivated surface
67 INTEGER, DIMENSION(SURFARCE_NB), INTENT(in) :: SURFACE_ID ! id of surface that need to be deactivated
68 INTEGER, DIMENSION(NINTER+1,2), INTENT(in) :: SHIFT_INTERFACE ! interface shift
69 TYPE(INTBUF_STRUCT_), DIMENSION(NINTER), INTENT(inout) :: INTBUF_TAB ! interface data
70 INTEGER, DIMENSION(NPARI,NINTER), INTENT(in) :: IPARI
71
72 INTEGER, DIMENSION(NIXS,NUMELS), INTENT(in) :: IXS ! solid array
73 INTEGER, DIMENSION(NIXC,NUMELC), INTENT(in) :: IXC ! shell array
74 INTEGER, DIMENSION(NIXT,NUMELT), INTENT(in) :: IXT! truss array
75 INTEGER, DIMENSION(NIXP,NUMELP), INTENT(in) :: IXP! beam array
76 INTEGER, DIMENSION(NIXR,NUMELR), INTENT(in) :: IXR! spring array
77 INTEGER, DIMENSION(NIXTG,NUMELTG), INTENT(in) :: IXTG! triangle array
78 INTEGER, DIMENSION(6,NUMELS10), INTENT(in) :: IXS10!< tetra10 data
79 INTEGER, DIMENSION(0:NUMNOD+1), INTENT(in) :: ADDCNEL ! address for the CNEL array
80 my_real, DIMENSION(NPROPG,NUMGEO), INTENT(in) :: geo
81 INTEGER, DIMENSION(0:LCNEL), INTENT(in) :: CNEL ! connectivity node-->element
82 INTEGER, DIMENSION(NUMNOD), INTENT(inout) :: TAG_NODE
83 INTEGER, DIMENSION(NUMELS+NUMELQ+NUMELC+NUMELT+NUMELP+NUMELR+NUMELTG), INTENT(inout) :: TAG_ELEM
84 TYPE(shooting_node_type), INTENT(inout) :: SHOOT_STRUCT ! structure for shooting node algo
85C-----------------------------------------------
86C L o c a l V a r i a b l e s
87C-----------------------------------------------
88 LOGICAL :: DEACTIVATION,ACTIVATION,TYPE_INTER
89 INTEGER :: I,K,FIRST,LAST
90 INTEGER :: NIN,ID_INTER,NUMBER_INTER
91 INTEGER :: ITY,IDEL
92 INTEGER :: N1,N2,N3,N4
93 INTEGER :: NUMBER_NODE
94 INTEGER :: DICHOTOMIC_SEARCH_I_ASC ! function
95 INTEGER :: MY_REAL_TASK_ID ! real task id : itask is used in a strange way here : -1 if there is no omp // (in the mpi comm)
96 INTEGER, DIMENSION(:), ALLOCATABLE :: NUMBER_SAVED_SURFACE_TYP24_25 ! number of deactivated surface for interface type 24 or 25
97 INTEGER, DIMENSION(SURFARCE_NB) :: SAVED_SURFACE_TYP24_25 ! list of deactivated surface for interface type 24 or 25
98 SAVE number_saved_surface_typ24_25
99 INTEGER :: OFFSET_TASK ! offset to point to the right place in the array SHOOT_STRUCT%REMOTE_SURF
100 INTEGER :: LOW_BOUND,UP_BOUND ! bounds
101 INTEGER :: TOTAL_NUMBER_SURFACE ! total number of deleted surface
102 INTEGER, DIMENSION(:), ALLOCATABLE :: SAVED_SURFACE ! temporary array
103 INTEGER :: NB_CONNECTED_ELM ! number of element connected to a sefment/surface
104 INTEGER :: TOTAL_NUMBER_NEW_SURFACE ! total number of new active surface/
105 INTEGER, DIMENSION(:), ALLOCATABLE :: NUMBER_NEW_SURFACE ! number of new active surface
106 SAVE number_new_surface
107 INTEGER, DIMENSION(SURFARCE_NB) :: NEW_SURFACE ! list of new surface
108C-----------------------------------------------
109 IF(itask==-1) THEN
110 first = 1
111 last = surfarce_nb
112 my_real_task_id = 1
113 ELSE
114 first = 1 + itask * (surfarce_nb / nthread)
115 last = (itask + 1) * (surfarce_nb / nthread)
116 IF((itask+1)==nthread) last = surfarce_nb
117 my_real_task_id = itask+1
118 ENDIF
119 IF(my_real_task_id==1) THEN
120 ALLOCATE( number_saved_surface_typ24_25(nthread) )
121 ALLOCATE( number_new_surface(nthread) )
122 ENDIF
123 IF(itask/=-1) CALL my_barrier( )
124 number_inter = shift_interface(ninter+1,2)
125 number_saved_surface_typ24_25(my_real_task_id) = 0
126 number_new_surface(my_real_task_id) = 0
127 ! --------------------------
128 ! loop over the deactivated surface
129 DO i=first,last
130 k = surface_id(i) ! get the global surface id
131 id_inter = dichotomic_search_i_asc(k, shift_interface(1,1), number_inter+1) ! find the interface of the surface
132 nin = shift_interface(id_inter,2)
133 k = k - shift_interface(id_inter,1) + 1 ! get the surface id in the NIN interface
134 ity = ipari(7,nin)
135 idel = ipari(17,nin)
136 activation =.false.
137 type_inter = (ity==7.OR.ity==10.OR.ity==22.OR.ity==24.OR.(ipari(100,nin)==0.AND.ity==25))
138 ! --------------
139 IF(itask==-1) THEN
140 IF((type_inter.AND.idel==1).OR.(ipari(100,nin)/=0.AND.ity==25)) THEN
141 shoot_struct%INTER(nin)%REMOTE_ELM_M(k) = shoot_struct%INTER(nin)%REMOTE_ELM_M(k) - 1
142 ENDIF
143 ENDIF
144 ! --------------
145
146 ! --------------
147 IF(ipari(100,nin)/=0.AND.ity==25) THEN
148 shoot_struct%INTER(nin)%NB_ELM_M(k) = shoot_struct%INTER(nin)%NB_ELM_M(k) - 1
149 ENDIF
150 ! --------------
151 ! --------------
152 deactivation = .false.
153 IF((type_inter.AND.idel==1).OR.(ipari(100,nin)/=0.AND.ity==25)) THEN
154 n1 = intbuf_tab(nin)%IRECTM((k-1)*4+1)
155 n2 = intbuf_tab(nin)%IRECTM((k-1)*4+2)
156 n3 = intbuf_tab(nin)%IRECTM((k-1)*4+3)
157 n4 = intbuf_tab(nin)%IRECTM((k-1)*4+4)
158 number_node = 4
159 IF(n3==n4) number_node = 3
160 IF(shoot_struct%INTER(nin)%REMOTE_ELM_M(k)<1) THEN
161 CALL check_active_elem_edge( number_node, n1,n2,n3,n4,
162 . deactivation,geo,ixs,ixc,
163 . ixt,ixp,ixr,ixtg,ixs10,addcnel,cnel,
164 . tag_node,tag_elem)
165 ELSE
166 deactivation = .false.
167 ENDIF
168 ELSEIF(type_inter.AND.idel==2) THEN
169 deactivation = .true.
170 ENDIF
171
172 IF(.NOT.deactivation.AND.(ipari(100,nin)/=0.AND.ity==25)) THEN
173 nb_connected_elm = shoot_struct%INTER(nin)%NB_ELM_M(k)
174 ! ---------
175c IF((NB_CONNECTED_ELM<1).AND.(INTBUF_TAB(NIN)%STFM(k)>ZERO)) THEN
176c DEACTIVATION=.TRUE.
177 IF(nb_connected_elm==1.AND.(intbuf_tab(nin)%STFM(k)<zero)) THEN
178 activation = .true.
179 ENDIF
180 ! ---------
181 ENDIF
182 ! --------------
183
184 ! --------------
185 ! check if the surface is active, if yes --> deactivate it
186 IF(deactivation) THEN
187 intbuf_tab(nin)%STFM(k) = zero
188 IF(ity==24.OR.ity==25) THEN
189 number_saved_surface_typ24_25(my_real_task_id) = number_saved_surface_typ24_25(my_real_task_id) + 1
190 saved_surface_typ24_25(number_saved_surface_typ24_25(my_real_task_id)) = surface_id(i)
191 ENDIF
192 ENDIF
193 ! --------------
194
195 ! --------------
196 ! the surface was not active, need to active it
197 IF(activation) THEN
198 intbuf_tab(nin)%STFM(k) = abs(intbuf_tab(nin)%STFM(k))
199 number_new_surface(my_real_task_id) = number_new_surface(my_real_task_id) + 1
200 new_surface(number_new_surface(my_real_task_id)) = surface_id(i)
201 ENDIF
202 ! --------------
203
204 ENDDO
205 ! --------------------------
206
207 ! --------------------------
208 ! Only for interface type 24 & 25 :
209 ! need to save the surface id and send it to a remote processor
210 ! the remote processor will also deactivated the surface for a neighbourhood question
211 offset_task = shoot_struct%NUMBER_REMOTE_SURF
212 IF(itask/=-1) THEN
213 CALL my_barrier()
214 IF(itask>0) THEN
215 DO i=1,itask
216 offset_task = offset_task + number_saved_surface_typ24_25(i)
217 ENDDO
218 ENDIF
219 total_number_surface = 0
220 DO i=1,nthread
221 total_number_surface = total_number_surface + number_saved_surface_typ24_25(i)
222 ENDDO
223 ELSE
224 total_number_surface = number_saved_surface_typ24_25(my_real_task_id)
225 ENDIF
226 ! --------------------------
227 IF(total_number_surface>0) THEN
228 IF(my_real_task_id==1) THEN
229 IF( total_number_surface+shoot_struct%NUMBER_REMOTE_SURF > shoot_struct%SIZE_REMOTE_SURF) THEN
230 ALLOCATE( saved_surface(shoot_struct%NUMBER_REMOTE_SURF) )
231 saved_surface(1:shoot_struct%NUMBER_REMOTE_SURF) = shoot_struct%REMOTE_SURF(1:shoot_struct%NUMBER_REMOTE_SURF)
232 DEALLOCATE( shoot_struct%REMOTE_SURF )
233 shoot_struct%SIZE_REMOTE_SURF = total_number_surface+shoot_struct%NUMBER_REMOTE_SURF
234 ALLOCATE( shoot_struct%REMOTE_SURF(shoot_struct%SIZE_REMOTE_SURF) )
235 shoot_struct%REMOTE_SURF(1:shoot_struct%NUMBER_REMOTE_SURF) = saved_surface(1:shoot_struct%NUMBER_REMOTE_SURF)
236 DEALLOCATE( saved_surface )
237 ENDIF
238 ENDIF
239
240 IF(itask/=-1) CALL my_barrier()
241 low_bound = 1
242 up_bound = number_saved_surface_typ24_25(my_real_task_id)
243 shoot_struct%REMOTE_SURF(low_bound+offset_task:up_bound+offset_task) = saved_surface_typ24_25(low_bound:up_bound)
244 IF(itask/=-1) CALL my_barrier()
245 IF(my_real_task_id==1) shoot_struct%NUMBER_REMOTE_SURF = shoot_struct%NUMBER_REMOTE_SURF + total_number_surface
246 ENDIF
247 ! --------------------------
248
249 ! --------------------------
250 ! Only for interface type 25 :
251 ! need to save the new surface id to find the new neighbours
252 offset_task = shoot_struct%NUMBER_NEW_SURF
253 IF(itask/=-1) THEN
254 CALL my_barrier()
255 IF(itask>0) THEN
256 DO i=1,itask
257 offset_task = offset_task + number_new_surface(i)
258 ENDDO
259 ENDIF
260 total_number_new_surface = 0
261 DO i=1,nthread
262 total_number_new_surface = total_number_new_surface + number_new_surface(i)
263 ENDDO
264 ELSE
265 total_number_new_surface = number_new_surface(my_real_task_id)
266 ENDIF
267 ! --------------------------
268 IF(total_number_new_surface>0) THEN
269 IF(my_real_task_id==1) THEN
270 IF( total_number_new_surface+shoot_struct%NUMBER_NEW_SURF > shoot_struct%SIZE_NEW_SURF) THEN
271 ALLOCATE( saved_surface(shoot_struct%NUMBER_NEW_SURF) )
272 saved_surface(1:shoot_struct%NUMBER_NEW_SURF) = shoot_struct%NEW_SURF(1:shoot_struct%NUMBER_NEW_SURF)
273 DEALLOCATE( shoot_struct%NEW_SURF )
274 shoot_struct%SIZE_NEW_SURF = total_number_new_surface+shoot_struct%NUMBER_NEW_SURF
275 ALLOCATE( shoot_struct%NEW_SURF(shoot_struct%SIZE_NEW_SURF) )
276 shoot_struct%NEW_SURF(1:shoot_struct%NUMBER_NEW_SURF) = saved_surface(1:shoot_struct%NUMBER_NEW_SURF)
277 DEALLOCATE( saved_surface )
278 ENDIF
279 ENDIF
280 IF(itask/=-1) CALL my_barrier()
281 low_bound = 1
282 up_bound = number_new_surface(my_real_task_id)
283 shoot_struct%NEW_SURF(low_bound+offset_task:up_bound+offset_task) = new_surface(low_bound:up_bound)
284 IF(itask/=-1) CALL my_barrier()
285 IF(my_real_task_id==1) shoot_struct%NUMBER_NEW_SURF = shoot_struct%NUMBER_NEW_SURF + total_number_new_surface
286 ENDIF
287 ! --------------------------
288
289
290 IF(itask/=-1) CALL my_barrier( )
291
292 IF(my_real_task_id==1) THEN
293 DEALLOCATE( number_saved_surface_typ24_25 )
294 DEALLOCATE( number_new_surface )
295 ENDIF
296
297 RETURN
subroutine check_active_elem_edge(number_node, n1, n2, n3, n4, deactivation, geo, ixs, ixc, ixt, ixp, ixr, ixtg, ixs10, addcnel, cnel, tag_node, tag_elem)
#define my_real
Definition cppsort.cpp:32
integer function dichotomic_search_i_asc(val, array, len)
subroutine my_barrier
Definition machine.F:31