OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
alew6.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!|| alew6 ../engine/source/ale/grid/alew6.F
25!||--- called by ------------------------------------------------------
26!|| alewdx ../engine/source/ale/grid/alewdx.F
27!||--- calls -----------------------------------------------------
28!|| centroid2 ../engine/source/multifluid/centroid.F
29!|| centroid3 ../engine/source/multifluid/centroid.F
30!|| centroid3t ../engine/source/multifluid/centroid.F
31!|| my_barrier ../engine/source/system/machine.F
32!|| spmd_e1vois ../engine/source/mpi/fluid/spmd_cfd.F
33!|| spmd_envois ../engine/source/mpi/fluid/spmd_cfd.F
34!||--- uses -----------------------------------------------------
35!|| ale_connectivity_mod ../common_source/modules/ale/ale_connectivity_mod.F
36!|| elbufdef_mod ../common_source/modules/mat_elem/elbufdef_mod.F90
37!|| element_mod ../common_source/modules/elements/element_mod.F90
38!||====================================================================
39 SUBROUTINE alew6(
40 1 X , V ,W ,WA ,
41 . XCELL ,XFACE ,
42 2 ALE_NE_CONNECT,NALE ,NODFT ,NODLT ,ITASK ,
43 3 NERCVOIS, NESDVOIS, LERCVOIS, LESDVOIS,
44 4 ELBUF_TAB ,IPARG ,IXS ,IXQ)
45C-----------------------------------------------
46C D e s c r i p t i o n
47C-----------------------------------------------
48C VOLUME GRID SMOOTHING
49C Compute Grid for /ALE/GRID/VOLUME
50C
51C X,D,V are allocated to SX,SD,DV=3*(NUMNOD_L+NUMVVOIS_L)
52C in grid subroutine it may needed to access nodes which
53C are connected to a remote elem. They are sored in X(1:3,NUMNOD+1:)
54C Consequently X is defined here X(3,SX/3) instead of X(3,NUMNOD) as usually
55C-----------------------------------------------
56C M o d u l e s
57C-----------------------------------------------
59 USE elbufdef_mod
60 use element_mod , only : nixs,nixq
61C-----------------------------------------------
62C I m p l i c i t T y p e s
63C-----------------------------------------------
64#include "implicit_f.inc"
65#include "spmd_c.inc"
66C-----------------------------------------------
67C C o m m o n B l o c k s
68C-----------------------------------------------
69#include "com01_c.inc"
70#include "com04_c.inc"
71#include "com08_c.inc"
72#include "param_c.inc"
73#include "task_c.inc"
74#include "tabsiz_c.inc"
75C-----------------------------------------------
76C D u m m y A r g u m e n t s
77C-----------------------------------------------
78! SPMD CASE : SX >= 3*NUMNOD (SX = 3*(NUMNOD_L+NRCVVOIS_L))
79! X(1:3,1:NUMNOD) : local nodes
80! (1:3, NUMNOD+1:) additional nodes (also on adjacent domains but connected to the boundary of the current domain)
81! idem with D(SD), and V(SV)
82C-----------------------------------------------
83 INTEGER NALE(NUMNOD), NODFT, NODLT, ITASK,
84 . IPARG(NPARG,NGROUP),IXS(NIXS,NUMELS),IXQ(NIXQ,NUMELQ)
85 my_real X(3,SX/3), V(3,SV/3), W(3,SW/3), WA(3,*), XCELL(3, *), XFACE(3,6,*)
86 TYPE(t_connectivity), INTENT(IN) :: ALE_NE_CONNECT
87 INTEGER, INTENT(IN) :: NERCVOIS(*), NESDVOIS(*), LERCVOIS(*), LESDVOIS(*)
88 TYPE(elbuf_struct_), DIMENSION(NGROUP) :: ELBUF_TAB
89C-----------------------------------------------
90C L o c a l V a r i a b l e s
91C-----------------------------------------------
92 INTEGER I, LENCOM
93 INTEGER :: IAD1, IAD2, NG, NEL, NFT, ITY, ISOLNOD, IEL, ELT_ID
94 my_real :: SUM_VOL, Y1, Y2, Y3, Y4, Z1, Z2, Z3, Z4, A1, A2
95C ---------------------------------------------
96C B e g i n n i n g o f S u b r o u t i n e
97C ---------------------------------------------
98 wa(1:3,nodft:nodlt)=x(1:3,nodft:nodlt)
99 CALL my_barrier
100 DO ng = itask + 1, ngroup, nthread
101 nel = iparg(2, ng)
102 nft = iparg(3, ng)
103 ity = iparg(5, ng)
104 isolnod = iparg(28, ng)
105 IF (ity == 1 .AND. isolnod /= 4) THEN
106 CALL centroid3(nel, nel, nft, ixs, x,
107 . xcell(:, 1 + nft : nel + nft),
108 . xface(:, :, 1 + nft : nel + nft))
109 ELSEIF (ity == 1 .AND. isolnod == 4) THEN
110 CALL centroid3t(nel, nel, nft, ixs, x,
111 . xcell(:, 1 + nft : nel + nft),
112 . xface(:, :, 1 + nft : nel + nft))
113 ELSEIF (ity == 2) THEN
114 CALL centroid2(nel, nel, nft, ixq, x,
115 . xcell(:, 1 + nft : nel + nft),
116 . xface(:, :, 1 + nft : nel + nft))
117 ENDIF
118 IF (ity == 1 .OR. ity == 2) THEN
119C Volume stored in XFACE for SMP reasons
120 IF (n2d /= 1) THEN
121 DO i = 1, nel
122 xface(1,1,i + nft) = elbuf_tab(ng)%GBUF%VOL(i)
123 ENDDO
124 ELSE
125 DO i = 1, nel
126 y1 = x(2, ixq(2, i + nft))
127 y2 = x(2, ixq(3, i + nft))
128 y3 = x(2, ixq(4, i + nft))
129 y4 = x(2, ixq(5, i + nft))
130 z1 = x(3, ixq(2, i + nft))
131 z2 = x(3, ixq(3, i + nft))
132 z3 = x(3, ixq(4, i + nft))
133 z4 = x(3, ixq(5, i + nft))
134 a1 =y2*(z3-z4)+y3*(z4-z2)+y4*(z2-z3)
135 a2 =y2*(z4-z1)+y4*(z1-z2)+y1*(z2-z4)
136 xface(1,1,i + nft) = (a1+a2)*half
137 ENDDO
138 ENDIF
139 ENDIF
140 ENDDO
141 CALL my_barrier
142 IF (nspmd > 1) THEN
143!$OMP MASTER
144 lencom = nercvois(nspmd + 1) + nesdvois(nspmd + 1)
145 CALL spmd_e1vois(xface(2,1,1:numels + numelq + ne_nsvois + ne_nqvois),
146 . nercvois, nesdvois, lercvois, lesdvois, lencom)
147 CALL spmd_envois(3, xcell,
148 . nercvois, nesdvois, lercvois, lesdvois, lencom)
149 CALL spmd_e1vois(xface(1,1,1:numels + numelq + ne_nsvois + ne_nqvois),
150 . nercvois, nesdvois, lercvois, lesdvois, lencom)
151!$OMP END MASTER
152 ENDIF
153 CALL my_barrier
154
155 DO i = nodft, nodlt
156 IF (iabs(nale(i)) == 1) THEN
157 x(1:3, i) = zero
158 sum_vol = zero
159 iad1 = ale_ne_connect%IAD_CONNECT(i)
160 iad2 = ale_ne_connect%IAD_CONNECT(i + 1) - 1
161 DO iel = iad1, iad2
162 elt_id = ale_ne_connect%CONNECTED(iel)
163 x(1:3, i) = x(1:3, i) + xface(1,1,elt_id) * xcell(1:3, elt_id)
164 sum_vol = sum_vol + xface(1,1,elt_id)
165 ENDDO
166 x(1:3, i) = x(1:3, i) / sum_vol
167 ENDIF
168 ENDDO
169 DO i = nodft, nodlt
170 IF ( iabs(nale(i)) == 1 .AND. dt2 > zero) THEN
171 w(1:3,i) = (x(1:3,i) - wa(1:3,i)) / dt2
172 ELSE IF (nale(i) == 0) THEN
173 w(1:3,i) = v(1:3,i)
174 ELSE
175 w(1:3, i) = zero
176 ENDIF
177 x(1:3,i) = wa(1:3,i)
178 ENDDO
179 CALL my_barrier
180
181 END
subroutine alew6(x, v, w, wa, xcell, xface, ale_ne_connect, nale, nodft, nodlt, itask, nercvois, nesdvois, lercvois, lesdvois, elbuf_tab, iparg, ixs, ixq)
Definition alew6.F:45
subroutine centroid3t(nel, length, nft, ixs, xgrid, elem_centroid, face_centroid)
Definition centroid.F:109
subroutine centroid3(nel, length, nft, ixs, xgrid, elem_centroid, face_centroid)
Definition centroid.F:33
subroutine centroid2(nel, length, nft, ixq, xgrid, elem_centroid, face_centroid)
Definition centroid.F:197
subroutine spmd_envois(dim, phi, nercvois, nesdvois, lercvois, lesdvois, lencom)
Definition spmd_cfd.F:695
subroutine spmd_e1vois(phi, nercvois, nesdvois, lercvois, lesdvois, lencom)
Definition spmd_cfd.F:375
subroutine my_barrier
Definition machine.F:31