OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
find_edge_from_remote_proc.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!|| find_edge_from_remote_proc ../engine/source/interfaces/interf/find_edge_from_remote_proc.F
25!||--- called by ------------------------------------------------------
26!|| spmd_exch_deleted_surf_edge ../engine/source/mpi/interfaces/spmd_exch_deleted_surf_edge.F
27!||--- calls -----------------------------------------------------
28!|| check_edge_state ../engine/source/interfaces/interf/check_edge_state.F
29!||--- uses -----------------------------------------------------
30!|| intbufdef_mod ../common_source/modules/interfaces/intbufdef_mod.F90
31!|| nodal_arrays_mod ../common_source/modules/nodal_arrays.F90
32!|| shooting_node_mod ../engine/share/modules/shooting_node_mod.F
33!||====================================================================
34 SUBROUTINE find_edge_from_remote_proc(SHOOT_STRUCT,NB_EDGE,LIST_NODE,INTBUF_TAB,NODES,
35 . NEWFRONT,IPARI,GEO,
36 . IXS,IXC,IXT,IXP,IXR,IXTG,IXS10,
37 . ADDCNEL,CNEL,TAG_NODE,TAG_ELEM )
38!$COMMENT
39! FIND_EDGE_FROM_REMOTE_PROC description
40! deactivation of edges coming from remote proc
41! FIND_EDGE_FROM_REMOTE_PROC organization
42! the element associated to the edge is on a remote proc
43! the remote proc send me : "you must deactivate this edge because my element is
44! deleted"
45! local procs find the local edge/interfaces
46! local procs deactivate the edge from the interfaces
47!$ENDCOMMENT
48 USE nodal_arrays_mod
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 "com04_c.inc"
59#include "param_c.inc"
60#include "scr17_c.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 TYPE(nodal_arrays_), INTENT(inout) :: NODES
65 INTEGER, INTENT(in) :: NB_EDGE ! number of "edge" (ie. 2 nodes)
66 INTEGER, DIMENSION(2*NB_EDGE), INTENT(in) :: LIST_NODE ! list of 2 nodes
67 TYPE(shooting_node_type), INTENT(inout) :: SHOOT_STRUCT ! structure for shooting node algo
68 TYPE(intbuf_struct_), DIMENSION(NINTER), INTENT(inout) :: INTBUF_TAB ! interface data
69 INTEGER, DIMENSION(NINTER), INTENT(inout) :: NEWFRONT !< flag to force some exchanges related to S nodes between processor (if a S node becomes a shooting node - all interface) / force the collision detection algo if a new segment is activated for the (interface 25 + solid erosion)
70 INTEGER, DIMENSION(NIXS,NUMELS), INTENT(in) :: IXS ! solid array
71 INTEGER, DIMENSION(NIXC,NUMELC), INTENT(in) :: IXC ! shell array
72 INTEGER, DIMENSION(NIXT,NUMELT), INTENT(in) :: IXT! truss array
73 INTEGER, DIMENSION(NIXP,NUMELP), INTENT(in) :: IXP! beam array
74 INTEGER, DIMENSION(NIXR,NUMELR), INTENT(in) :: IXR! spring array
75 INTEGER, DIMENSION(NIXTG,NUMELTG), INTENT(in) :: IXTG! triangle array
76 INTEGER, DIMENSION(6,NUMELS10), INTENT(in) :: IXS10!< tetra10 data
77 INTEGER, DIMENSION(0:NUMNOD+1), INTENT(in) :: ADDCNEL ! address for the CNEL array
78 INTEGER, DIMENSION(NPARI,NINTER), INTENT(in) :: IPARI
79 my_real, DIMENSION(NPROPG,NUMGEO), INTENT(in) :: geo
80 INTEGER, DIMENSION(0:LCNEL), INTENT(in) :: CNEL ! connectivity node-->element
81 INTEGER, DIMENSION(NUMNOD), INTENT(inout) :: TAG_NODE
82 INTEGER, DIMENSION(NUMELS+NUMELQ+NUMELC+NUMELT+NUMELP+NUMELR+NUMELTG), INTENT(inout) :: TAG_ELEM
83C-----------------------------------------------
84C L o c a l V a r i a b l e s
85C-----------------------------------------------
86 INTEGER :: I,J,NODE_ID
87 INTEGER :: MY_SIZE
88 INTEGER :: NB_EDGE_R_PROC_M,NB_EDGE_R_PROC_S
89 INTEGER, DIMENSION(2) :: LOCAL_NODE,GLOBAL_NODE
90 INTEGER, DIMENSION(:), ALLOCATABLE :: LIST_EDGE_R_PROC
91
92 INTEGER :: SHIFT
93 INTEGER :: NB_RESULT_INTERSECT,NB_EDGE_1,NB_EDGE_2
94 INTEGER, DIMENSION(:), ALLOCATABLE :: RESULT_INTERSECT,INTERSECT_1,INTERSECT_2
95 INTEGER, DIMENSION(:), ALLOCATABLE :: TMP_ARRAY
96C-----------------------------------------------
97C E x t e r n a l F u n c t i o n s
98C-----------------------------------------------
99C-----------------------------------------------
100 ALLOCATE( list_edge_r_proc(4*nb_edge) )
101 nb_edge_r_proc_m = 0
102 nb_edge_r_proc_s = 0
103
104 ! --------------------------
105 ! working array : edge
106 ALLOCATE( result_intersect( shoot_struct%MAX_EDGE_NB ) )
107 ALLOCATE( intersect_1( shoot_struct%MAX_EDGE_NB ) )
108 ALLOCATE( intersect_2( shoot_struct%MAX_EDGE_NB ) )
109
110
111 DO i=1,nb_edge
112 global_node(1:2) = list_node( (i-1)*2+1:(i-1)*2+2)
113 DO j=1,2
114 local_node(j) = get_local_node_id(nodes,global_node(j))
115 ENDDO
116 ! ------------------
117 ! MAIN NODE
118 ! Initialization of edge/proc for the first node
119 node_id = local_node(1) ! get the node ID
120 nb_edge_1 = shoot_struct%SHIFT_M_NODE_EDGE(node_id+1) - shoot_struct%SHIFT_M_NODE_EDGE(node_id) ! get the number of edge of the node
121 shift = shoot_struct%SHIFT_M_NODE_EDGE(node_id)
122 intersect_1(1:nb_edge_1) = shoot_struct%M_NODE_EDGE( shift+1:shift+nb_edge_1 )
123 ! ------------------
124 ! Initialization of edge/proc for the second node
125 node_id = local_node(2) ! get the node ID
126 nb_edge_2 = shoot_struct%SHIFT_M_NODE_EDGE(node_id+1) - shoot_struct%SHIFT_M_NODE_EDGE(node_id) ! get the number of edge of the node
127 shift = shoot_struct%SHIFT_M_NODE_EDGE(node_id)
128 intersect_2(1:nb_edge_2) = shoot_struct%M_NODE_EDGE( shift+1:shift+nb_edge_2 )
129 ! ------------------
130
131 ! -----------------------
132 nb_result_intersect = 0
133 IF(nb_edge_1>0.AND.nb_edge_2>0) THEN
134 CALL intersect_2_sorted_sets( intersect_1,nb_edge_1,
135 . intersect_2,nb_edge_2,
136 . result_intersect,nb_result_intersect )
137 ELSE
138 nb_result_intersect = 0
139 ENDIF
140 ! end : intersection of edge : main nodes
141 ! -----------------------
142
143 IF(nb_edge_r_proc_m + nb_result_intersect > SIZE(list_edge_r_proc) ) THEN
144 ALLOCATE( tmp_array(nb_edge_r_proc_m) )
145 tmp_array(1:nb_edge_r_proc_m) = list_edge_r_proc(1:nb_edge_r_proc_m)
146 DEALLOCATE( list_edge_r_proc )
147 ALLOCATE( list_edge_r_proc( (nb_edge_r_proc_m+nb_result_intersect) * 2 ) )
148 list_edge_r_proc(1:nb_edge_r_proc_m) = tmp_array(1:nb_edge_r_proc_m)
149 ENDIF
150 list_edge_r_proc(1+nb_edge_r_proc_m:1+nb_edge_r_proc_m+nb_result_intersect) =
151 . result_intersect(1:nb_result_intersect)
152 nb_edge_r_proc_m = nb_edge_r_proc_m + nb_result_intersect
153 ENDDO
154
155
156
157 DO i=1,nb_edge
158 global_node(1:2) = list_node( (i-1)*2+1:(i-1)*2+2)
159 DO j=1,2
160 local_node(j) = get_local_node_id(nodes,global_node(j))
161 ENDDO
162 ! ------------------
163 ! SECONDARY NODE
164 ! Initialization of edge/proc for the first node
165 node_id = local_node(1) ! get the node ID
166 nb_edge_1 = shoot_struct%SHIFT_S_NODE_EDGE(node_id+1) - shoot_struct%SHIFT_S_NODE_EDGE(node_id) ! get the number of edge of the node
167 shift = shoot_struct%SHIFT_S_NODE_EDGE(node_id)
168 intersect_1(1:nb_edge_1) = shoot_struct%S_NODE_EDGE( shift+1:shift+nb_edge_1 )
169 ! ------------------
170 ! Initialization of edge/proc for the second node
171 node_id = local_node(2) ! get the node ID
172 nb_edge_2 = shoot_struct%SHIFT_S_NODE_EDGE(node_id+1) - shoot_struct%SHIFT_S_NODE_EDGE(node_id) ! get the number of edge of the node
173 shift = shoot_struct%SHIFT_S_NODE_EDGE(node_id)
174 intersect_2(1:nb_edge_2) = shoot_struct%S_NODE_EDGE( shift+1:shift+nb_edge_2 )
175 ! ------------------
176
177 ! -----------------------
178 nb_result_intersect = 0
179 IF(nb_edge_1>0.AND.nb_edge_2>0) THEN
180 CALL intersect_2_sorted_sets( intersect_1,nb_edge_1,
181 . intersect_2,nb_edge_2,
182 . result_intersect,nb_result_intersect )
183 ELSE
184 nb_result_intersect = 0
185 ENDIF
186 ! end : intersection of edge : secondary nodes
187 ! -----------------------
188 my_size = nb_edge_r_proc_s + nb_edge_r_proc_m
189 IF(my_size + nb_result_intersect > SIZE(list_edge_r_proc) ) THEN
190 ALLOCATE( tmp_array(my_size) )
191 tmp_array(1:my_size) = list_edge_r_proc(1:my_size)
192 DEALLOCATE( list_edge_r_proc )
193 ALLOCATE( list_edge_r_proc( (my_size+nb_result_intersect) * 2 ) )
194 list_edge_r_proc(1:my_size) = tmp_array(1:my_size)
195 DEALLOCATE( tmp_array )
196 ENDIF
197 list_edge_r_proc(1+my_size:my_size+nb_result_intersect) =
198 . result_intersect(1:nb_result_intersect)
199 nb_edge_r_proc_s = nb_edge_r_proc_s + nb_result_intersect
200 ENDDO
201
202 CALL check_edge_state( -1,nb_edge_r_proc_m,nb_edge_r_proc_s,
203 . list_edge_r_proc(1),list_edge_r_proc(1+nb_edge_r_proc_m),
204 . shoot_struct%SHIFT_INTERFACE,intbuf_tab,newfront,ipari,geo,
205 . ixs,ixc,ixt,ixp,ixr,ixtg,ixs10,
206 . addcnel,cnel,tag_node,tag_elem,shoot_struct )
207
208 DEALLOCATE( list_edge_r_proc )
209 DEALLOCATE( result_intersect )
210 DEALLOCATE( intersect_1 )
211 DEALLOCATE( intersect_2 )
212 RETURN
213 END SUBROUTINE find_edge_from_remote_proc
subroutine check_edge_state(itask, m_edge_nb, s_edge_nb, m_edge_id, s_edge_id, shift_interface, intbuf_tab, newfront, 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 find_edge_from_remote_proc(shoot_struct, nb_edge, list_node, intbuf_tab, nodes, newfront, ipari, geo, ixs, ixc, ixt, ixp, ixr, ixtg, ixs10, addcnel, cnel, tag_node, tag_elem)