OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
alew1.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!|| alew1 ../engine/source/ale/grid/alew1.F
25!||--- called by ------------------------------------------------------
26!|| alewdx ../engine/source/ale/grid/alewdx.F
27!||--- calls -----------------------------------------------------
28!|| spmd_xvois ../engine/source/mpi/fluid/spmd_cfd.f
29!||--- uses -----------------------------------------------------
30!|| ale_connectivity_mod ../common_source/modules/ale/ale_connectivity_mod.F
31!|| ale_mod ../common_source/modules/ale/ale_mod.F
32!||====================================================================
33 SUBROUTINE alew1(
34 1 D ,V ,W ,
35 2 ALE_NN_CONNECT ,NALE ,NODFT ,NODLT ,
36 3 NBRCVOIS ,NBSDVOIS,LNRCVOIS,LNSDVOIS)
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
41 USE ale_mod
42C-----------------------------------------------
43C D e s c r i p t i o n
44C-----------------------------------------------
45C Compute Grid for /ALE/GRID/DISP
46C
47C X,D,V are allocated to SX,SD,DV=3*(NUMNOD_L+NUMVVOIS_L)
48C in grid subroutine it may needed to access nodes which
49C are connected to a remote elem. They are sored in X(1:3,NUMNOD+1:)
50C Consequently X is defined here X(3,SX/3) instead of X(3,NUMNOD) as usually
51C-----------------------------------------------
52C I m p l i c i t T y p e s
53C-----------------------------------------------
54#include "implicit_f.inc"
55C-----------------------------------------------
56C C o m m o n B l o c k s
57C-----------------------------------------------
58#include "com01_c.inc"
59#include "com04_c.inc"
60#include "com08_c.inc"
61#include "tabsiz_c.inc"
62C-----------------------------------------------
63C D u m m y A r g u m e n t s
64C-----------------------------------------------
65! SPMD CASE : SX >= 3*NUMNOD (SX = 3*(NUMNOD_L+NRCVVOIS_L))
66! X(1:3,1:NUMNOD) : local nodes
67! (1:3, NUMNOD+1:) additional nodes (also on adjacent domains but connected to the boundary of the current domain)
68! idem with D(SD), and V(SV)
69C-----------------------------------------------
70 INTEGER NALE(NUMNOD), NODFT, NODLT,
71 . NBRCVOIS(*),NBSDVOIS(*),
72 . LNRCVOIS(*),LNSDVOIS(*)
73 my_real d(3,sd/3), v(3,sv/3), w(3,sw/3)
74 TYPE(t_connectivity), INTENT(IN) :: ALE_NN_CONNECT
75C-----------------------------------------------
76C L o c a l V a r i a b l e s
77C-----------------------------------------------
78 INTEGER I, LENCOM
79 my_real DX, DY, DZ,FAC
80 INTEGER :: IAD, IAD1, IAD2, NODE_ID
81 my_real :: dx_max, dx_min
82 my_real :: dy_max, dy_min
83 my_real :: dz_max, dz_min
84C-----------------------------------------------
85C S o u r c e L i n e s
86C-----------------------------------------------
87
88C SPMD : COMM D
89 IF(nspmd > 1)THEN
90!$OMP SINGLE
91 lencom = nbrcvois(nspmd+1)+nbsdvois(nspmd+1)
92 CALL spmd_xvois(d,nbrcvois,nbsdvois,lnrcvois,lnsdvois,lencom)
93!$OMP END SINGLE
94 END IF
95 fac=one/dt2/three
96 DO i = nodft, nodlt
97 IF(iabs(nale(i)) == 1) THEN
98 iad1 = ale_nn_connect%IAD_CONNECT(i)
99 iad2 = ale_nn_connect%IAD_CONNECT(i + 1) - 1
100 dx_max = -huge(zero)
101 dx_min = huge(zero)
102 dy_max = -huge(zero)
103 dy_min = huge(zero)
104 dz_max = -huge(zero)
105 dz_min = huge(zero)
106 DO iad = iad1, iad2
107 node_id = ale_nn_connect%CONNECTED(iad)
108 dx_max = max(dx_max, d(1, node_id))
109 dx_min = min(dx_min, d(1, node_id))
110 dy_max = max(dy_max, d(2, node_id))
111 dy_min = min(dy_min, d(2, node_id))
112 dz_max = max(dz_max, d(3, node_id))
113 dz_min = min(dz_min, d(3, node_id))
114 ENDDO
115 dx = fac * (dx_max + dx_min - two * d(1, i))
116 dy = fac * (dy_max + dy_min - two * d(2, i))
117 dz = fac * (dz_max + dz_min - two * d(3, i))
118 w(1,i)=sign(one,dx)*min(abs(dx),ale%GRID%ALPHA)
119 w(2,i)=sign(one,dy)*min(abs(dy),ale%GRID%ALPHA)
120 w(3,i)=sign(one,dz)*min(abs(dz),ale%GRID%ALPHA)
121 ELSEIF(nale(i) == 0)THEN
122 w(1,i)=v(1,i)
123 w(2,i)=v(2,i)
124 w(3,i)=v(3,i)
125 ELSE
126 w(1,i)=zero
127 w(2,i)=zero
128 w(3,i)=zero
129 ENDIF
130C
131 ENDDO
132C
133 RETURN
134 END
subroutine alew1(d, v, w, ale_nn_connect, nale, nodft, nodlt, nbrcvois, nbsdvois, lnrcvois, lnsdvois)
Definition alew1.F:37
#define my_real
Definition cppsort.cpp:32
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
type(ale_) ale
Definition ale_mod.F:249
subroutine spmd_xvois(x, nbrcvois, nbsdvois, lnrcvois, lnsdvois, lencom)
Definition spmd_cfd.F:40