OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
check_surface_state.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!|| check_surface_state ../engine/source/interfaces/interf/check_surface_state.F
25!||--- called by ------------------------------------------------------
26!|| find_surface_from_remote_proc ../engine/source/interfaces/interf/find_surface_from_remote_proc.F
27!|| resol ../engine/source/engine/resol.f
28!||--- calls -----------------------------------------------------
29!|| check_active_elem_edge ../engine/source/interfaces/interf/check_active_elem_edge.F
30!|| my_barrier ../engine/source/system/machine.F
31!||--- uses -----------------------------------------------------
32!|| intbufdef_mod ../common_source/modules/interfaces/intbufdef_mod.F90
33!|| shooting_node_mod ../engine/share/modules/shooting_node_mod.F
34!||====================================================================
35 SUBROUTINE check_surface_state( ITASK,SURFARCE_NB,SURFACE_ID,SHIFT_INTERFACE,INTBUF_TAB,
36 . IPARI,GEO,
37 . IXS,IXC,IXT,IXP,IXR,IXTG,IXS10,
38 . ADDCNEL,CNEL,TAG_NODE,TAG_ELEM,SHOOT_STRUCT )
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
298 END SUBROUTINE check_surface_state
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)
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)
#define my_real
Definition cppsort.cpp:32
subroutine resol(timers, element, nodes, coupling, af, iaf, iskwn, neth, ipart, nom_opt, kxx, ixx, ixtg, ixs, ixq, ixt, ixp, ixr, ifill, mat_elem, ims, npc, ibcl, ibfv, idum, las, laccelm, nnlink, lnlink, iparg, dd_iad, igrv, iexlnk, kinet, ipari, nprw, iconx, npby, lpby, lrivet, nstrf, ljoint, nodpor, monvol, ilink, llink, linale, neflsw, nnflsw, icut, cluster, itask, inoise, thke, damp, pm, skews, geo, eani, bufmat, bufgeo, bufsf, w, veul, fill, dfill, alph, wb, dsave, asave, msnf, tf, forc, vel, fsav, fzero, xlas, accelm, agrv, fr_wave, failwave, parts0, elbuf, rwbuf, sensors, rwsav, rby, rivet, secbuf, volmon, lambda, wa, fv, partsav, uwa, val2, phi, segvar, r, crflsw, flsw, fani, xcut, anin, tani, secfcum, bufnois, idata, rdata, iframe, kxsp, ixsp, nod2sp, ispsym, ispcond, xframe, spbuf, xspsym, vspsym, pv, fsavd, ibvel, lbvel, wasph, w16, isphio, lprtsph, lonfsph, vsphio, fbvel, lagbuf, ibcslag, iactiv, dampr, gjbufi, gjbufr, rbmpc, ibmpc, sphveln, nbrcvois, nbsdvois, lnrcvois, lnsdvois, nercvois, nesdvois, lercvois, lesdvois, npsegcom, lsegcom, nporgeo, ixtg1, npbyl, lpbyl, rbyl, igeo, ipm, madprt, madsh4, madsh3, madsol, madnod, madfail, iad_rby, fr_rby, fr_wall, iad_rby2, fr_rby2, iad_i2m, fr_i2m, addcni2, procni2, iadi2, fr_mv, iadmv2, fr_ll, fr_rl, iadcj, fr_cj, fr_sec, iad_sec, iad_cut, fr_cut, rg_cut, newfront, fr_mad, fxbipm, fxbrpm, fxbnod, fxbmod, fxbglm, fxbcpm, fxbcps, fxblm, fxbfls, fxbdls, fxbdep, fxbvit, fxbacc, fxbelm, fxbsig, fxbgrvi, fxbgrvr, eigipm, eigibuf, eigrpm, lnodpor, fr_i18, graphe, iflow, rflow, lgrav, dd_r2r, fasolfr, fr_lagf, llagf, lprw, icontact, rcontact, sh4tree, sh3tree, ipadmesh, padmesh, msc, mstg, inc, intg, ptg, iskwp, nskwp, isensp, nsensp, iaccp, naccp, ipart_state, acontact, pcontact, factiv, sh4trim, sh3trim, mscnd, incnd, ibfflux, fbfflux, rbym, irbym, lnrbym, icodrbym, ibcv, fconv, ibftemp, fbftemp, iad_rbym, fr_rbym, weight_rm, ms_ply, zi_ply, inod_pxfem, iel_pxfem, iadc_pxfem, adsky_pxfem, icode_ply, icodt_ply, iskew_ply, admsms, madclnod, nom_sect, mcpc, mcptg, dmelc, dmeltg, mssa, dmels, mstr, dmeltr, msp, dmelp, msrt, dmelrt, ibcr, fradia, res_sms, table, irbe2, lrbe2, iad_rbe2, fr_rbe2, phie, msf, procne_pxfem, iadsdp_pxfem, iadrcp_pxfem, icfield, lcfield, cfield, msz2, diag_sms, iloadp, lloadp, loadp, inod_crk, iel_crk, iadc_crk, adsky_crk, cne_crk, procne_crk, iadsdp_crk, iadrcp_crk, ibufssg_io, ibc_ply, dmint2, ibordnode, elbuf_tab, por, nodedge, iad_edge, fr_edge, fr_nbedge, crknodiad, lgauge, gauge, igaup, ngaup, nodlevxf, dd_r2r_elem, nodglobxfe, sph2sol, sol2sph, irst, dmsph, wagap, xfem_tab, elcutc, nodenr, kxfenod2elc, enrtag, rthbu f, kxig3d, ixig3d, knot, wige, wsmcomp, stack, cputime_mp_glob, cputime_mp, tab_ump, poin_ump, sol2sph_typ, irunn_bis, addcsrect, iad_frnor, fr_nor, procnor, iad_fredg, fr_edg, drape_sh4n, drape_sh3n, tab_mat, nativ0_sms, multi_fvm, segquadfr, ms_2d, h3d_data, subsets, igrnod, igrbric, igrquad, igrsh4n, igrsh3n, igrtruss, igrbeam, igrspring, igrpart, igrsurf, forneqs, nloc_dmg, iskwp_l, knotlocpc, knotlocel, pinch_data, tag_skins6, ale_connectivity, xcell, xface, ne_nercvois, ne_nesdvois, ne_lercvois, ne_lesdvois, ibcscyc, lbcscyc, t_monvol, id_global_vois, face_vois, dynain_data, fcont_max, ebcs_tab, diffusion, kloadpinter, loadpinter, dgaploadint, drapeg, user_windows, output, interfaces, dt, loads, python, dpl0cld, vel0cld, ndamp_vrel, id_damp_vrel, fr_damp_vrel, ndamp_vrel_rbyg, names_and_titles, unitab, liflow, lrflow, glob_therm, pblast, rbe3)
Definition resol.F:633
subroutine my_barrier
Definition machine.F:31