OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
check_skew.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_skew ../starter/source/spmd/domain_decomposition/check_skew.F
25!||--- called by ------------------------------------------------------
26!|| domdec2 ../starter/source/spmd/domdec2.F
27!||--- calls -----------------------------------------------------
28!|| hm_entity_reference_number ../starter/source/devtools/hm_reader/hm_entity_reference_number.F
29!|| ifrontplus ../starter/source/spmd/node/frontplus.F
30!||--- uses -----------------------------------------------------
31!|| submodel_mod ../starter/share/modules1/submodel_mod.F
32!||====================================================================
33 SUBROUTINE check_skew(IXR,IGEO,ISKN,CEP,ISKWP,NSKWP,TAG_SKN,MULTIPLE_SKEW,
34 . R_SKEW,IPM,OFFSET)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE skew_mod
39 USE submodel_mod , ONLY : nsubmod
40 use element_mod , only : nixr
41C-----------------------------------------------
42C I m p l i c i t T y p e s
43C-----------------------------------------------
44#include "implicit_f.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "tabsiz_c.inc"
49#include "com01_c.inc"
50#include "com04_c.inc"
51#include "param_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 INTEGER, INTENT(INOUT) :: NSKWP(NSPMD),R_SKEW(NUMELR)
56 INTEGER, DIMENSION(NUMSKW+NSUBMOD+1), INTENT(INOUT) :: TAG_SKN
57 INTEGER, DIMENSION(SCEP), INTENT(IN) :: CEP
58 INTEGER, DIMENSION(NUMSKW+1), INTENT(INOUT) :: ISKWP
59 INTEGER, DIMENSION(NIXR,NUMELR), INTENT(IN) :: IXR
60 INTEGER, DIMENSION(NPROPGI,NUMGEO), INTENT(IN) :: IGEO
61 INTEGER, DIMENSION(LISKN,SISKWN/LISKN), INTENT(IN) :: ISKN
62 INTEGER, DIMENSION(NPROPMI,NUMMAT), INTENT(IN) :: IPM
63 TYPE(plist_skew_), DIMENSION(NUMSKW+1), INTENT(INOUT) :: MULTIPLE_SKEW
64 INTEGER :: OFFSET
65! -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*
66! NSKWP : integer ; dimension = NSPMD
67! number of skew per processor
68! TAG_SKN : integer ; dimension=NUMSKW+NSUBMOD+1
69! tag array --> tag the i SKEW if a SPRING uses it
70! tag array=0 --> the SKEW is not used by a SPRING
71! tag array=1 --> the SKEW is used by one SPRING
72! tag array>1 --> the SKEW is used by several SPRING
73! tag array <0 --> the SKEW is used by several options (has to be duplicated to all domains that have the nodes)
74! CEP : integer ; dimension=NUMNOD
75! gives the ID processor of the current i node
76! ISKWP : integer ; dimension=NUMSKW+1
77! gives the ID processir of the current i SKEW
78! ISKWP < 0 --> the SKEW is local on a processor
79! and we don't need to communicate the data
80! ISKWP > 0 --> the SKEW is global and the data must be
81! communicated
82! IXR : integer ; dimension=NIXR*number of SPRING
83! SPRING array
84! IGEO : integer ; dimension=NPROPGI*number of /PROP
85! PROP array
86! ISKN : integer ; dimension=LISKN*number of SKEW
87! skew array
88! MULTIPLE_SKEW : SKEW_TYPE ; dimension=NUMSKW+1
89! MULTIPLE_SKEW(I)%PLIST(:) is a list of processor
90! where the SKEW is stuck
91! OFFSET :: integer, offset to point to the good place in CEP array
92! -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*
93
94C-----------------------------------------------
95C L o c a l V a r i a b l e s
96C-----------------------------------------------
97 INTEGER :: I,J,II
98 INTEGER :: NUMBER_SKEW_SP,SPRING_TYPE
99 INTEGER :: N1,N2,N3,IMAIN,SUM_NI,SIZE_SKEW,MAT_TYPE
100 INTEGER :: NB
101 INTEGER, DIMENSION(:), ALLOCATABLE :: SKEW_PER_SP,LOCAL_P,P_SKEW
102 INTEGER, DIMENSION(NSPMD) :: PROC_SKEW
103C-----------------------------------------------
104C E x t e r n a l F u n c t i o n s
105C-----------------------------------------------
106C=======================================================================
107!$COMMENT
108! CHECK_SKEW description
109! CHECK_SKEW sticks a SKEW on a given processor in order to reduce
110! the SKEW communication in the engine.
111! A SKEW can be linked to a SPRING --> in this case, the SKEW is
112! stuck on the local SPRING processor
113! If a SKEW is used by several SPRING, the SKEW is stuck on each
114! processors that need it
115!
116! CHECK_SKEW organization :
117! - link every SPRING with theirs SKEW
118! - if several SPRING use a same SKEW, allocate MULTIPLE_SKEW(I)%PLIST
119! - stick a SKEW on a given processor, count the number of SKEW per
120! processor, initialize the MULTIPLE_SKEW(I)%PLIST array
121! - count the number of SKEW per processor in the case of multiple
122! SPRING per SKEW
123!$ENDCOMMENT
124C
125! compute adhoc size for local arrays
126 number_skew_sp = 0
127 tag_skn(1:numskw+nsubmod+1) = -1
128 nb = 0
129 DO i = 1,numskw
130 ! The optimization of restricting a skew to the domains having the corresponding spring nodes
131 ! works only for skew referenced by only one options
132 CALL hm_entity_reference_number("/SKEW",len_trim("/SKEW"),iskn(4,i+1),nb)
133 IF(nb == 1) tag_skn(i+1) = 0
134 ENDDO
135
136
137 DO i=1,numelr
138 spring_type = igeo( 11,ixr(1,i) )
139 mat_type = 0
140 IF (ixr(5,i) > 0) mat_type = ipm(2,ixr(5,i))
141C
142 IF (r_skew(i) > 1) THEN
143 IF( tag_skn(r_skew(i)) >= 0 ) THEN
144 IF(spring_type==8 .OR. (spring_type== 23 .AND. mat_type == 108)) number_skew_sp = number_skew_sp + 1
145 ENDIF
146 ENDIF
147C
148 IF (igeo(2,ixr(1,i) )>1) THEN
149 IF( tag_skn( igeo(2,ixr(1,i))) >= 0 ) THEN
150 IF(spring_type==8 .OR. spring_type==13 .OR. spring_type== 23) number_skew_sp = number_skew_sp + 1
151 ENDIF
152 ENDIF
153 ENDDO
154
155! allocation and initialization of local array
156 ALLOCATE(skew_per_sp(number_skew_sp))
157 ALLOCATE(local_p(number_skew_sp))
158
159
160
161
162 skew_per_sp(1:number_skew_sp) = 0
163 local_p(1:number_skew_sp) = 0
164 number_skew_sp = 0
165
166! link between SPRING and SKEW (only for SPRING type =8,13 or 23)
167 DO i=1,numelr
168 spring_type = igeo( 11,ixr(1,i) )
169 mat_type = 0
170 IF (ixr(5,i) > 0) mat_type = ipm(2,ixr(5,i))
171C
172 IF (r_skew(i) > 1) THEN
173 IF( tag_skn(r_skew(i)) >= 0) THEN
174 IF(spring_type==8 .OR. (spring_type== 23 .AND. mat_type == 108)) THEN
175 number_skew_sp = number_skew_sp + 1
176 skew_per_sp( number_skew_sp ) = r_skew(i)
177 local_p(number_skew_sp) = cep(offset+i)+1
178 tag_skn( r_skew(i) ) = tag_skn( r_skew(i) ) + 1
179 ENDIF
180 ENDIF
181 ENDIF
182C
183 IF (igeo( 2,ixr(1,i) )>1) THEN
184 IF( tag_skn(igeo(2,ixr(1,i))) >=0 ) THEN
185 IF(spring_type==8 .OR. spring_type==13 .OR. spring_type== 23) THEN
186 number_skew_sp = number_skew_sp + 1
187 skew_per_sp( number_skew_sp ) = igeo( 2,ixr(1,i) )
188 local_p(number_skew_sp) = cep(offset+i)+1
189 tag_skn( igeo(2,ixr(1,i)) ) = tag_skn( igeo(2,ixr(1,i)) ) + 1
190 ENDIF
191 ENDIF
192 ENDIF
193 ENDDO
194
195! allocation of MULTIPLE_SKEW
196 DO i=1,numskw+1
197 size_skew = tag_skn(i)
198 IF(size_skew>1) THEN
199 IF(.NOT.ALLOCATED(multiple_skew(i)%PLIST)) ALLOCATE( multiple_skew(i)%PLIST(size_skew) )
200 multiple_skew(i)%PLIST(1:size_skew) = 0
201 ENDIF
202 ENDDO
203
204 ALLOCATE(p_skew(numskw+1))
205 p_skew(1:numskw+1) = 0
206
207! stick a SKEW on a given processor
208 DO j=1,number_skew_sp
209 i = skew_per_sp(j)
210 imain = local_p(j)
211 n1=iskn(1,i)
212 n2=iskn(2,i)
213 n3=iskn(3,i)
214 sum_ni = n1+n2+n3
215 IF(sum_ni/=0) THEN
216
217 CALL ifrontplus(n1,imain)
218 CALL ifrontplus(n2,imain)
219 CALL ifrontplus(n3,imain)
220 IF(iskwp(i)==0) iskwp(i) = -imain
221 IF(tag_skn(i)>1) THEN
222 p_skew(i) = p_skew(i) + 1
223 multiple_skew(i)%PLIST(p_skew(i)) = imain
224 ELSE
225 nskwp(imain) = nskwp(imain) + 1
226 ENDIF
227 ENDIF
228 ENDDO
229
230! count and add the number of SKEW per processor in the case of multiple SPRING per SKEW
231 DO i=1,numskw+1
232 size_skew = tag_skn(i)
233 IF(size_skew>1) THEN
234 proc_skew(1:nspmd) = 0
235 DO ii=1,size_skew
236 imain = multiple_skew(i)%PLIST(ii)
237 IF(imain>0) proc_skew(imain) = proc_skew(imain) + 1
238 ENDDO
239 DO ii=1,nspmd
240 IF(proc_skew(ii)>0) nskwp(ii) = nskwp(ii) + 1
241 ENDDO
242 ENDIF
243 ENDDO
244
245! deallocation of local arrais
246 DEALLOCATE(skew_per_sp,local_p)
247 DEALLOCATE(p_skew)
248
249 RETURN
250 END SUBROUTINE check_skew
subroutine check_skew(ixr, igeo, iskn, cep, iskwp, nskwp, tag_skn, multiple_skew, r_skew, ipm, offset)
Definition check_skew.F:35
subroutine ifrontplus(n, p)
Definition frontplus.F:101
subroutine hm_entity_reference_number(name, sname, id, ref_number)
integer nsubmod