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

Go to the source code of this file.

Functions/Subroutines

subroutine generatetet (kontet, ifatet, ielement, inodfa, ifreefa, planfa, ipofa, nodes, cotet)
 

Function/Subroutine Documentation

◆ generatetet()

subroutine generatetet ( integer, dimension(4,*)  kontet,
integer, dimension(4,*)  ifatet,
integer  ielement,
integer, dimension(4,*)  inodfa,
integer  ifreefa,
real*8, dimension(4,*)  planfa,
integer, dimension(*)  ipofa,
integer, dimension(4)  nodes,
real*8, dimension(3,*)  cotet 
)
21 !
22  implicit none
23 !
24  integer nodes(4),nodef(3),kontet(4,*),ifatet(4,*),inodfa(4,*),
25  & ipofa(*),ifreetet,ifreefa,ifree,ig(3,4),j,
26  & n1,n2,n3,n4,nxa,nxb,nxc,nxd,nya,nyb,nyc,nyd,nza,nzb,nzc,
27  & nzd,nx1,nx2,ny1,ny2,nz1,nz2,index,j1,j2,j3,i,n,kflag,idum,
28  & node,indexold,ielement,ndx,ndy,ndz
29 !
30  real*8 planfa(4,*),cotet(3,*),dd
31 !
32  data ig /2,3,4,3,4,1,4,1,2,1,2,3/
33 !
34 ! updating the node per element relationship
35 !
36  do i=1,4
37  kontet(i,ielement)=nodes(i)
38  enddo
39 !
40 ! creating faces
41 !
42  do i=1,4
43  nodef(1)=nodes(ig(1,i))
44  nodef(2)=nodes(ig(2,i))
45  nodef(3)=nodes(ig(3,i))
46 !
47  n=3
48  kflag=1
49  call isortii(nodef,idum,n,kflag)
50 !
51 ! check whether face already exists
52 !
53  node=nodef(1)
54  index=ipofa(node)
55 !
56  do
57  if(index.eq.0) exit
58  if((inodfa(2,index).eq.nodef(2)).and.
59  & (inodfa(3,index).eq.nodef(3))) exit
60  indexold=index
61  index=inodfa(4,index)
62  enddo
63 !
64  if(index.eq.0) then
65  index=ifreefa
66  ifreefa=inodfa(4,ifreefa)
67  if(ifreefa.eq.0) then
68  write(*,*) '*ERROR in generatet: increase the dimension'
69  write(*,*) ' of inodfa'
70  endif
71  inodfa(1,index)=nodef(1)
72  inodfa(2,index)=nodef(2)
73  inodfa(3,index)=nodef(3)
74  inodfa(4,index)=0
75  if(ipofa(node).eq.0) then
76  ipofa(node)=index
77  else
78  inodfa(4,indexold)=index
79  endif
80 !
81  call planeeq(cotet,nodef,planfa(1,index))
82 !
83  endif
84 !
85 ! the face number in ifatet is negative, if the equation
86 ! of the face plane is such, that its value in the
87 ! remaining node of the tetrahedron is negative
88 !
89  dd=planfa(1,index)*cotet(1,nodes(i))+
90  & planfa(2,index)*cotet(2,nodes(i))+
91  & planfa(3,index)*cotet(3,nodes(i))+
92  & planfa(4,index)
93  if(dabs(dd).lt.1.d-10) then
94  write(*,*) '*WARNING in generatetet: element ',ielement
95  write(*,*) ' is extremely flat'
96  write(*,*) ' the element is deleted'
97  ielement=ielement-1
98  return
99  endif
100  if(dd.ge.0.d0) then
101  ifatet(i,ielement)=index
102  else
103  ifatet(i,ielement)=-index
104  endif
105  enddo
106 !
107  return
static ITG * nx1
Definition: filtermain.c:39
static ITG * nz1
Definition: filtermain.c:39
subroutine isortii(ix, iy, n, kflag)
Definition: isortii.f:6
subroutine nodes(inpc, textpart, co, nk, nk_, set, istartset, iendset, ialset, nset, nset_, nalset, nalset_, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: nodes.f:22
subroutine planeeq(cotet, nodef, planfal)
Definition: planeeq.f:20
static ITG * ny1
Definition: filtermain.c:39
Hosted by OpenAircraft.com, (Michigan UAV, LLC)