OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
alelin.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!|| alelin ../engine/source/ale/grid/alelin.F
25!||--- called by ------------------------------------------------------
26!|| alewdx ../engine/source/ale/grid/alewdx.F
27!||--- calls -----------------------------------------------------
28!|| spmd_glob_dsum9 ../engine/source/mpi/interfaces/spmd_th.F
29!|| spmd_rbcast ../engine/source/mpi/generic/spmd_rbcast.F
30!||--- uses -----------------------------------------------------
31!|| groupdef_mod ../common_source/modules/groupdef_mod.F
32!||====================================================================
33 SUBROUTINE alelin(NALELK ,LINALE ,W ,WEIGHT ,IGRNOD)
34C-----------------------------------------------
35C M o d u l e s
36C-----------------------------------------------
37 USE groupdef_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41#include "implicit_f.inc"
42C-----------------------------------------------
43C G l o b a l P a r a m e t e r s
44C-----------------------------------------------
45#include "com01_c.inc"
46#include "com04_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER,INTENT(IN) :: NALELK
51 INTEGER,INTENT(IN) :: LINALE(*), WEIGHT(*)
52 my_real, INTENT(INOUT) :: w(3,numnod)
53 TYPE (GROUP_) , DIMENSION(NGRNOD) :: IGRNOD
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57 INTEGER :: ID(3), K, JJ, M1, M2, N, IC, IM, N1, J, I, NI, GR_ID
58 INTEGER :: uID, II
59 my_real :: ww, wm1m2(6)
60C-----------------------------------------------
61C D e s c r i p t i o n
62C-----------------------------------------------
63C
64C This subroutines is handling links on grid velocities.
65C It can be defined using /ALE/LINK/VEL
66C /VEL/ALE
67C
68C NALELK : number of ALE LINKS
69C LINALE[:] : definition array
70C [1] : user ID (uID)
71C [2] : main node (M1)
72C [3] : main node (M2)
73C [4] : number of nodes (N)
74C [5] : direction XYZ (IC)
75C [6] : formulation (IM)
76C
77C |ALE LINK 1 |2 |NALELK
78C +----+----+----+----+----+----+----+----+----+...-+----+----+----+--...+----+----+--...
79C LINALE |uID | M1 | M2 | N | IC | IM |id1 |id2 |id3 |... |idn | ... |
80C +----+----+----+----+----+----+----+----+----+...-+----+----+----+--...+----+----+--...
81C (1:SLINALE) 1 2 3 4 5 6 6+1 6+N
82C +LLINAL |
83C (N=1 if grnod_id is used)
84C
85C First subarrays are used to define ale links from starter (1:SLINALE). Engine links are in (SLINALE+1:SLINALE+LLINAL)
86C Only Starter part is written in restart files.
87C
88C-----------------------------------------------
89C P r e - C o n d i t i o n s
90C-----------------------------------------------
91C
92C None : NALELK=0 => Nothing is done.
93C
94C-----------------------------------------------
95C S o u r c e L i n e s
96C-----------------------------------------------
97
98 k=0
99 n=0
100 gr_id = -huge(gr_id)
101 DO jj=1,nalelk
102
103 wm1m2(1) = zero
104 wm1m2(2) = zero
105 wm1m2(3) = zero
106 wm1m2(4) = zero
107 wm1m2(5) = zero
108 wm1m2(6) = zero
109 k = k+iabs(n)+6
110 uid = linale(k-5)
111 m1 = linale(k-4)
112 m2 = linale(k-3)
113 n = linale(k-2)
114
115 IF(uid<0)cycle !OFF
116 IF(m1 > 0)THEN ! test if node is on current domain
117 IF(weight(m1) == 1)THEN
118 wm1m2(1) = w(1,m1)
119 wm1m2(2) = w(2,m1)
120 wm1m2(3) = w(3,m1)
121 END IF
122 END IF
123
124 IF(m2 > 0)THEN ! test if node is on current domain
125 IF(weight(m2) == 1)THEN
126 wm1m2(4) = w(1,m2)
127 wm1m2(5) = w(2,m2)
128 wm1m2(6) = w(3,m2)
129 END IF
130 END IF
131
132 IF(nspmd > 1) THEN
133 ! Exchange in order to manage the alelink hierarchy
134 CALL spmd_glob_dsum9(wm1m2,6)
135 CALL spmd_rbcast(wm1m2,wm1m2,1,6,0,2)
136 END IF
137
138 ic=linale(k-1)
139 im=linale(k)
140 id(1)=ic/4
141 ic=ic-4*id(1)
142 id(2)=ic/2
143 id(3)=ic-2*id(2)
144
145 IF(n>0)THEN
146 n1=n+1
147 ELSE
148 gr_id=linale(k+1)
149 n1=igrnod(gr_id)%NENTITY+1
150 n=1!IABS(N)
151 ENDIF
152
153 DO j=1,3
154 IF(id(j) /= 0) THEN
155 IF(im == 0) THEN
156 IF(linale(k-2)>0)THEN !---NODE LIST IF NUMNOD>0
157 DO i=1,n
158 ni=linale(k+i)
159 IF(ni > 0)THEN ! test if node is on current domain
160 w(j,ni)=wm1m2(j)+(wm1m2(3+j)-wm1m2(j))*i/n1
161 ENDIF
162 ENDDO
163 ELSE !---GRNOD IF NUMNOD =-1
164 ii=0
165 DO i=1,igrnod(gr_id)%NENTITY
166 ni=igrnod(gr_id)%ENTITY(i)
167 ii=ii+1
168 w(j,ni)=wm1m2(j)+(wm1m2(3+j)-wm1m2(j))*ii/n1
169 ENDDO
170 endif!(LINALE(K-2)>0)
171
172 ELSE
173
174 IF(im*abs(wm1m2(j)) > im*abs(wm1m2(3+j)))THEN
175 ww=wm1m2(j)
176 ELSE
177 ww=wm1m2(3+j)
178 ENDIF
179
180 IF(linale(k-2)>0)THEN !---NODE LIST IF NUMNOD>0
181 DO i=1,n
182 ni=linale(k+i)
183 IF(ni > 0)THEN ! test if node is on current domain
184 w(j,ni)=ww
185 ENDIF
186 ENDDO
187 ELSE !---GRNOD IF NUMNOD =-1
188 gr_id=linale(k+1)
189 DO i=1,igrnod(gr_id)%NENTITY
190 ni=igrnod(gr_id)%ENTITY(i)
191 w(j,ni)=ww
192 ENDDO
193 endif!(LINALE(K-2)>0)
194
195 endif!(IM == 0)
196 endif!(ID(J) /= 0)
197 ENDDO !next J
198 ENDDO
199C-----------------------------------------------
200 RETURN
201 END
subroutine alelin(nalelk, linale, w, weight, igrnod)
Definition alelin.F:34
#define my_real
Definition cppsort.cpp:32
subroutine spmd_rbcast(tabi, tabr, n1, n2, from, add)
Definition spmd_rbcast.F:62
subroutine spmd_glob_dsum9(v, len)
Definition spmd_th.F:380