OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
snorm3.F File Reference
#include "implicit_f.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine snorm3 (nel, nft, jale, ixs, xgrid, wgrid, norm, wfac, surf)

Function/Subroutine Documentation

◆ snorm3()

subroutine snorm3 ( integer, intent(in) nel,
integer, intent(in) nft,
integer, intent(in) jale,
integer, dimension(nixs, *), intent(in) ixs,
dimension(3, *), intent(in) xgrid,
dimension(*), intent(in) wgrid,
dimension(3, 6, nel), target norm,
dimension(3, 6, nel), intent(out) wfac,
dimension(6, nel), intent(out) surf )

Definition at line 31 of file snorm3.F.

33 use element_mod , only : nixs
34C-----------------------------------------------
35C D e s c r i p t i o n
36C-----------------------------------------------
37C Computes normal vector to the faces of each element in a group
38C for a 3d solid element (hence Snorm3)
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42#include "implicit_f.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46! NIXS
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER, INTENT(IN) :: NEL, NFT, JALE, IXS(NIXS, *)
51 my_real, INTENT(IN) ::
52 . xgrid(3, *), wgrid(*)
53 my_real, INTENT(OUT) :: wfac(3, 6, nel), surf(6, nel)
54 my_real, INTENT(OUT), TARGET :: norm(3, 6, nel)
55C-----------------------------------------------
56C L o c a l V a r i a b l e s
57C-----------------------------------------------
58 INTEGER :: II, NODE1, NODE2, NODE3, NODE4, NODE5, NODE6, NODE7, NODE8, KFACE
60 . x1(3), x2(3), x3(3), x4(3), x5(3), x6(3), x7(3), x8(3),
61 . w1(3), w2(3), w3(3), w4(3), w5(3), w6(3), w7(3), w8(3)
62 my_real, POINTER :: nx, ny, nz
63
64 DO ii = 1, nel
65C Nodes of the element locally stored in NODE* for memory access
66 node1 = ixs(2, ii + nft)
67 node2 = ixs(3, ii + nft)
68 node3 = ixs(4, ii + nft)
69 node4 = ixs(5, ii + nft)
70 node5 = ixs(6, ii + nft)
71 node6 = ixs(7, ii + nft)
72 node7 = ixs(8, ii + nft)
73 node8 = ixs(9, ii + nft)
74C Node coordinates
75 x1(1:3) = xgrid(1:3, node1)
76 x2(1:3) = xgrid(1:3, node2)
77 x3(1:3) = xgrid(1:3, node3)
78 x4(1:3) = xgrid(1:3, node4)
79 x5(1:3) = xgrid(1:3, node5)
80 x6(1:3) = xgrid(1:3, node6)
81 x7(1:3) = xgrid(1:3, node7)
82 x8(1:3) = xgrid(1:3, node8)
83 IF (jale /= 0) THEN
84C Node grid velocities
85 w1(1:3) = wgrid(3 * (node1 - 1) + 1 : 3 * (node1 - 1) + 3)
86 w2(1:3) = wgrid(3 * (node2 - 1) + 1 : 3 * (node2 - 1) + 3)
87 w3(1:3) = wgrid(3 * (node3 - 1) + 1 : 3 * (node3 - 1) + 3)
88 w4(1:3) = wgrid(3 * (node4 - 1) + 1 : 3 * (node4 - 1) + 3)
89 w5(1:3) = wgrid(3 * (node5 - 1) + 1 : 3 * (node5 - 1) + 3)
90 w6(1:3) = wgrid(3 * (node6 - 1) + 1 : 3 * (node6 - 1) + 3)
91 w7(1:3) = wgrid(3 * (node7 - 1) + 1 : 3 * (node7 - 1) + 3)
92 w8(1:3) = wgrid(3 * (node8 - 1) + 1 : 3 * (node8 - 1) + 3)
93 ELSE
94! Euler
95 w1(1:3) = zero
96 w2(1:3) = zero
97 w3(1:3) = zero
98 w4(1:3) = zero
99 w5(1:3) = zero
100 w6(1:3) = zero
101 w7(1:3) = zero
102 w8(1:3) = zero
103 ENDIF
104C Face normal
105C Face 1
106 kface = 1
107 norm(1, kface, ii) = half * ((x3(2) - x1(2)) * (x2(3) - x4(3)) -
108 . (x3(3) - x1(3)) * (x2(2) - x4(2)))
109 norm(2, kface, ii) = half * ((x3(3) - x1(3)) * (x2(1) - x4(1)) -
110 . (x3(1) - x1(1)) * (x2(3) - x4(3)))
111 norm(3, kface, ii) = half * ((x3(1) - x1(1)) * (x2(2) - x4(2)) -
112 . (x3(2) - x1(2)) * (x2(1) - x4(1)))
113 nx => norm(1, kface, ii)
114 ny => norm(2, kface, ii)
115 nz => norm(3, kface, ii)
116 surf(kface, ii) = sqrt(nx * nx + ny * ny + nz * nz)
117 nx = nx / surf(kface, ii)
118 ny = ny / surf(kface, ii)
119 nz = nz / surf(kface, ii)
120C Face 2
121 kface = 2
122 norm(1, kface, ii) = half * ((x7(2) - x4(2)) * (x3(3) - x8(3)) -
123 . (x7(3) - x4(3)) * (x3(2) - x8(2)))
124 norm(2, kface, ii) = half * ((x7(3) - x4(3)) * (x3(1) - x8(1)) -
125 . (x7(1) - x4(1)) * (x3(3) - x8(3)))
126 norm(3, kface, ii) = half * ((x7(1) - x4(1)) * (x3(2) - x8(2)) -
127 . (x7(2) - x4(2)) * (x3(1) - x8(1)))
128 nx => norm(1, kface, ii)
129 ny => norm(2, kface, ii)
130 nz => norm(3, kface, ii)
131 surf(kface, ii) = sqrt(nx * nx + ny * ny + nz * nz)
132 nx = nx / surf(kface, ii)
133 ny = ny / surf(kface, ii)
134 nz = nz / surf(kface, ii)
135C Face 3
136 kface = 3
137 norm(1, kface, ii) = half * ((x6(2) - x8(2)) * (x7(3) - x5(3)) -
138 . (x6(3) - x8(3)) * (x7(2) - x5(2)))
139 norm(2, kface, ii) = half * ((x6(3) - x8(3)) * (x7(1) - x5(1)) -
140 . (x6(1) - x8(1)) * (x7(3) - x5(3)))
141 norm(3, kface, ii) = half * ((x6(1) - x8(1)) * (x7(2) - x5(2)) -
142 . (x6(2) - x8(2)) * (x7(1) - x5(1)))
143 nx => norm(1, kface, ii)
144 ny => norm(2, kface, ii)
145 nz => norm(3, kface, ii)
146 surf(kface, ii) = sqrt(nx * nx + ny * ny + nz * nz)
147 nx = nx / surf(kface, ii)
148 ny = ny / surf(kface, ii)
149 nz = nz / surf(kface, ii)
150C Face 4
151 kface = 4
152 norm(1, kface, ii) = half * ((x2(2) - x5(2)) * (x6(3) - x1(3)) -
153 . (x2(3) - x5(3)) * (x6(2) - x1(2)))
154 norm(2, kface, ii) = half * ((x2(3) - x5(3)) * (x6(1) - x1(1)) -
155 . (x2(1) - x5(1)) * (x6(3) - x1(3)))
156 norm(3, kface, ii) = half * ((x2(1) - x5(1)) * (x6(2) - x1(2)) -
157 . (x2(2) - x5(2)) * (x6(1) - x1(1)))
158 nx => norm(1, kface, ii)
159 ny => norm(2, kface, ii)
160 nz => norm(3, kface, ii)
161 surf(kface, ii) = sqrt(nx * nx + ny * ny + nz * nz)
162 nx = nx / surf(kface, ii)
163 ny = ny / surf(kface, ii)
164 nz = nz / surf(kface, ii)
165C Face 5
166 kface = 5
167 norm(1, kface, ii) = half * ((x7(2) - x2(2)) * (x6(3) - x3(3)) -
168 . (x7(3) - x2(3)) * (x6(2) - x3(2)))
169 norm(2, kface, ii) = half * ((x7(3) - x2(3)) * (x6(1) - x3(1)) -
170 . (x7(1) - x2(1)) * (x6(3) - x3(3)))
171 norm(3, kface, ii) = half * ((x7(1) - x2(1)) * (x6(2) - x3(2)) -
172 . (x7(2) - x2(2)) * (x6(1) - x3(1)))
173 nx => norm(1, kface, ii)
174 ny => norm(2, kface, ii)
175 nz => norm(3, kface, ii)
176 surf(kface, ii) = sqrt(nx * nx + ny * ny + nz * nz)
177 nx = nx / surf(kface, ii)
178 ny = ny / surf(kface, ii)
179 nz = nz / surf(kface, ii)
180C Face 6
181 kface = 6
182 norm(1, kface, ii) = half * ((x8(2) - x1(2)) * (x4(3) - x5(3)) -
183 . (x8(3) - x1(3)) * (x4(2) - x5(2)))
184 norm(2, kface, ii) = half * ((x8(3) - x1(3)) * (x4(1) - x5(1)) -
185 . (x8(1) - x1(1)) * (x4(3) - x5(3)))
186 norm(3, kface, ii) = half * ((x8(1) - x1(1)) * (x4(2) - x5(2)) -
187 . (x8(2) - x1(2)) * (x4(1) - x5(1)))
188 nx => norm(1, kface, ii)
189 ny => norm(2, kface, ii)
190 nz => norm(3, kface, ii)
191 surf(kface, ii) = sqrt(nx * nx + ny * ny + nz * nz)
192 nx = nx / surf(kface, ii)
193 ny = ny / surf(kface, ii)
194 nz = nz / surf(kface, ii)
195C Face grid velocity 1
196 wfac(1:3, 1, ii) = fourth * (w1(1:3) + w2(1:3) + w3(1:3) + w4(1:3))
197C Face grid velocity 2
198 wfac(1:3, 2, ii) = fourth * (w3(1:3) + w4(1:3) + w8(1:3) + w7(1:3))
199C Face grid velocity 3
200 wfac(1:3, 3, ii) = fourth * (w5(1:3) + w6(1:3) + w7(1:3) + w8(1:3))
201C Face grid velocity 4
202 wfac(1:3, 4, ii) = fourth * (w1(1:3) + w2(1:3) + w6(1:3) + w5(1:3))
203C Face grid velocity 5
204 wfac(1:3, 5, ii) = fourth * (w2(1:3) + w3(1:3) + w7(1:3) + w6(1:3))
205C Face grid velocity 6
206 wfac(1:3, 6, ii) = fourth * (w1(1:3) + w4(1:3) + w8(1:3) + w5(1:3))
207 ENDDO
#define my_real
Definition cppsort.cpp:32
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB