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

Go to the source code of this file.

Functions/Subroutines

subroutine pretransition (ipkon, kon, lakon, co, nk, ipoface, nodface, nodedesiinv, xo, yo, zo, x, y, z, nx, ny, nz, ifree)
 

Function/Subroutine Documentation

◆ pretransition()

subroutine pretransition ( integer, dimension(*)  ipkon,
integer, dimension(*)  kon,
character*8, dimension(*)  lakon,
real*8, dimension(3,*)  co,
integer  nk,
integer, dimension(*)  ipoface,
integer, dimension(5,*)  nodface,
integer, dimension(*)  nodedesiinv,
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  ifree 
)
21 !
22  implicit none
23 !
24  character*8 lakon(*)
25 !
26  integer j,nelem,jface,indexe,ipkon(*),kon(*),nopem,
27  & ifaceq(8,6),ifacet(6,4),ifacew1(4,5),ifacew2(8,5),
28  & konl(26),ipoface(*),nodface(5,*),nodedesiinv(*),
29  & nopesurf(9),ifree,nope,m,k,nk,nx(*),ny(*),nz(*),
30  & actnode,kflag,ndesinode
31 !
32  real*8 co(3,*),xo(*),yo(*),zo(*),x(*),y(*),z(*)
33 !
34 ! nodes per face for hex elements
35 !
36  data ifaceq /4,3,2,1,11,10,9,12,
37  & 5,6,7,8,13,14,15,16,
38  & 1,2,6,5,9,18,13,17,
39  & 2,3,7,6,10,19,14,18,
40  & 3,4,8,7,11,20,15,19,
41  & 4,1,5,8,12,17,16,20/
42 !
43 ! nodes per face for tet elements
44 !
45  data ifacet /1,3,2,7,6,5,
46  & 1,2,4,5,9,8,
47  & 2,3,4,6,10,9,
48  & 1,4,3,8,10,7/
49 !
50 ! nodes per face for linear wedge elements
51 !
52  data ifacew1 /1,3,2,0,
53  & 4,5,6,0,
54  & 1,2,5,4,
55  & 2,3,6,5,
56  & 3,1,4,6/
57 !
58 ! nodes per face for quadratic wedge elements
59 !
60  data ifacew2 /1,3,2,9,8,7,0,0,
61  & 4,5,6,10,11,12,0,0,
62  & 1,2,5,4,7,14,10,13,
63  & 2,3,6,5,8,15,11,14,
64  & 3,1,4,6,9,13,12,15/
65 !
66 !
67 ! all external nodes which are not designvariables are put in a set
68 !
69  ifree=0
70  do j=1,nk
71 !
72  if(ipoface(j).eq.0) cycle
73  indexe=ipoface(j)
74 !
75  do
76 !
77  nelem=nodface(3,indexe)
78  jface=nodface(4,indexe)
79 !
80 ! nopem: # of nodes in the surface
81 ! nope: # of nodes in the element
82 !
83  if(lakon(nelem)(4:4).eq.'8') then
84  nopem=4
85  nope=8
86  elseif(lakon(nelem)(4:5).eq.'20') then
87  nopem=8
88  nope=20
89  elseif(lakon(nelem)(4:5).eq.'10') then
90  nopem=6
91  nope=10
92  elseif(lakon(nelem)(4:4).eq.'4') then
93  nopem=3
94  nope=4
95  elseif(lakon(nelem)(4:4).eq.'6') then
96  nope=6
97  if(jface.le.2) then
98  nopem=3
99  else
100  nopem=4
101  endif
102  elseif(lakon(nelem)(4:5).eq.'15') then
103  nope=15
104  if(jface.le.2) then
105  nopem=6
106  else
107  nopem=8
108  endif
109  endif
110 !
111 ! get node numbers of actual surface
112 !
113  do k=1,nope
114  konl(k)=kon(ipkon(nelem)+k)
115  enddo
116 !
117  ndesinode=0
118  if((nope.eq.20).or.(nope.eq.8)) then
119  do m=1,nopem
120  actnode=konl(ifaceq(m,jface))
121  if(nodedesiinv(actnode).ne.1) then
122  ndesinode=ndesinode+1
123  nopesurf(ndesinode)=actnode
124  endif
125  enddo
126  elseif((nope.eq.10).or.(nope.eq.4)) then
127  do m=1,nopem
128  actnode=konl(ifacet(m,jface))
129  if(nodedesiinv(actnode).ne.1) then
130  ndesinode=ndesinode+1
131  nopesurf(ndesinode)=actnode
132  endif
133  enddo
134  elseif(nope.eq.15) then
135  do m=1,nopem
136  actnode=konl(ifacew2(m,jface))
137  if(nodedesiinv(actnode).ne.1) then
138  ndesinode=ndesinode+1
139  nopesurf(ndesinode)=actnode
140  endif
141  enddo
142  else
143  do m=1,nopem
144  actnode=konl(ifacew1(m,jface))
145  if(nodedesiinv(actnode).ne.1) then
146  ndesinode=ndesinode+1
147  nopesurf(ndesinode)=actnode
148  endif
149  enddo
150  endif
151 !
152 ! creation of the sets
153 !
154  if((ndesinode.gt.0).and.(ndesinode.lt.nopem)) then
155  do m=1,ndesinode
156  actnode=nopesurf(m)
157  if(nodedesiinv(actnode).eq.-1) cycle
158  ifree=ifree+1
159  xo(ifree)=co(1,actnode)
160  x(ifree)=xo(ifree)
161  nx(ifree)=ifree
162  yo(ifree)=co(2,actnode)
163  y(ifree)=yo(ifree)
164  ny(ifree)=ifree
165  zo(ifree)=co(3,actnode)
166  z(ifree)=zo(ifree)
167  nz(ifree)=ifree
168  nodedesiinv(actnode)=-1
169  enddo
170  endif
171  indexe=nodface(5,indexe)
172  if(indexe.eq.0) exit
173  enddo
174  enddo
175 !
176 ! Correction of nodedesiinv
177 !
178  do m=1,nk
179  if(nodedesiinv(m).eq.-1) then
180  nodedesiinv(m)=0
181  endif
182  enddo
183 !
184 ! Sorting of node set w.r.t. coordinates
185 !
186  kflag=2
187  call dsort(x,nx,ifree,kflag)
188  call dsort(y,ny,ifree,kflag)
189  call dsort(z,nz,ifree,kflag)
190 !
191  return
subroutine dsort(dx, iy, n, kflag)
Definition: dsort.f:6
Hosted by OpenAircraft.com, (Michigan UAV, LLC)