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

Go to the source code of this file.

Functions/Subroutines

subroutine neartriangle (p, xn, xo, yo, zo, x, y, z, nx, ny, nz, n, neigh, kneigh, itietri, ntie, straight, imastop, itri, itie)
 

Function/Subroutine Documentation

◆ neartriangle()

subroutine neartriangle ( real*8, dimension(3)  p,
real*8, dimension(3)  xn,
real*8, dimension(*)  xo,
real*8, dimension(*)  yo,
real*8, dimension(*)  zo,
real*8, dimension(*)  x,
real*8, dimension(*)  y,
real*8, dimension(*)  z,
integer, dimension(*)  nx,
integer, dimension(*)  ny,
integer, dimension(*)  nz,
integer  n,
integer, dimension(*)  neigh,
integer  kneigh,
integer, dimension(2,ntie)  itietri,
integer  ntie,
real*8, dimension(16,*)  straight,
integer, dimension(3,*)  imastop,
integer  itri,
integer  itie 
)
22 !
23 ! check for a triangle such that a straight line
24 ! through p and with direction xn cuts this triangle
25 !
26  implicit none
27 !
28  integer nx(*),ny(*),nz(*),n,kneigh,neigh(*),itietri(2,ntie),k,m1,
29  & isol,itri,imastop(3,*),ntie,itie,itel
30 !
31  real*8 p(3),xn(3),xo(*),yo(*),zo(*),x(*),y(*),z(*),straight(16,*),
32  & al,al1,al2
33 !
34 ! determining the kneigh neighboring triangles
35 !
36  call near3d(xo,yo,zo,x,y,z,nx,ny,nz,p(1),p(2),p(3),
37  & n,neigh,kneigh)
38 !
39  isol=0
40 !
41  loop1: do k=1,kneigh
42  itri=neigh(k)+itietri(1,itie)-1
43  itel=0
44  loop2: do
45  itel=itel+1
46  al=-(straight(16,itri)+straight(13,itri)*p(1)
47  & +straight(14,itri)*p(2)+
48  & straight(15,itri)*p(3))/
49  & (straight(13,itri)*xn(1)+straight(14,itri)*xn(2)
50  & +straight(15,itri)*xn(3))
51  do m1=1,3
52  al1=straight(4*m1-3,itri)*p(1)+
53  & straight(4*m1-2,itri)*p(2)+
54  & straight(4*m1-1,itri)*p(3)
55  al2=straight(4*m1-3,itri)*xn(1)+
56  & straight(4*m1-2,itri)*xn(2)+
57  & straight(4*m1-1,itri)*xn(3)
58  if(al1+al*al2+straight(4*m1,itri).gt.1.d-10)then
59  itri=imastop(m1,itri)
60  if(itri.gt.itietri(2,itie) .or.
61  & itri.lt.itietri(1,itie))then
62  if(itri.ne.0)then
63  endif
64  itri=0
65  exit loop1
66  endif
67 
68  if(itel.gt.n) then
69  exit loop1
70  endif
71  if(itri.eq.0) cycle loop1
72  cycle loop2
73  endif
74  enddo
75 !
76  isol=1
77 !
78  exit loop1
79  enddo loop2
80  enddo loop1
81 !
82  if(isol.ne.1) then
83  itri=0
84  endif
85 !
86  return
subroutine near3d(xo, yo, zo, x, y, z, nx, ny, nz, xp, yp, zp, n, neighbor, k)
Definition: near3d.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)