OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
check_coarse_grid.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_coarse_grid ../engine/source/interfaces/generic/check_coarse_grid.F
25!||--- called by ------------------------------------------------------
26!|| spmd_coarse_cell_exchange ../engine/source/mpi/interfaces/spmd_coarse_cell_exchange.F
27!||--- uses -----------------------------------------------------
28!|| inter_sorting_mod ../engine/share/modules/inter_sorting_mod.F
29!||====================================================================
30 SUBROUTINE check_coarse_grid(NIN,MAIN_COARSE_GRID,SORT_COMM,ITIED)
31!$COMMENT
32! CHECK_COARSE_GRID description :
33! for a given interface, check if the correct processor needs to communicate with a remote processor
34!
35! CHECK_COARSE_GRID organization :
36! loop over the processor P and :
37! * if P and the current processor ISPMD colored a common cell --> ISPMD and P need to communicate
38! * if P and the current processor ISPMD did not colored a common cell --> ISPMD and P don't need to communicate
39!$ENDCOMMENT
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48#include "comlock.inc"
49C-----------------------------------------------
50C C o m m o n B l o c k s
51C-----------------------------------------------
52#include "com04_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER, INTENT(in) :: NIN
57 INTEGER, INTENT(in) :: ITIED
58 INTEGER, DIMENSION(NB_BOX_COARSE_GRID**3), INTENT(in) :: MAIN_COARSE_GRID
59 TYPE(sorting_comm_type), DIMENSION(NINTER), INTENT(inout) :: SORT_COMM ! structure for interface sorting comm
60C-----------------------------------------------
61C L o c a l V a r i a b l e s
62C-----------------------------------------------
63 LOGICAL :: KEEP_THIS_PROC,BREAK_
64 INTEGER :: I,J,IJK
65 INTEGER :: ID_PROC,DISPL
66! ----------------------------------------
67
68 ! allocatio of KEEP_PROC : true if need to send/rcv to proc P
69 IF(.NOT.ALLOCATED(sort_comm(nin)%KEEP_PROC)) THEN
70 ALLOCATE(sort_comm(nin)%KEEP_PROC(sort_comm(nin)%PROC_NUMBER) )
71 ENDIF
72 ! loop over the processor of the interface : keep P if at least 1 common cell between P and current proc
73 DO i=1,sort_comm(nin)%PROC_NUMBER
74 id_proc = sort_comm(nin)%PROC_LIST(i)
75 displ = sort_comm(nin)%RCV_DISPLS_COARSE_CELL(i)
76 sort_comm(nin)%KEEP_PROC(i) = .false.
77 keep_this_proc = .false.
78 break_ = .false.
79 j = 1
80 ! no cell from P --> keep = false
81 IF(sort_comm(nin)%RCV_SIZE_COARSE_CELL(i)==0) break_ = .true.
82
83 IF(.NOT.break_) THEN
84 IF(sort_comm(nin)%GLOBAL_COARSE_CELL(displ+nb_box_coarse_grid**3+1)==0) break_ = .true.
85 ENDIF
86
87 IF(.NOT.break_) THEN
88 ! loop voer the cell of P and check if 1 common cell
89 DO j=1,sort_comm(nin)%GLOBAL_COARSE_CELL(displ+nb_box_coarse_grid**3+1)
90 ijk = sort_comm(nin)%GLOBAL_COARSE_CELL(displ+j)
91 IF(main_coarse_grid(ijk)==1) keep_this_proc = .true.
92 ENDDO
93 ENDIF
94 IF(itied/=0) keep_this_proc=.true.
95 IF(keep_this_proc) sort_comm(nin)%KEEP_PROC(i) = .true.
96 ENDDO
97 ! ------------------
98 RETURN
99 END SUBROUTINE check_coarse_grid
subroutine check_coarse_grid(nin, main_coarse_grid, sort_comm, itied)
integer, parameter nb_box_coarse_grid