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

Go to the source code of this file.

Functions/Subroutines

subroutine formgradinterpol (ipkon, lakon, kon, nobject, dgdxglob, xinterpol, nnodes, ne, nk, nodedesiinv, objectset)
 

Function/Subroutine Documentation

◆ formgradinterpol()

subroutine formgradinterpol ( integer, dimension(*)  ipkon,
character*8, dimension(*)  lakon,
integer, dimension(*)  kon,
integer  nobject,
real*8, dimension(2,nk,nobject)  dgdxglob,
real*8, dimension(nk,nobject)  xinterpol,
integer, dimension(nk)  nnodes,
integer  ne,
integer  nk,
integer, dimension(nk)  nodedesiinv,
character*81, dimension(4,*)  objectset 
)
21 !
22 ! interpolation of the sensitivitites of the midnodes to the
23 ! corner nodes - only valid for quadratic elements
24 !
25  implicit none
26 !
27  character*81 objectset(4,*)
28  character*8 lakon(*)
29 !
30  integer i,ii,j,l,ielem,nodecor,nk,ne,
31  & nope,indexe,ipkon(*),konl(26),ifaceq(2,20),
32  & ifacet(2,10),ifacew(2,15),kon(*),nnodes(nk),nobject,
33  & nodedesiinv(nk),start
34 !
35  real*8 dgdxglob(2,nk,nobject),xinterpol(nk,nobject)
36 !
37 ! cornernodes next to the midnode for quadratic hex element
38 !
39  data ifaceq /0,0,
40  & 0,0,
41  & 0,0,
42  & 0,0,
43  & 0,0,
44  & 0,0,
45  & 0,0,
46  & 0,0,
47  & 1,2,
48  & 2,3,
49  & 3,4,
50  & 1,4,
51  & 5,6,
52  & 6,7,
53  & 7,8,
54  & 5,8,
55  & 1,5,
56  & 2,6,
57  & 3,7,
58  & 4,8/
59 !
60 ! cornernodes next to the midnode for quadratic tet elements
61 !
62  data ifacet /0,0,
63  & 0,0,
64  & 0,0,
65  & 0,0,
66  & 1,2,
67  & 2,3,
68  & 1,3,
69  & 1,4,
70  & 2,4,
71  & 3,4/
72 !
73 ! cornernodes next to the midnode for quadratic wedge elements
74 !
75  data ifacew /0,0,
76  & 0,0,
77  & 0,0,
78  & 0,0,
79  & 0,0,
80  & 0,0,
81  & 1,2,
82  & 2,3,
83  & 1,3,
84  & 4,5,
85  & 5,6,
86  & 4,6,
87  & 1,4,
88  & 2,5,
89  & 3,6/
90 !
91 ! Loop over all elements
92 !
93  do ielem=1,ne
94 !
95  if(ipkon(ielem).lt.0) cycle
96 !
97 ! Check if element is quadratic
98 !
99  if(lakon(ielem)(4:5).eq.'10') then
100  nope=10
101  start=5
102  elseif(lakon(ielem)(4:5).eq.'20') then
103  nope=20
104  start=9
105  elseif (lakon(ielem)(4:5).eq.'15') then
106  nope=15
107  start=7
108  else
109  cycle
110  endif
111 
112  indexe=ipkon(ielem)
113 !
114  do l=1,nope
115  konl(l)=kon(indexe+l)
116  enddo
117 !
118 ! Loop over all midnodes of the element
119 !
120  do i=start,nope
121 !
122  if(nodedesiinv(konl(i)).le.0) cycle
123 !
124 ! Loop over the 2 neighbors of the midnode
125 !
126  do j=1,2
127  if(lakon(ielem)(4:5).eq.'10') then
128  nodecor=konl(ifacet(j,i))
129  elseif (lakon(ielem)(4:5).eq.'20') then
130  nodecor=konl(ifaceq(j,i))
131  elseif (lakon(ielem)(4:5).eq.'15') then
132  nodecor=konl(ifacew(j,i))
133  endif
134  if(nodedesiinv(nodecor).eq.1) then
135  nnodes(nodecor)=nnodes(nodecor)+1
136  do ii=1,nobject
137  xinterpol(nodecor,ii)=xinterpol(nodecor,ii)+
138  & dgdxglob(1,konl(i),ii)
139  enddo
140  endif
141  enddo
142  nodedesiinv(konl(i))=-1
143  enddo
144  enddo
145 !
146  do i=1,nk
147  if(nnodes(i).gt.0) then
148  do j=1,nobject
149  if(objectset(1,j)(1:9).eq.'THICKNESS') cycle
150  dgdxglob(1,i,j)=xinterpol(i,j)/nnodes(i)
151  enddo
152  endif
153  enddo
154 !
155 ! Correction of nodedesiinv
156 !
157  do i=1,nk
158  if(nodedesiinv(i).eq.-1) then
159  nodedesiinv(i)=1
160  endif
161  enddo
162 !
163  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)