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

Go to the source code of this file.

Functions/Subroutines

subroutine straighteq2d (col, straight)
 

Function/Subroutine Documentation

◆ straighteq2d()

subroutine straighteq2d ( real*8, dimension(2,3)  col,
real*8, dimension(9)  straight 
)
20 !
21 ! calculate the equation of the edges of a triangle with
22 ! (col(1,1),col(2,1)),(col(1,2),col(2,2)),(col(1,3),col(2,3))
23 ! as vertices. The equation of the edge
24 ! opposite notet(1) is of the form
25 ! straight(1)*x+straight(2)*y+straight(3)=0, such that the
26 ! vector (straight(1),straight(2)) points outwards; for the edge
27 ! opposite of nodet(2) the equation is
28 ! straight(4)*x+straight(5)*y+straight(6)=0 and for the edge
29 ! oppositie of nodet(3) it is
30 ! straight(7)*x+straight(8)*y+straight(9)=0. Here too, the normals
31 ! (straight(4),straight(5)) and (straight(7),straight(8)) point
32 ! outwards of the triangle.
33 !
34  implicit none
35 !
36  real*8 col(2,3),straight(9),x1,y1,dd
37 !
38 ! edge opposite of 1
39 !
40  x1=col(1,3)-col(1,2)
41  y1=col(2,3)-col(2,2)
42  dd=dsqrt(x1*x1+y1*y1)
43 !
44  straight(1)=y1/dd
45  straight(2)=-x1/dd
46 !
47  straight(3)=-(straight(1)*col(1,3)+
48  & straight(2)*col(2,3))
49 !
50  if(straight(1)*col(1,1)+straight(2)*col(2,1)+
51  & straight(3).gt.0.d0) then
52  straight(1)=-straight(1)
53  straight(2)=-straight(2)
54  straight(3)=-straight(3)
55  endif
56 !
57 ! edge opposite of 2
58 !
59  x1=col(1,1)-col(1,3)
60  y1=col(2,1)-col(2,3)
61  dd=dsqrt(x1*x1+y1*y1)
62 !
63  straight(4)=y1/dd
64  straight(5)=-x1/dd
65 !
66  straight(6)=-(straight(4)*col(1,1)+
67  & straight(5)*col(2,1))
68 !
69  if(straight(4)*col(1,2)+straight(5)*col(2,2)+
70  & straight(6).gt.0.d0) then
71  straight(4)=-straight(4)
72  straight(5)=-straight(5)
73  straight(6)=-straight(6)
74  endif
75 !
76 ! edge opposite of 3
77 !
78  x1=col(1,2)-col(1,1)
79  y1=col(2,2)-col(2,1)
80  dd=dsqrt(x1*x1+y1*y1)
81 !
82  straight(7)=y1/dd
83  straight(8)=-x1/dd
84 !
85  straight(9)=-(straight(7)*col(1,2)+
86  & straight(8)*col(2,2))
87 !
88  if(straight(7)*col(1,3)+straight(8)*col(2,3)+
89  & straight(9).gt.0.d0) then
90  straight(7)=-straight(7)
91  straight(8)=-straight(8)
92  straight(9)=-straight(9)
93  endif
94 !
95  return
static double * x1
Definition: filtermain.c:48
Hosted by OpenAircraft.com, (Michigan UAV, LLC)