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

Go to the source code of this file.

Functions/Subroutines

subroutine straighteq3dpen (col, straight, xnor, noeq)
 

Function/Subroutine Documentation

◆ straighteq3dpen()

subroutine straighteq3dpen ( real*8, dimension(3,3)  col,
real*8, dimension(16)  straight,
real*8, dimension(3,3)  xnor,
integer  noeq 
)
20 !
21 ! calculate the equation of the planes through the
22 ! edges of a triangle and perpendicular to the representative
23 ! normal of each triangle edge together
24 ! with the plane of the triangle itself with
25 ! (col(1,1),col(2,1),col(3,1)),(col(1,2),col(2,2),col(3,2)),
26 ! (col(1,3),col(2,3),col(3,3))
27 ! as vertices (nodet(1),nodet(2),nodet(3)).
28 ! The equation of the plane through the edge
29 ! opposite nodet(1) is of the form
30 ! straight(1)*x+straight(2)*y+straight(3)*z+straight(4)=0, such that the
31 ! vector (straight(1),straight(2),straight(3)) points outwards;
32 ! for the edge opposite of nodet(2) the equation is
33 ! straight(5)*x+straight(6)*y+straight(7)*z+straight(8)=0 and for the edge
34 ! oppositie of nodet(3) it is
35 ! straight(9)*x+straight(10)*y+straight(11)*z+straight(12)=0.
36 ! Here too, the normals
37 ! (straight(5),straight(6),straight(7)) and
38 ! (straight(9),straight(10),straight(11)) point
39 ! outwards of the triangle. The equation of the triangle plane is
40 ! straight(13)*x+straight(14)*y+straight(15)*z+straight(16)=0 such
41 ! that the triangle is numbered clockwise when looking in the
42 ! direction of vector (straight(13),straight(14),straight(15)).
43 ! edgenor(*,1) is the representative normal for the triangle edge going
44 ! through the nodes 2-3, edgenor(*,2) for the edge 3-1 and
45 ! edgenor(*,3) for the edge 1-2
46 !
47 ! noeq is the triangle nodes for which the opposite side should not get
48 ! an equation (all coefficients zero; this is needed for plane strain,
49 ! plane stress and axisymmetric elements
50 !
51  implicit none
52 !
53  integer i,noeq
54 !
55  real*8 col(3,3),straight(16),p12(3),p23(3),p31(3),dd,scal1,
56  & scal2,xp12(3),xp23(3),xp31(3),xq12(3),xq23(3),xq31(3),
57  & xnor(3,3),dxp,dxq,edgenor(3,3),dd12,dd23,dd31
58 !
59 ! sides of the triangle
60 !
61  do i=1,3
62  p12(i)=col(i,2)-col(i,1)
63  p23(i)=col(i,3)-col(i,2)
64  p31(i)=col(i,1)-col(i,3)
65  enddo
66  dd12=p12(1)*p12(1)+p12(2)*p12(2)+p12(3)*p12(3)
67  dd23=p23(1)*p23(1)+p23(2)*p23(2)+p23(3)*p23(3)
68  dd31=p31(1)*p31(1)+p31(2)*p31(2)+p31(3)*p31(3)
69 !
70 ! calculating the representative normal for each triangle edge
71 ! edgenor(*,1) for p23 | edgenor(*,2) for p31 | edgenor(*,3) for p12
72 !
73  scal1=(xnor(1,2)*p23(1)+xnor(2,2)*p23(2)+xnor(3,2)*p23(3))/dd23
74  scal2=(xnor(1,3)*p23(1)+xnor(2,3)*p23(2)+xnor(3,3)*p23(3))/dd23
75  do i=1,3
76  xp23(i)=xnor(i,2)-scal1*p23(i)
77  xq23(i)=xnor(i,3)-scal2*p23(i)
78  enddo
79  dxp=dsqrt(xp23(1)*xp23(1)+xp23(2)*xp23(2)+xp23(3)*xp23(3))
80  dxq=dsqrt(xq23(1)*xq23(1)+xq23(2)*xq23(2)+xq23(3)*xq23(3))
81  do i=1,3
82  xp23(i)=xp23(i)/dxp
83  xq23(i)=xq23(i)/dxq
84  enddo
85 !
86  scal1=(xnor(1,3)*p31(1)+xnor(2,3)*p31(2)+xnor(3,3)*p31(3))/dd31
87  scal2=(xnor(1,1)*p31(1)+xnor(2,1)*p31(2)+xnor(3,1)*p31(3))/dd31
88  do i=1,3
89  xp31(i)=xnor(i,3)-scal1*p31(i)
90  xq31(i)=xnor(i,1)-scal2*p31(i)
91  enddo
92  dxp=dsqrt(xp31(1)*xp31(1)+xp31(2)*xp31(2)+xp31(3)*xp31(3))
93  dxq=dsqrt(xq31(1)*xq31(1)+xq31(2)*xq31(2)+xq31(3)*xq31(3))
94  do i=1,3
95  xp31(i)=xp31(i)/dxp
96  xq31(i)=xq31(i)/dxq
97  enddo
98 !
99  scal1=(xnor(1,1)*p12(1)+xnor(2,1)*p12(2)+xnor(3,1)*p12(3))/dd12
100  scal2=(xnor(1,2)*p12(1)+xnor(2,2)*p12(2)+xnor(3,2)*p12(3))/dd12
101  do i=1,3
102  xp12(i)=xnor(i,1)-scal1*p12(i)
103  xq12(i)=xnor(i,2)-scal2*p12(i)
104  enddo
105  dxp=dsqrt(xp12(1)*xp12(1)+xp12(2)*xp12(2)+xp12(3)*xp12(3))
106  dxq=dsqrt(xq12(1)*xq12(1)+xq12(2)*xq12(2)+xq12(3)*xq12(3))
107  do i=1,3
108  xp12(i)=xp12(i)/dxp
109  xq12(i)=xq12(i)/dxq
110  enddo
111 !
112  do i=1,3
113  edgenor(i,1)=xp23(i)+xq23(i)
114  edgenor(i,2)=xp31(i)+xq31(i)
115  edgenor(i,3)=xp12(i)+xq12(i)
116  enddo
117 !
118 ! normalized vector normal to each side of the triangle
119 !
120  dd=dsqrt(edgenor(1,1)*edgenor(1,1)+edgenor(2,1)*edgenor(2,1)
121  & +edgenor(3,1)*edgenor(3,1))
122  do i=1,3
123  edgenor(i,1)=edgenor(i,1)/dd
124  enddo
125  dd=dsqrt(edgenor(1,2)*edgenor(1,2)+edgenor(2,2)*edgenor(2,2)
126  & +edgenor(3,2)*edgenor(3,2))
127  do i=1,3
128  edgenor(i,2)=edgenor(i,2)/dd
129  enddo
130  dd=dsqrt(edgenor(1,3)*edgenor(1,3)+edgenor(2,3)*edgenor(2,3)
131  & +edgenor(3,3)*edgenor(3,3))
132  do i=1,3
133  edgenor(i,3)=edgenor(i,3)/dd
134  enddo
135 !
136 ! normalized vector normal to the triangle: xn = p12 x p23
137 !
138  straight(13)=p12(2)*p23(3)-p12(3)*p23(2)
139  straight(14)=p12(3)*p23(1)-p12(1)*p23(3)
140  straight(15)=p12(1)*p23(2)-p12(2)*p23(1)
141  dd=dsqrt(straight(13)*straight(13)+straight(14)*straight(14)+
142  & straight(15)*straight(15))
143  do i=13,15
144  straight(i)=straight(i)/dd
145  enddo
146 !
147 ! p12 x edgenor(*,3)
148 !
149  if(noeq.ne.3) then
150  straight(9)=p12(2)*edgenor(3,3)-p12(3)*edgenor(2,3)
151  straight(10)=p12(3)*edgenor(1,3)-p12(1)*edgenor(3,3)
152  straight(11)=p12(1)*edgenor(2,3)-p12(2)*edgenor(1,3)
153  dd=dsqrt(straight(9)*straight(9)+straight(10)*straight(10)+
154  & straight(11)*straight(11))
155  do i=9,11
156  straight(i)=straight(i)/dd
157  enddo
158  else
159  do i=9,11
160  straight(i)=0.d0
161  enddo
162  endif
163 !
164 ! p23 x edgenor(*,1)
165 !
166  if(noeq.ne.1) then
167  straight(1)=p23(2)*edgenor(3,1)-p23(3)*edgenor(2,1)
168  straight(2)=p23(3)*edgenor(1,1)-p23(1)*edgenor(3,1)
169  straight(3)=p23(1)*edgenor(2,1)-p23(2)*edgenor(1,1)
170  dd=dsqrt(straight(1)*straight(1)+straight(2)*straight(2)+
171  & straight(3)*straight(3))
172  do i=1,3
173  straight(i)=straight(i)/dd
174  enddo
175  else
176  do i=1,3
177  straight(i)=0.d0
178  enddo
179  endif
180 !
181 ! p31 x edgenor(*,2)
182 !
183  if(noeq.ne.2) then
184  straight(5)=p31(2)*edgenor(3,2)-p31(3)*edgenor(2,2)
185  straight(6)=p31(3)*edgenor(1,2)-p31(1)*edgenor(3,2)
186  straight(7)=p31(1)*edgenor(2,2)-p31(2)*edgenor(1,2)
187  dd=dsqrt(straight(5)*straight(5)+straight(6)*straight(6)+
188  & straight(7)*straight(7))
189  do i=5,7
190  straight(i)=straight(i)/dd
191  enddo
192  else
193  do i=5,7
194  straight(i)=0.d0
195  enddo
196  endif
197 !
198 ! determining the inhomogeneous terms
199 !
200  straight(12)=-straight(9)*col(1,1)-straight(10)*col(2,1)-
201  & straight(11)*col(3,1)
202  straight(4)=-straight(1)*col(1,2)-straight(2)*col(2,2)-
203  & straight(3)*col(3,2)
204  straight(8)=-straight(5)*col(1,3)-straight(6)*col(2,3)-
205  & straight(7)*col(3,3)
206  straight(16)=-straight(13)*col(1,1)-straight(14)*col(2,1)-
207  & straight(15)*col(3,1)
208 !
209  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)