OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
inter_sorting_mod.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!|| inter_sorting_mod ../engine/share/modules/inter_sorting_mod.F
25!||--- called by ------------------------------------------------------
26!|| check_coarse_grid ../engine/source/interfaces/generic/check_coarse_grid.F
27!|| i7main_tri ../engine/source/interfaces/intsort/i7main_tri.F
28!|| inter_box_creation ../engine/source/interfaces/generic/inter_box_creation.F
29!|| inter_cell_color ../engine/source/interfaces/generic/inter_cell_color.F
30!|| inter_color_coarse_voxel ../engine/source/interfaces/generic/inter_color_coarse_voxel.F
31!|| inter_color_voxel ../engine/source/interfaces/generic/inter_color_voxel.F
32!|| inter_component_bound ../engine/source/interfaces/generic/inter_component_bound.F90
33!|| inter_count_node_curv ../engine/source/interfaces/generic/inter_count_node_curv.F
34!|| inter_deallocate_wait ../engine/source/interfaces/generic/inter_deallocate_wait.F
35!|| inter_init_component ../engine/source/interfaces/generic/inter_init_component.F90
36!|| inter_init_component_list ../engine/source/interfaces/generic/inter_init_component_list.F90
37!|| inter_prepare_sort ../engine/source/interfaces/generic/inter_prepare_sort.F
38!|| inter_sort ../engine/source/interfaces/generic/inter_sort.F
39!|| inter_sort_07 ../engine/source/interfaces/int07/inter_sort_07.F
40!|| inter_struct_init ../engine/source/interfaces/generic/inter_struct_init.F
41!|| inter_voxel_creation ../engine/source/interfaces/generic/inter_voxel_creation.F
42!|| inttri ../engine/source/interfaces/intsort/inttri.F
43!|| mpp_init ../engine/source/mpi/interfaces/spmd_i7tool.F
44!|| resol ../engine/source/engine/resol.F
45!|| resol_init ../engine/source/engine/resol_init.F
46!|| spmd_cell_exchange ../engine/source/mpi/generic/spmd_cell_exchange.F
47!|| spmd_cell_list_exchange ../engine/source/mpi/interfaces/spmd_cell_list_exchange.F
48!|| spmd_cell_size_exchange ../engine/source/mpi/interfaces/spmd_cell_size_exchange.F
49!|| spmd_cell_size_exchange_init ../engine/source/mpi/interfaces/spmd_cell_size_exchange_init.F
50!|| spmd_cell_size_post_rcv ../engine/source/mpi/interfaces/spmd_cell_size_post_rcv.F
51!|| spmd_coarse_cell_exchange ../engine/source/mpi/interfaces/spmd_coarse_cell_exchange.F
52!|| spmd_exchange_component ../engine/source/mpi/interfaces/spmd_exch_component.F90
53!|| spmd_get_inacti_global ../engine/source/mpi/interfaces/spmd_get_inacti_global.F
54!|| spmd_split_comm_inter ../engine/source/mpi/interfaces/spmd_split_comm_inter.F
55!|| spmd_wait_nb ../engine/source/mpi/interfaces/spmd_wait_nb.F
56!||====================================================================
58#include "my_real.inc"
59! -------------------------
60 LOGICAL :: need_comm_inacti ! flag : true if inacti comm is mandatory
61 INTEGER :: nb_inter_inacti ! number of interface with inacti > 0
62 INTEGER :: need_to_sort ! flag : 1 if 1 or several interfaces must be sorted
63 INTEGER :: nb_inter_7_inacti ! number of interface 7 with inacti /= 0
64 INTEGER, DIMENSION(:), ALLOCATABLE :: list_inter_7_inacti ! list of interface 7 with inacti /= 0
65
66 INTEGER :: comm_inacti ! sub-communicator for INACTI mpi comm
67 INTEGER :: request_inacti ! request for inacti communication
68
69 my_real, DIMENSION(6) :: box_limit ! min & max positions of the grid
70 INTEGER, PARAMETER :: nb_box_coarse_grid=8
71 INTEGER, PARAMETER :: nb_box_limit=128
72 INTEGER :: nb_cell_x,nb_cell_y,nb_cell_z ! number of cell of the global voxel
73
74 INTEGER, DIMENSION(:), ALLOCATABLE :: local_coarse_grid
75
76 LOGICAL :: coarse_grid
77 INTEGER, DIMENSION(:), ALLOCATABLE :: nb_local_cell
78 LOGICAL, DIMENSION(:,:,:), ALLOCATABLE :: cell_bool
79
80 INTEGER :: remote_s_node ! number of real remote secondary nodes
81 INTEGER, DIMENSION(:), ALLOCATABLE :: list_remote_s_node ! list of real remote secondary nodes
82
83
84 ! ---------------------
86 ! buffer for communication of position/velocity
87 INTEGER, DIMENSION(:), ALLOCATABLE :: ibuf
88 my_real, DIMENSION(:), ALLOCATABLE :: rbuf
89 END TYPE buffer_comm_type
90 ! ---------------------
92 INTEGER :: comm ! sub communicator for communication
93 ! -----------------------------
94 ! COARSE CELL data
95 INTEGER :: proc_number ! number of processor for the interface NIN
96 INTEGER, DIMENSION(:), ALLOCATABLE :: proc_list ! list of processor for interface NIN
97 INTEGER, DIMENSION(:), ALLOCATABLE :: send_size_coarse_cell ! number of cell S
98 INTEGER, DIMENSION(:), ALLOCATABLE :: rcv_size_coarse_cell ! number of cell r
99 INTEGER, DIMENSION(:), ALLOCATABLE :: send_displs_coarse_cell ! displacement for S
100 INTEGER, DIMENSION(:), ALLOCATABLE :: rcv_displs_coarse_cell ! displacement for R
101 INTEGER, DIMENSION(:), ALLOCATABLE :: coarse_grid ! list of local cell colored by secondary nodes S (S --> R) : size = NB_BOX_COARSE_GRID**3 + 1
102 INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: main_coarse_grid ! list of cell colored by main node
103 INTEGER :: size_global_coarse_cell ! total number of cell
104 INTEGER, DIMENSION(:), ALLOCATABLE :: global_coarse_cell ! list of remote cell colored by secondary nodes R : size = nspmd x (NB_BOX_COARSE_GRID**3 + 1)
105
106 LOGICAL, DIMENSION(:), ALLOCATABLE :: keep_proc ! boolean, true if current proc and P proc need to communicate
107 ! -----------------------------
108 ! FINE CELL data
109 INTEGER, DIMENSION(2) :: size_cell_list ! 1 = total number of cell ; 2 = always 0 for mpi communication
110! INTEGER, DIMENSION(:,:), ALLOCATABLE :: CELL_LIST ! list of local cell (size = (total number of cell,3) )
111 INTEGER, DIMENSION(:), ALLOCATABLE :: cell_list ! list of local cell (size = (total number of cell,3) )
112
113 ! -----------------------------
114 ! exchange of number of cell (fine grid) : mode = 1
115 INTEGER, DIMENSION(:), ALLOCATABLE :: nb_cell_proc ! number of cell on the other processor (size= number of proc on a given interface)
116 INTEGER, DIMENSION(:), ALLOCATABLE :: send_nb_cell ! number of sent data for fine grid comm (mode=1)
117 INTEGER, DIMENSION(:), ALLOCATABLE :: rcv_nb_cell ! number of rcv data for fine grid comm (mode=1)
118 INTEGER, DIMENSION(:), ALLOCATABLE :: send_displs_nb_cell ! displacement for send
119 INTEGER, DIMENSION(:), ALLOCATABLE :: rcv_displs_nb_cell ! displacement for recv
120
121 integer :: request_s_nb
122 integer :: request_r_nb
123 integer, dimension(:), allocatable :: request_s
124 integer, dimension(:), allocatable :: request_r,index_r
125
126 ! -----------------------------
127 ! exchange of cell (fine grid) : mode = 2
128 INTEGER :: request_nb_cell ! request for cell size exchange
129 INTEGER, DIMENSION(:), ALLOCATABLE :: send_size_cell ! number of sent data for fine grid comm (mode=1)
130 INTEGER, DIMENSION(:), ALLOCATABLE :: rcv_size_cell ! number of rcv data for fine grid comm (mode=1)
131 INTEGER, DIMENSION(:), ALLOCATABLE :: send_displs_cell ! displacement for send
132 INTEGER, DIMENSION(:), ALLOCATABLE :: rcv_displs_cell ! displacement for recv
133 INTEGER, DIMENSION(:), ALLOCATABLE :: cell ! list of remote cells
134
135 ! -----------------------------
136 ! wait the comm "exchange of cell -- mode=2" + send/rcv of secondary nodes (fine grid) : mode = 3
137 INTEGER :: rsiz ! size of real buffer
138 INTEGER :: isiz ! size of int buffer
139 INTEGER, DIMENSION(:), ALLOCATABLE :: request_nb_s ! request for S : number of secondary node comm
140 INTEGER, DIMENSION(:), ALLOCATABLE :: request_nb_r ! request for S : number of secondary node comm
141 INTEGER, DIMENSION(:), ALLOCATABLE :: nb ! number of secondary node for each processor
142 INTEGER, DIMENSION(:), ALLOCATABLE :: index_rcv ! index of processor
143 INTEGER :: nbsend_nb ! number of send comm "exchange of secondary node number"
144 INTEGER :: nbrecv_nb ! number of rcv comm "exchange of secondary node number"
145 INTEGER, DIMENSION(:), ALLOCATABLE :: send_nb ! index of send comm "exchange of secondary node number"
146 INTEGER, DIMENSION(:), ALLOCATABLE :: recv_nb ! index of rcv comm "exchange of secondary node number"
147
148 INTEGER :: nb_request_cell_send ! number of request S "exchange of cell"
149 INTEGER :: nb_request_cell_rcv ! number of request R "exchange of cell"
150 INTEGER, DIMENSION(:), ALLOCATABLE :: request_cell_send ! list of request S "exchange of cell"
151 INTEGER, DIMENSION(:), ALLOCATABLE :: request_cell_rcv ! list of request R "exchange of cell"
152 type(buffer_comm_type), DIMENSION(:), ALLOCATABLE :: data_proc
153 ! -----------------------------
154 INTEGER :: nbirecv ! number of rcv comm
155 INTEGER :: nsnr ! total number of remote secondary nodes
156 INTEGER, DIMENSION(:), ALLOCATABLE :: isindexi ! index of processor
157 ! -----------------------------
158 ! VOXEL of secondary nodes
159 INTEGER, DIMENSION(:), ALLOCATABLE :: iix,iiy,iiz ! index in the x/y/z direction
160 INTEGER, DIMENSION(:), ALLOCATABLE :: last_nod ! adress of the last node in the VOXEL
161 INTEGER, DIMENSION(:), ALLOCATABLE :: next_nod ! adress of the next node in the VOXEL
162 INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: voxel ! voxel of secondary nodes
163 ! -----------------------------
164 ! Communication of secondary nodes :
165 INTEGER, DIMENSION(:), ALLOCATABLE :: req_sd2 ! request for Send : XREM comm
166 INTEGER, DIMENSION(:), ALLOCATABLE :: req_sd3 ! request for Send : IREM comm
167 ! -----------------------------
168 END TYPE sorting_comm_type
169
170
172 integer :: node_nb
173 integer, dimension(:), allocatable :: node
174 my_real, dimension(:), allocatable :: bound
175 end type s_list_
177 integer :: node_nb
178 integer, dimension(:), allocatable :: node
179 integer, dimension(:), allocatable :: seg
180 my_real, dimension(:), allocatable :: bound
181 end type m_list_
182
184 logical :: need_comm0
185 logical :: need_comm_s
186 logical :: need_comm_r
187 integer :: remote_m_comp_nb
188 my_real, dimension(:,:), allocatable :: remote_m_comp
189 integer :: remote_s_comp_nb
190 my_real, dimension(:,:), allocatable :: remote_s_comp
191 my_real, dimension(:), allocatable :: remote_comp
192 end type proc_comp_
194 integer :: s_comp_nb
195 integer :: m_comp_nb
196 integer :: total_m_remote_comp_nb
197 integer :: total_s_remote_comp_nb
198 integer :: request_s_nb
199 integer :: request_r_nb
200 integer, dimension(:), allocatable :: request_s
201 integer, dimension(:), allocatable :: request_r
202 integer, dimension(:), allocatable :: index_r
203 my_real, dimension(:), allocatable :: s_buffer_comp
204 type(s_list_), dimension(:), allocatable :: s_list
205 type(m_list_), dimension(:), allocatable :: m_list
206 type(proc_comp_), dimension(:), allocatable :: proc_comp
207 end type component_
208
209! -------------------------
210 END MODULE inter_sorting_mod
211
212
213
#define my_real
Definition cppsort.cpp:32
integer, dimension(:), allocatable nb_local_cell
integer, dimension(:), allocatable list_remote_s_node
logical, dimension(:,:,:), allocatable cell_bool
integer, parameter nb_box_limit
integer, dimension(:), allocatable list_inter_7_inacti
integer, parameter nb_box_coarse_grid
integer, dimension(:), allocatable local_coarse_grid