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

Go to the source code of this file.

Functions/Subroutines

subroutine geomview (vold, co, pmid, e1, e2, e3, kontri, area, cs, mcs, inocs, ntrit, nk, mi, sidemean)
 

Function/Subroutine Documentation

◆ geomview()

subroutine geomview ( real*8, dimension(0:mi(2),*)  vold,
real*8, dimension(3,*)  co,
real*8, dimension(3,*)  pmid,
real*8, dimension(3,*)  e1,
real*8, dimension(3,*)  e2,
real*8, dimension(4,*)  e3,
integer, dimension(4,*)  kontri,
real*8, dimension(*)  area,
real*8, dimension(17,*)  cs,
integer  mcs,
integer, dimension(*)  inocs,
integer  ntrit,
integer  nk,
integer, dimension(*)  mi,
real*8  sidemean 
)
28 !
29  implicit none
30 !
31 ! change following line if nlabel is increased
32 !
33  character*87 label(47)
34 !
35  integer i,j,l,mi(*),kontri(4,*),i1,mcs,inocs(*),i2,i3,
36  & ntrit,jj,is,m,nkt,icntrl,imag,nk,nlabel
37 !
38  real*8 vold(0:mi(2),*),co(3,*),
39  & pmid(3,*),e3(4,*),e1(3,*),e2(3,*),p1(3),p2(3),p3(3),
40  & cs(17,*),area(*),dd,p21(3),p32(3),
41  & fn,stn,qfn,een,t(3),sidemean,emn
42 !
43  write(*,*) 'Calculating the viewfactors'
44  write(*,*)
45 !
46 ! change following line if nlabel is increased and the dimension
47 ! of field label above!
48 !
49  nlabel=47
50 !
51 ! updating the displacements for cyclic symmetric structures
52 !
53  if(mcs.gt.0) then
54  nkt=0
55  do i=1,mcs
56  if(int(cs(1,i)).gt.nkt) nkt=int(cs(1,i))
57  enddo
58  nkt=nk*nkt
59  do i=1,nlabel
60  do l=1,87
61  label(i)(l:l)=' '
62  enddo
63  enddo
64  label(1)(1:1)='U'
65  imag=0
66  icntrl=2
67  call rectcyl(co,vold,fn,stn,qfn,een,cs,nk,icntrl,t,
68  & label,imag,mi,emn)
69 
70  do jj=0,mcs-1
71  is=cs(1,jj+1)
72 !
73  do i=1,is-1
74  do l=1,nk
75  if(inocs(l).ne.jj) cycle
76  do m=1,mi(2)
77  vold(m,l+nk*i)=vold(m,l)
78  enddo
79  enddo
80  enddo
81  enddo
82  icntrl=-2
83  call rectcyl(co,vold,fn,stn,qfn,een,cs,nkt,icntrl,t,
84  & label,imag,mi,emn)
85  endif
86 !
87 ! calculating the momentaneous center of the triangles,
88 ! area of the triangles and normal to the triangles
89 !
90  sidemean=0.d0
91  do i=1,ntrit
92  i1=kontri(1,i)
93  if(i1.eq.0) cycle
94  i2=kontri(2,i)
95  i3=kontri(3,i)
96  do j=1,3
97  p1(j)=co(j,i1)+vold(j,i1)
98  p2(j)=co(j,i2)+vold(j,i2)
99  p3(j)=co(j,i3)+vold(j,i3)
100  pmid(j,i)=(p1(j)+p2(j)+p3(j))/3.d0
101  p21(j)=p2(j)-p1(j)
102  p32(j)=p3(j)-p2(j)
103  enddo
104 !
105 ! normal to the triangle
106 !
107  e3(1,i)=p21(2)*p32(3)-p32(2)*p21(3)
108  e3(2,i)=p21(3)*p32(1)-p32(3)*p21(1)
109  e3(3,i)=p21(1)*p32(2)-p32(1)*p21(2)
110 !
111  dd=dsqrt(e3(1,i)*e3(1,i)+e3(2,i)*e3(2,i)+
112  & e3(3,i)*e3(3,i))
113 !
114 ! check for degenerated triangles
115 !
116  if(dd.lt.1.d-20) then
117  area(i)=0.d0
118  cycle
119  endif
120 !
121  do j=1,3
122  e3(j,i)=e3(j,i)/dd
123  enddo
124 !
125 ! area of the triangle
126 !
127  area(i)=dd/2.d0
128 !
129 ! unit vector parallel to side 1-2
130 !
131  dd=dsqrt(p21(1)*p21(1)+p21(2)*p21(2)+p21(3)*p21(3))
132  sidemean=sidemean+dd
133  do j=1,3
134  e1(j,i)=p21(j)/dd
135  enddo
136 !
137 ! unit vector orthogonal to e1 and e3
138 !
139  e2(1,i)=e3(2,i)*e1(3,i)-e3(3,i)*e1(2,i)
140  e2(2,i)=e3(3,i)*e1(1,i)-e3(1,i)*e1(3,i)
141  e2(3,i)=e3(1,i)*e1(2,i)-e3(2,i)*e1(1,i)
142 !
143 ! the fourth component in e3 is the constant term in the
144 ! equation of the triangle plane in the form
145 ! e3(1)*x+e3(2)*y+e3(3)*z+e3(4)=0
146 !
147  e3(4,i)=-(e3(1,i)*p1(1)+e3(2,i)*p1(2)
148  & +e3(3,i)*p1(3))
149  enddo
150  sidemean=sidemean/ntrit
151 !
152  return
subroutine rectcyl(co, v, fn, stn, qfn, een, cs, n, icntrl, t, filab, imag, mi, emn)
Definition: rectcyl.f:21
Hosted by OpenAircraft.com, (Michigan UAV, LLC)