OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
egrad2.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!|| egrad2 ../engine/source/ale/euler2d/egrad2.F
25!||--- called by ------------------------------------------------------
26!|| agrad0 ../engine/source/ale/agrad0.F
27!||--- uses -----------------------------------------------------
28!|| ale_connectivity_mod ../common_source/modules/ale/ale_connectivity_mod.F
29!|| element_mod ../common_source/modules/elements/element_mod.F90
30!||====================================================================
31 SUBROUTINE egrad2(IXQ,X,ALE_CONNECT,GRAD)
32C-----------------------------------------------
33C M o d u l e s
34C-----------------------------------------------
36 use element_mod , only : nixq
37C-----------------------------------------------
38C I m p l i c i t T y p e s
39C-----------------------------------------------
40#include "implicit_f.inc"
41C-----------------------------------------------
42C G l o b a l P a r a m e t e r s
43C-----------------------------------------------
44#include "mvsiz_p.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "com01_c.inc"
49#include "vect01_c.inc"
50#include "tabsiz_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54! SPMD CASE : SIXQ >= NIXQ*NUMELQ (SIXQ = NIXQ*NUMELQ_L+NIXQ*NQVOIS_L)
55! IXQ(1:NIXQ, 1:NUMELQ) local elems
56! (1:NIXQ, NUMELQ+1:) additional elems (also on adjacent domains but connected to the boundary of the current domain)
57!
58! SPMD CASE : SX >= 3*NUMNOD (SX = 3*(NUMNOD_L+NRCVVOIS_L))
59! X(1:3,1:NUMNOD) : local nodes
60! (1:3, NUMNOD+1:) additional nodes (also on adjacent domains but connected to the boundary of the current domain)
61C-----------------------------------------------
62 INTEGER,INTENT(IN) :: IXQ(7,SIXQ/NIXQ)
63 my_real,INTENT(IN) :: x(3,sx/3)
64 my_real,INTENT(INOUT) :: grad(4,*)
65 TYPE(t_ale_connectivity), INTENT(IN) :: ALE_CONNECT
66C-----------------------------------------------
67C L o c a l V a r i a b l e s
68C-----------------------------------------------
69 INTEGER I, II, IE, IV1, IV2, IV3, IV4, IAD2
71 . x1(mvsiz), x2(mvsiz), x3(mvsiz), x4(mvsiz), y1(mvsiz), y2(mvsiz), y3(mvsiz), y4(mvsiz),
72 . z1(mvsiz), z2(mvsiz), z3(mvsiz), z4(mvsiz), yc(mvsiz), zc(mvsiz),
73 . n1y(mvsiz), n2y(mvsiz), n3y(mvsiz), n4y(mvsiz), n1z(mvsiz),
74 . n2z(mvsiz), n3z(mvsiz), n4z(mvsiz), dd1(mvsiz), dd2(mvsiz), dd3(mvsiz), dd4(mvsiz),
75 . d1y(mvsiz), d2y(mvsiz), d3y(mvsiz), d4y(mvsiz), d1z(mvsiz),
76 . d2z(mvsiz), d3z(mvsiz), d4z(mvsiz)
77C-----------------------------------------------
78 DO i=lft,llt
79 ii=i+nft
80 x1(i)=x(1,ixq(2,ii))
81 y1(i)=x(2,ixq(2,ii))
82 z1(i)=x(3,ixq(2,ii))
83
84 x2(i)=x(1,ixq(3,ii))
85 y2(i)=x(2,ixq(3,ii))
86 z2(i)=x(3,ixq(3,ii))
87
88 x3(i)=x(1,ixq(4,ii))
89 y3(i)=x(2,ixq(4,ii))
90 z3(i)=x(3,ixq(4,ii))
91
92 x4(i)=x(1,ixq(5,ii))
93 y4(i)=x(2,ixq(5,ii))
94 z4(i)=x(3,ixq(5,ii))
95 ENDDO
96C-------------------------------------------
97C NORMAL VECTORS ( N = 2S.n where |n|=1)
98C-------------------------------------------
99 DO i=lft,llt
100 n1y(i)= (z2(i)-z1(i))
101 n1z(i)=-(y2(i)-y1(i))
102
103 n2y(i)= (z3(i)-z2(i))
104 n2z(i)=-(y3(i)-y2(i))
105
106 n3y(i)= (z4(i)-z3(i))
107 n3z(i)=-(y4(i)-y3(i))
108
109 n4y(i)= (z1(i)-z4(i))
110 n4z(i)=-(y1(i)-y4(i))
111 yc(i) = (y1(i)+y2(i)+y3(i)+y4(i))
112 zc(i) = (z1(i)+z2(i)+z3(i)+z4(i))
113 ENDDO
114
115 IF(n2d == 1)THEN
116 DO i=lft,llt
117 n1y(i) = n1y(i)*(y1(i)+y2(i))*half
118 n1z(i) = n1z(i)*(y1(i)+y2(i))*half
119 n2y(i) = n2y(i)*(y2(i)+y3(i))*half
120 n2z(i) = n2z(i)*(y2(i)+y3(i))*half
121 n3y(i) = n3y(i)*(y3(i)+y4(i))*half
122 n3z(i) = n3z(i)*(y3(i)+y4(i))*half
123 n4y(i) = n4y(i)*(y1(i)+y4(i))*half
124 n4z(i) = n4z(i)*(y1(i)+y4(i))*half
125 ENDDO
126 ENDIF
127C-------------------------------------------------------------
128C DISTANCE BETWEEN ELEMS ( * 4. )
129C-------------------------------------------------------------
130 DO i=lft,llt
131 ie =nft+i
132 iad2 = ale_connect%ee_connect%iad_connect(ie)
133 iv1 = ale_connect%ee_connect%connected(iad2 + 1 - 1)
134 iv2 = ale_connect%ee_connect%connected(iad2 + 2 - 1)
135 iv3 = ale_connect%ee_connect%connected(iad2 + 3 - 1)
136 iv4 = ale_connect%ee_connect%connected(iad2 + 4 - 1)
137 IF(iv1 <= 0) iv1=ie
138 IF(iv2 <= 0) iv2=ie
139 IF(iv3 <= 0) iv3=ie
140 IF(iv4 <= 0) iv4=ie
141 d1y(i) = - yc(i) + x(2,ixq(2,iv1)) + x(2,ixq(3,iv1)) + x(2,ixq(4,iv1)) + x(2,ixq(5,iv1))
142 d1z(i) = - zc(i) + x(3,ixq(2,iv1)) + x(3,ixq(3,iv1)) + x(3,ixq(4,iv1)) + x(3,ixq(5,iv1))
143 d2y(i) = - yc(i) + x(2,ixq(2,iv2)) + x(2,ixq(3,iv2)) + x(2,ixq(4,iv2)) + x(2,ixq(5,iv2))
144 d2z(i) = - zc(i) + x(3,ixq(2,iv2)) + x(3,ixq(3,iv2)) + x(3,ixq(4,iv2)) + x(3,ixq(5,iv2))
145 d3y(i) = - yc(i) + x(2,ixq(2,iv3)) + x(2,ixq(3,iv3)) + x(2,ixq(4,iv3)) + x(2,ixq(5,iv3))
146 d3z(i) = - zc(i) + x(3,ixq(2,iv3)) + x(3,ixq(3,iv3)) + x(3,ixq(4,iv3)) + x(3,ixq(5,iv3))
147 d4y(i) = - yc(i) + x(2,ixq(2,iv4)) + x(2,ixq(3,iv4)) + x(2,ixq(4,iv4)) + x(2,ixq(5,iv4))
148 d4z(i) = - zc(i) + x(3,ixq(2,iv4)) + x(3,ixq(3,iv4)) + x(3,ixq(4,iv4)) + x(3,ixq(5,iv4))
149 ENDDO
150
151 ! DiX = 8.dx[i]
152 ! DiY = 8.dy[i]
153 ! DiZ = 8.dz[i]
154 ! => DDi = 64 (dx^2 + dy^2 + dz^2)
155 DO i=lft,llt
156 dd1(i)=d1y(i)**2+d1z(i)**2
157 dd2(i)=d2y(i)**2+d2z(i)**2
158 dd3(i)=d3y(i)**2+d3z(i)**2
159 dd4(i)=d4y(i)**2+d4z(i)**2
160 ENDDO
161C---------------------------------
162C GRADIENTS * SURFACES
163C Ni=2Sn, |n|=1
164C DiX = 8.dx[i], DiY = 8.dy[i], DiZ = 8.dz[i],
165C DDi = 64 (dx^2 + dy^2 + dz^2)
166C Finally
167C GRADi = Si . < di,ni > / di^2
168C where di is the distance between the centers of the two elements (current and adjacent #i)
169C---------------------------------
170 DO i=lft,llt
171 grad(1,i)= four*(d1y(i)*n1y(i)+d1z(i)*n1z(i)) / max(em15,dd1(i))
172 grad(2,i)= four*(d2y(i)*n2y(i)+d2z(i)*n2z(i)) / max(em15,dd2(i))
173 grad(3,i)= four*(d3y(i)*n3y(i)+d3z(i)*n3z(i)) / max(em15,dd3(i))
174 grad(4,i)= four*(d4y(i)*n4y(i)+d4z(i)*n4z(i)) / max(em15,dd4(i))
175 ENDDO
176C-----------------------------------------------
177 RETURN
178 END
#define my_real
Definition cppsort.cpp:32
subroutine egrad2(ixq, x, ale_connect, grad)
Definition egrad2.F:32
#define max(a, b)
Definition macros.h:21