OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
3points_to_frame.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!|| points_to_frame ../starter/source/model/submodel/3points_to_frame.F
25!||--- called by ------------------------------------------------------
26!|| lectrans ../starter/source/model/transformation/lectrans.F
27!|| lectranssub ../starter/source/model/submodel/lectranssub.F
28!||--- uses -----------------------------------------------------
29!|| message_mod ../starter/share/message_module/message_mod.F
30!||====================================================================
31 SUBROUTINE points_to_frame(X1, X2, X3 ,PP, IERROR)
32C-----------------------------------------------
33C M o d u l e s
34C-----------------------------------------------
35 USE message_mod
36C-----------------------------------------------
37C I m p l i c i t T y p e s
38C-----------------------------------------------
39#include "implicit_f.inc"
40C-----------------------------------------------
41C D u m m y A r g u m e n t s
42C-----------------------------------------------
44 . x1(3),x2(3),x3(3),pp(3,3)
45 INTEGER IERROR
46C-----------------------------------------------
47C L o c a l V a r i a b l e s
48C-----------------------------------------------
50 . u(3),v(3),w(3),
51 . nn,pnor1,pnor2,pnorm1,det,det1,det2,det3
52C-----------------------------------------------
53 ierror = 0
54C-----
55 u(1) = x2(1) - x1(1)
56 u(2) = x2(2) - x1(2)
57 u(3) = x2(3) - x1(3)
58 v(1) = x3(1) - x1(1)
59 v(2) = x3(2) - x1(2)
60 v(3) = x3(3) - x1(3)
61 w(1) = u(2)*v(3)-u(3)*v(2) ! W=UxV
62 w(2) = u(3)*v(1)-u(1)*v(3)
63 w(3) = u(1)*v(2)-u(2)*v(1)
64 v(1) = w(2)*u(3)-w(3)*u(2) ! V=WxU
65 v(2) = w(3)*u(1)-w(1)*u(3)
66 v(3) = w(1)*u(2)-w(2)*u(1)
67C------------
68C TESTS DE CONSISTANCE
69C------------
70 pnor1=sqrt(u(1)*u(1)+u(2)*u(2)+u(3)*u(3))
71 IF (pnor1 < em20) THEN
72 ierror=1
73C CALL ANCMSG(MSGID=1866,
74C . MSGTYPE=MSGERROR,
75C . ANMODE=ANINFO_BLIND_1,
76C . I1=ID,C1=TITR,
77C . I2=N1,
78C . I3=N2)
79 RETURN
80 END IF
81C CALCUL DE COLINEARITE DES VECTEURS N1N2 ET N1N3
82 pnor2=sqrt(v(1)*v(1)+v(2)*v(2)+v(3)*v(3))
83 IF (pnor2 > em20) THEN
84 pnorm1=one/(pnor1*pnor2)
85 det1=abs((u(2)*v(3)-u(3)*v(2))*pnorm1)
86 det2=abs((u(3)*v(1)-u(1)*v(3))*pnorm1)
87 det3=abs((u(1)*v(2)-u(2)*v(1))*pnorm1)
88 det= max(det1,det2,det3)
89 ELSE
90 det=zero
91 ENDIF
92 IF (det < em5) THEN
93 ierror=2
94C CALL ANCMSG(MSGID=1867,
95C . MSGTYPE=MSGWARNING,
96C . ANMODE=ANINFO_BLIND_1,
97C . I1=ID,C1=TITR)
98 IF(abs(u(2)) > em5) THEN
99 v(1)=abs(u(1))+ten
100 ELSE
101 v(2)=ten
102 ENDIF
103 ENDIF
104C------------
105 w(1) = u(2)*v(3)-u(3)*v(2) ! W=UxV
106 w(2) = u(3)*v(1)-u(1)*v(3)
107 w(3) = u(1)*v(2)-u(2)*v(1)
108C------------
109 nn = one/max(em20,sqrt(u(1)*u(1)+u(2)*u(2)+u(3)*u(3)))
110 u(1) = u(1)*nn
111 u(2) = u(2)*nn
112 u(3) = u(3)*nn
113 nn = one/max(em20,sqrt(v(1)*v(1)+v(2)*v(2)+v(3)*v(3)))
114 v(1) = v(1)*nn
115 v(2) = v(2)*nn
116 v(3) = v(3)*nn
117 nn = one/max(em20,sqrt(w(1)*w(1)+w(2)*w(2)+w(3)*w(3)))
118 w(1) = w(1)*nn
119 w(2) = w(2)*nn
120 w(3) = w(3)*nn
121C------------
122 pp(1,1)=u(1)
123 pp(2,1)=u(2)
124 pp(3,1)=u(3)
125 pp(1,2)=v(1)
126 pp(2,2)=v(2)
127 pp(3,2)=v(3)
128 pp(1,3)=w(1)
129 pp(2,3)=w(2)
130 pp(3,3)=w(3)
131C------------
132 RETURN
133 END
subroutine points_to_frame(x1, x2, x3, pp, ierror)
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21