OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
cnvec3.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/.
23C routine reectite en 50c
24!||====================================================================
25!|| cnvec3 ../engine/source/elements/shell/coque/cnvec3.F
26!||--- called by ------------------------------------------------------
27!|| cforc3 ../engine/source/elements/shell/coque/cforc3.F
28!|| cforc3_crk ../engine/source/elements/xfem/cforc3_crk.F
29!||--- calls -----------------------------------------------------
30!|| cortdir3 ../engine/source/elements/shell/coque/cortdir3.F
31!||--- uses -----------------------------------------------------
32!|| elbufdef_mod ../common_source/modules/mat_elem/elbufdef_mod.F90
33!||====================================================================
34 SUBROUTINE cnvec3(ELBUF_STR,DIR_A ,DIR_B ,
35 1 JFT ,JLT ,IREP ,IGTYP ,NLAY ,
36 2 X1 ,X2 ,X3 ,X4 ,Y1 ,Y2 ,
37 3 Y3 ,Y4 ,Z1 ,Z2 ,Z3 ,Z4 ,
38 4 E1X ,E1Y ,E1Z ,E2X ,E2Y ,E2Z ,
39 5 E3X ,E3Y ,E3Z ,NEL )
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE elbufdef_mod
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C G l o b a l P a r a m e t e r s
50C-----------------------------------------------
51#include "mvsiz_p.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 INTEGER, INTENT(IN) :: JFT,JLT,NLAY,IREP,IGTYP,NEL
56 my_real
57 . X1(*), X2(*), X3(*), X4(*), Y1(*), Y2(*), Y3(*), Y4(*),
58 . Z1(*), Z2(*), Z3(*), Z4(*), E1X(*), E1Y(*), E1Z(*), E2X(*),
59 . E2Y(*), E2Z(*), E3X(*), E3Y(*), E3Z(*),DIR_A(*),DIR_B(*)
60 TYPE (ELBUF_STRUCT_) :: ELBUF_STR
61C-----------------------------------------------
62C C o m m o n B l o c k s
63C-----------------------------------------------
64#include "com01_c.inc"
65C-----------------------------------------------
66C L o c a l V a r i a b l e s
67C-----------------------------------------------
68 INTEGER I
69C REAL
70 my_real
71 . SUMA,S1,S2,X21,X32,X34,X41,Y21,Y32,Y34,Y41,Z21,Z32,Z34,Z41
72 my_real, DIMENSION(MVSIZ) ::
73 . e11,e12,e13,e21,e22,e23,rx,ry,rz,sx,sy,sz
74C=======================================================================
75 DO i=jft,jlt
76 x21 = x2(i)-x1(i)
77 x32 = x3(i)-x2(i)
78 x34 = x3(i)-x4(i)
79 x41 = x4(i)-x1(i)
80
81 y21 = y2(i)-y1(i)
82 y32 = y3(i)-y2(i)
83 y34 = y3(i)-y4(i)
84 y41 = y4(i)-y1(i)
85
86 z21 = z2(i)-z1(i)
87 z32 = z3(i)-z2(i)
88 z34 = z3(i)-z4(i)
89 z41 = z4(i)-z1(i)
90
91 e1x(i) = (x21+x34 )
92 e1y(i) = (y21+y34 )
93 e1z(i) = (z21+z34 )
94
95 e2x(i) = (x32+x41 )
96 e2y(i) = (y32+y41 )
97 e2z(i) = (z32+z41 )
98
99 e3x(i) = e1y(i)*e2z(i)-e1z(i)*e2y(i)
100 e3y(i) = e1z(i)*e2x(i)-e1x(i)*e2z(i)
101 e3z(i) = e1x(i)*e2y(i)-e1y(i)*e2x(i)
102 ENDDO
103 IF (irep > 0) THEN
104 DO i=jft,jlt
105 rx(i) = e1x(i)
106 ry(i) = e1y(i)
107 rz(i) = e1z(i)
108 sx(i) = e2x(i)
109 sy(i) = e2y(i)
110 sz(i) = e2z(i)
111 ENDDO
112 ENDIF
113C
114C--- orthogonalisation du repere local
115C
116 IF (ishfram == 0 .OR. igtyp == 16 ) THEN
117C--- Repere convecte symetrique - version 5 (default)
118 DO i=jft,jlt
119 suma = e3x(i)*e3x(i)+e3y(i)*e3y(i)+e3z(i)*e3z(i)
120 suma = one / max(sqrt(suma),em20)
121 e3x(i) = e3x(i) * suma
122 e3y(i) = e3y(i) * suma
123 e3z(i) = e3z(i) * suma
124C
125 s1 = e1x(i)*e1x(i)+e1y(i)*e1y(i)+e1z(i)*e1z(i)
126 s2 = e2x(i)*e2x(i)+e2y(i)*e2y(i)+e2z(i)*e2z(i)
127 suma = sqrt(s1/s2)
128 e1x(i) = e1x(i) + (e2y(i)*e3z(i)-e2z(i)*e3y(i))*suma
129 e1y(i) = e1y(i) + (e2z(i)*e3x(i)-e2x(i)*e3z(i))*suma
130 e1z(i) = e1z(i) + (e2x(i)*e3y(i)-e2y(i)*e3x(i))*suma
131C
132 suma = e1x(i)*e1x(i)+e1y(i)*e1y(i)+e1z(i)*e1z(i)
133 suma = one / max(sqrt(suma),em20)
134 e1x(i) = e1x(i) * suma
135 e1y(i) = e1y(i) * suma
136 e1z(i) = e1z(i) * suma
137C
138 e2x(i) = e3y(i) * e1z(i) - e3z(i) * e1y(i)
139 e2y(i) = e3z(i) * e1x(i) - e3x(i) * e1z(i)
140 e2z(i) = e3x(i) * e1y(i) - e3y(i) * e1x(i)
141 ENDDO
142 ELSEIF (ishfram == 2) THEN
143C--- Repere convecte nonsymetrique - version 4
144 DO i=jft,jlt
145 suma = e2x(i)*e2x(i)+e2y(i)*e2y(i)+e2z(i)*e2z(i)
146 e1x(i) = e1x(i)*suma + e2y(i)*e3z(i)-e2z(i)*e3y(i)
147 e1y(i) = e1y(i)*suma + e2z(i)*e3x(i)-e2x(i)*e3z(i)
148 e1z(i) = e1z(i)*suma + e2x(i)*e3y(i)-e2y(i)*e3x(i)
149 suma = e1x(i)*e1x(i)+e1y(i)*e1y(i)+e1z(i)*e1z(i)
150 suma = one/max(sqrt(suma),em20)
151 e1x(i) = e1x(i)*suma
152 e1y(i) = e1y(i)*suma
153 e1z(i) = e1z(i)*suma
154C
155 suma = e3x(i)*e3x(i)+e3y(i)*e3y(i)+e3z(i)*e3z(i)
156 suma = one / max(sqrt(suma),em20)
157 e3x(i) = e3x(i) * suma
158 e3y(i) = e3y(i) * suma
159 e3z(i) = e3z(i) * suma
160C
161 e2x(i) = e3y(i)*e1z(i)-e3z(i)*e1y(i)
162 e2y(i) = e3z(i)*e1x(i)-e3x(i)*e1z(i)
163 e2z(i) = e3x(i)*e1y(i)-e3y(i)*e1x(i)
164 suma = e2x(i)*e2x(i)+e2y(i)*e2y(i)+e2z(i)*e2z(i)
165 suma = one/max(sqrt(suma),em20)
166 e2x(i) = e2x(i)*suma
167 e2y(i) = e2y(i)*suma
168 e2z(i) = e2z(i)*suma
169 ENDDO
170 ENDIF
171C
172C--- directions orthotropie / anisotropie convectes
173C
174 CALL cortdir3(elbuf_str,dir_a ,dir_b ,jft ,jlt ,
175 . nlay ,irep ,rx ,ry ,rz ,
176 . sx ,sy ,sz ,e1x ,e1y ,
177 . e1z ,e2x ,e2y ,e2z ,nel )
178C-----------
179 RETURN
180 END SUBROUTINE cnvec3
subroutine cnvec3(elbuf_str, dir_a, dir_b, jft, jlt, irep, igtyp, nlay, x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4, e1x, e1y, e1z, e2x, e2y, e2z, e3x, e3y, e3z, nel)
Definition cnvec3.F:40
subroutine cortdir3(elbuf_str, dir_a, dir_b, jft, jlt, nlay, irep, rx, ry, rz, sx, sy, sz, e1x, e1y, e1z, e2x, e2y, e2z, nel)
Definition cortdir3.F:45
#define max(a, b)
Definition macros.h:21