OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
facnor.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!|| facnor ../starter/source/output/anim/facnor.F
25!||--- called by ------------------------------------------------------
26!|| parsor ../starter/source/output/anim/parsor.F
27!|| parsorc ../starter/source/output/anim/parsorc.F
28!||====================================================================
29 SUBROUTINE facnor(X,D,II,XNORM,CDG,INVERT)
30C-----------------------------------------------
31C I m p l i c i t T y p e s
32C-----------------------------------------------
33#include "implicit_f.inc"
34C-----------------------------------------------
35C D u m m y A r g u m e n t s
36C-----------------------------------------------
37C REAL
39 . x(3,*),d(3,*),xnorm(3,*),cdg(*)
40 INTEGER II(*),INVERT
41C REAL
43 . x0(4),y0(4),z0(4),nx,ny,nz,xc,yc,zc,s
44 INTEGER I,I1,I2,I3,I4
45C-----------------------------------------------
46C FACE NORMAL
47C-----------------------------------------------
48 DO 100 i = 1,4
49 x0(i) = x(1,ii(i))-d(1,ii(i))
50 y0(i) = x(2,ii(i))-d(2,ii(i))
51 z0(i) = x(3,ii(i))-d(3,ii(i))
52 100 CONTINUE
53C
54 nx = (y0(3) - y0(1)) * (z0(4) - z0(2)) -
55 . (z0(3) - z0(1)) * (y0(4) - y0(2))
56 ny = (z0(3) - z0(1)) * (x0(4) - x0(2)) -
57 . (x0(3) - x0(1)) * (z0(4) - z0(2))
58 nz = (x0(3) - x0(1)) * (y0(4) - y0(2)) -
59 . (y0(3) - y0(1)) * (x0(4) - x0(2))
60C
61 xc = .25*(x0(1) + x0(2) + x0(3) + x0(4))
62 yc = .25*(y0(1) + y0(2) + y0(3) + y0(4))
63 zc = .25*(z0(1) + z0(2) + z0(3) + z0(4))
64 xc = xc - cdg(1)
65 yc = yc - cdg(2)
66 zc = zc - cdg(3)
67 s = nx * xc + ny * yc + nz * zc
68 invert = 1
69 IF(s<zero)THEN
70 invert = -1
71 i1 = ii(2)
72 i2 = ii(1)
73 i3 = ii(4)
74 i4 = ii(3)
75 ii(1) = i1
76 ii(2) = i2
77 ii(3) = i3
78 ii(4) = i4
79 ENDIF
80C
81 DO 200 i = 1,4
82 x0(i) = x(1,ii(i))
83 y0(i) = x(2,ii(i))
84 z0(i) = x(3,ii(i))
85 200 CONTINUE
86C
87 nx = (y0(3) - y0(1)) * (z0(4) - z0(2)) -
88 . (z0(3) - z0(1)) * (y0(4) - y0(2))
89 ny = (z0(3) - z0(1)) * (x0(4) - x0(2)) -
90 . (x0(3) - x0(1)) * (z0(4) - z0(2))
91 nz = (x0(3) - x0(1)) * (y0(4) - y0(2)) -
92 . (y0(3) - y0(1)) * (x0(4) - x0(2))
93C
94 DO 300 i = 1,4
95 xnorm(1,ii(i)) = xnorm(1,ii(i)) + nx
96 xnorm(2,ii(i)) = xnorm(2,ii(i)) + ny
97 xnorm(3,ii(i)) = xnorm(3,ii(i)) + nz
98 300 CONTINUE
99C
100C-----------------------------------------------
101 RETURN
102 END
103C
104!||====================================================================
105!|| facnor2 ../starter/source/output/anim/facnor.F
106!||--- called by ------------------------------------------------------
107!|| parsor ../starter/source/output/anim/parsor.F
108!||====================================================================
109 SUBROUTINE facnor2(X,II,XNORM,INVERT)
110C-----------------------------------------------
111C I m p l i c i t T y p e s
112C-----------------------------------------------
113#include "implicit_f.inc"
114C-----------------------------------------------
115C D u m m y A r g u m e n t s
116C-----------------------------------------------
117C REAL
118 my_real
119 . x(3,*),xnorm(3,*)
120 INTEGER II(*),INVERT
121C REAL
122 my_real
123 . x0(4),y0(4),z0(4),nx,ny,nz
124 INTEGER I
125C-----------------------------------------------
126C FACE NORMAL
127C-----------------------------------------------
128C
129 invert = 1
130C
131 DO 200 i = 1,4
132 x0(i) = x(1,ii(i))
133 y0(i) = x(2,ii(i))
134 z0(i) = x(3,ii(i))
135 200 CONTINUE
136C
137 nx = (y0(3) - y0(1)) * (z0(4) - z0(2)) -
138 . (z0(3) - z0(1)) * (y0(4) - y0(2))
139 ny = (z0(3) - z0(1)) * (x0(4) - x0(2)) -
140 . (x0(3) - x0(1)) * (z0(4) - z0(2))
141 nz = (x0(3) - x0(1)) * (y0(4) - y0(2)) -
142 . (y0(3) - y0(1)) * (x0(4) - x0(2))
143C
144 DO 300 i = 1,4
145 xnorm(1,ii(i)) = xnorm(1,ii(i)) + nx
146 xnorm(2,ii(i)) = xnorm(2,ii(i)) + ny
147 xnorm(3,ii(i)) = xnorm(3,ii(i)) + nz
148 300 CONTINUE
149C
150C-----------------------------------------------
151 RETURN
152 END
#define my_real
Definition cppsort.cpp:32
subroutine facnor2(x, ii, xnorm, invert)
Definition facnor.F:110
subroutine facnor(x, d, ii, xnorm, cdg, invert)
Definition facnor.F:30