CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
straighteq3d.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine straighteq3d (col, straight)
 

Function/Subroutine Documentation

◆ straighteq3d()

subroutine straighteq3d ( real*8, dimension(3,3)  col,
real*8, dimension(16)  straight 
)
20 !
21 ! calculate the equation of the planes through the
22 ! edges of a triangle and perpendicular to the triangle together
23 ! with the plane of the triangle itself with
24 ! (col(1,1),col(2,1),col(3,1)),(col(1,2),col(2,2),col(3,2)),
25 ! (col(1,3),col(2,3),col(3,3))
26 ! as vertices. The equation of the plane through the edge
27 ! opposite nodet(1) is of the form
28 ! straight(1)*x+straight(2)*y+straight(3)*z+straight(4)=0, such that the
29 ! vector (straight(1),straight(2),straight(3)) points outwards;
30 ! for the edge opposite of nodet(2) the equation is
31 ! straight(5)*x+straight(6)*y+straight(7)*z+straight(8)=0 and for the edge
32 ! oppositie of nodet(3) it is
33 ! straight(9)*x+straight(10)*y+straight(11)*z+straight(12)=0.
34 ! Here too, the normals
35 ! (straight(5),straight(6),straight(7)) and
36 ! (straight(9),straight(10),straight(11)) point
37 ! outwards of the triangle. The equation of the triangle plane is
38 ! straight(13)*x+straight(14)*y+straight(15)*z+straight(16)=0 such
39 ! that the triangle is numbered clockwise when looking in the
40 ! direction of vector (straight(13),straight(14),straight(15)).
41 !
42  implicit none
43 !
44  integer i
45 !
46  real*8 col(3,3),straight(16),p12(3),p23(3),p31(3),dd
47 !
48 ! sides of the triangle
49 !
50  do i=1,3
51  p12(i)=col(i,2)-col(i,1)
52  p23(i)=col(i,3)-col(i,2)
53  p31(i)=col(i,1)-col(i,3)
54  enddo
55 !
56 ! normalized vector normal to the triangle: xn = p12 x p23
57 !
58  straight(13)=p12(2)*p23(3)-p12(3)*p23(2)
59  straight(14)=p12(3)*p23(1)-p12(1)*p23(3)
60  straight(15)=p12(1)*p23(2)-p12(2)*p23(1)
61  dd=dsqrt(straight(13)*straight(13)+straight(14)*straight(14)+
62  & straight(15)*straight(15))
63  do i=13,15
64  straight(i)=straight(i)/dd
65  enddo
66 !
67 ! p12 x xn
68 !
69  straight(9)=p12(2)*straight(15)-p12(3)*straight(14)
70  straight(10)=p12(3)*straight(13)-p12(1)*straight(15)
71  straight(11)=p12(1)*straight(14)-p12(2)*straight(13)
72  dd=dsqrt(straight(9)*straight(9)+straight(10)*straight(10)+
73  & straight(11)*straight(11))
74  do i=9,11
75  straight(i)=straight(i)/dd
76  enddo
77 !
78 ! p23 x xn
79 !
80  straight(1)=p23(2)*straight(15)-p23(3)*straight(14)
81  straight(2)=p23(3)*straight(13)-p23(1)*straight(15)
82  straight(3)=p23(1)*straight(14)-p23(2)*straight(13)
83  dd=dsqrt(straight(1)*straight(1)+straight(2)*straight(2)+
84  & straight(3)*straight(3))
85  do i=1,3
86  straight(i)=straight(i)/dd
87  enddo
88 !
89 ! p31 x xn
90 !
91  straight(5)=p31(2)*straight(15)-p31(3)*straight(14)
92  straight(6)=p31(3)*straight(13)-p31(1)*straight(15)
93  straight(7)=p31(1)*straight(14)-p31(2)*straight(13)
94  dd=dsqrt(straight(5)*straight(5)+straight(6)*straight(6)+
95  & straight(7)*straight(7))
96  do i=5,7
97  straight(i)=straight(i)/dd
98  enddo
99 !
100 ! determining the inhomogeneous terms
101 !
102  straight(12)=-straight(9)*col(1,1)-straight(10)*col(2,1)-
103  & straight(11)*col(3,1)
104  straight(4)=-straight(1)*col(1,2)-straight(2)*col(2,2)-
105  & straight(3)*col(3,2)
106  straight(8)=-straight(5)*col(1,3)-straight(6)*col(2,3)-
107  & straight(7)*col(3,3)
108  straight(16)=-straight(13)*col(1,1)-straight(14)*col(2,1)-
109  & straight(15)*col(3,1)
110 !
111  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)