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

Go to the source code of this file.

Functions/Subroutines

subroutine temploaddiff (xforcold, xforc, xforcact, iamforc, nforc, xloadold, xload, xloadact, iamload, nload, ibody, xbody, nbody, xbodyold, xbodyact, t1old, t1, t1act, iamt1, nk, amta, namta, nam, ampli, time, reltime, ttime, dtime, ithermal, nmethod, xbounold, xboun, xbounact, iamboun, nboun, nodeboun, ndirboun, nodeforc, ndirforc, istep, iinc, co, vold, itg, ntg, amname, ikboun, ilboun, nelemload, sideload, mi, xforcdiff, xloaddiff, xbodydiff, t1diff, xboundiff, iabsload, iprescribedboundary, ntrans, trab, inotr, veold, nactdof, bcont, fn, ipobody, iponoel, inoel)
 

Function/Subroutine Documentation

◆ temploaddiff()

subroutine temploaddiff ( real*8, dimension(*)  xforcold,
real*8, dimension(*)  xforc,
real*8, dimension(*)  xforcact,
integer, dimension(*)  iamforc,
integer  nforc,
real*8, dimension(2,*)  xloadold,
real*8, dimension(2,*)  xload,
real*8, dimension(2,*)  xloadact,
integer, dimension(2,*)  iamload,
integer  nload,
integer, dimension(3,*)  ibody,
real*8, dimension(7,*)  xbody,
integer  nbody,
real*8, dimension(7,*)  xbodyold,
real*8, dimension(7,*)  xbodyact,
real*8, dimension(*)  t1old,
real*8, dimension(*)  t1,
real*8, dimension(*)  t1act,
integer, dimension(*)  iamt1,
integer  nk,
real*8, dimension(2,*)  amta,
integer, dimension(3,*)  namta,
integer  nam,
real*8, dimension(*)  ampli,
real*8  time,
real*8  reltime,
real*8  ttime,
real*8  dtime,
integer  ithermal,
integer  nmethod,
real*8, dimension(*)  xbounold,
real*8, dimension(*)  xboun,
real*8, dimension(*)  xbounact,
integer, dimension(*)  iamboun,
integer  nboun,
integer, dimension(*)  nodeboun,
integer, dimension(*)  ndirboun,
integer, dimension(2,*)  nodeforc,
integer, dimension(*)  ndirforc,
integer  istep,
integer  iinc,
real*8, dimension(3,*)  co,
real*8, dimension(0:mi(2),*)  vold,
integer, dimension(*)  itg,
integer  ntg,
character*80, dimension(*)  amname,
integer, dimension(*)  ikboun,
integer, dimension(*)  ilboun,
integer, dimension(2,*)  nelemload,
character*20, dimension(*)  sideload,
integer, dimension(*)  mi,
real*8, dimension(*)  xforcdiff,
real*8, dimension(2,*)  xloaddiff,
real*8, dimension(7,*)  xbodydiff,
real*8, dimension(*)  t1diff,
real*8, dimension(*)  xboundiff,
integer  iabsload,
integer  iprescribedboundary,
integer  ntrans,
real*8, dimension(7,*)  trab,
integer, dimension(2,*)  inotr,
real*8, dimension(0:mi(2),*)  veold,
integer, dimension(0:mi(2),*)  nactdof,
real*8, dimension(*)  bcont,
real*8, dimension(0:mi(2),*)  fn,
integer, dimension(2,*)  ipobody,
integer, dimension(*)  iponoel,
integer, dimension(2,*)  inoel 
)
29 !
30 ! calculates the loading at a given time and the difference with
31 ! the last call of temploaddiff: is needed in the modal dynamic
32 ! procedure (dyna.c, dynacont.c; speeds up the calculation)
33 !
34  implicit none
35 !
36  logical gasnode
37 !
38  character*20 sideload(*)
39  character*80 amname(*)
40 !
41  integer iamforc(*),iamload(2,*),iamt1(*),nelemload(2,*),
42  & nam,i,istart,iend,id,nforc,nload,nk,namta(3,*),ithermal,
43  & nmethod,iamt1i,iamboun(*),nboun,iamforci,iambouni,
44  & iamloadi1,iamloadi2,ibody(3,*),itg(*),ntg,idof,
45  & nbody,iambodyi,nodeboun(*),ndirboun(*),nodeforc(2,*),
46  & ndirforc(*),istep,iinc,msecpt,node,j,ikboun(*),ilboun(*),
47  & ipresboun,mi(*),iabsload,iprescribedboundary,ntrans,inotr(2,*),
48  & nactdof(0:mi(2),*),ipobody(2,*),iponoel(*),inoel(2,*)
49 !
50  real*8 xforc(*),xforcact(*),xload(2,*),xloadact(2,*),
51  & t1(*),t1act(*),amta(2,*),ampli(*),time,xforcdiff(*),
52  & xforcold(*),xloadold(2,*),t1old(*),reltime,xloaddiff(2,*),
53  & xbounold(*),xboun(*),xbounact(*),ttime,dtime,reftime,
54  & xbody(7,*),xbodyold(7,*),xbodydiff(7,*),t1diff(*),
55  & xbodyact(7,*),co(3,*),vold(0:mi(2),*),abqtime(2),coords(3),
56  & xboundiff(*),trab(7,*), veold(0:mi(2),*),bcont(*),fn(0:mi(2),*)
57 !
58  data msecpt /1/
59 !
60 ! if an amplitude is active, the loading is scaled according to
61 ! the actual time. If no amplitude is active, then the load is
62 ! - scaled according to the relative time for a static step
63 ! - applied as a step loading for a dynamic step
64 !
65 ! calculating all amplitude values for the current time
66 !
67  do i=1,nam
68  if(namta(3,i).lt.0) then
69  reftime=ttime+time
70  else
71  reftime=time
72  endif
73  if(abs(namta(3,i)).ne.i) then
74  reftime=reftime-amta(1,namta(1,i))
75  istart=namta(1,abs(namta(3,i)))
76  iend=namta(2,abs(namta(3,i)))
77  if(istart.eq.0) then
78  call uamplitude(reftime,amname(namta(3,i)),ampli(i))
79  cycle
80  endif
81  else
82  istart=namta(1,i)
83  iend=namta(2,i)
84  if(istart.eq.0) then
85  call uamplitude(reftime,amname(i),ampli(i))
86  cycle
87  endif
88  endif
89  call identamta(amta,reftime,istart,iend,id)
90  if(id.lt.istart) then
91  ampli(i)=amta(2,istart)
92  elseif(id.eq.iend) then
93  ampli(i)=amta(2,iend)
94  else
95  ampli(i)=amta(2,id)+(amta(2,id+1)-amta(2,id))
96  & *(reftime-amta(1,id))/(amta(1,id+1)-amta(1,id))
97  endif
98  enddo
99 !
100 ! scaling the boundary conditions
101 !
102  if(iprescribedboundary.eq.1) then
103  do i=1,nboun
104  if((xboun(i).lt.1.2357111318d0).and.
105  & (xboun(i).gt.1.2357111316d0)) then
106 !
107 ! user subroutine for boundary conditions
108 !
109  node=nodeboun(i)
110 !
111 ! check whether node is a gasnode
112 !
113  gasnode=.false.
114  call nident(itg,node,ntg,id)
115  if(id.gt.0) then
116  if(itg(id).eq.node) then
117  gasnode=.true.
118  endif
119  endif
120 !
121  abqtime(1)=time
122  abqtime(2)=ttime+time
123 !
124 ! a gasnode cannot move (displacement DOFs are used
125 ! for other purposes, e.g. mass flow and pressure)
126 !
127  if(gasnode) then
128  do j=1,3
129  coords(j)=co(j,node)
130  enddo
131  else
132  do j=1,3
133  coords(j)=co(j,node)+vold(j,node)
134  enddo
135  endif
136 !
137  if(iabsload.eq.0) then
138  xboundiff(i)=xbounact(i)
139  else
140  xboundiff(i)=xbounact(i)-xboundiff(i)
141  endif
142  if(ndirboun(i).eq.0) then
143  call utemp(xbounact(i),msecpt,istep,iinc,abqtime,node,
144  & coords,vold,mi,iponoel,inoel,
145  & ipobody,xbodyact,ibody)
146  else
147  call uboun(xbounact(i),istep,iinc,abqtime,node,
148  & ndirboun(i),coords,vold,mi,iponoel,inoel,
149  & ipobody,xbodyact,ibody)
150  endif
151  xboundiff(i)=xbounact(i)-xboundiff(i)
152  cycle
153  endif
154 !
155  if(nam.gt.0) then
156  iambouni=iamboun(i)
157  else
158  iambouni=0
159  endif
160 !
161  if(iabsload.eq.0) then
162  xboundiff(i)=xbounact(i)
163  else
164  xboundiff(i)=xbounact(i)-xboundiff(i)
165  endif
166  if(iambouni.gt.0) then
167  xbounact(i)=xboun(i)*ampli(iambouni)
168  elseif(nmethod.eq.1) then
169  xbounact(i)=xbounold(i)+
170  & (xboun(i)-xbounold(i))*reltime
171  else
172  xbounact(i)=xboun(i)
173  endif
174  xboundiff(i)=xbounact(i)-xboundiff(i)
175  enddo
176  endif
177 !
178 ! scaling the loading
179 !
180  do i=1,nforc
181  if(ndirforc(i).eq.0) then
182  if((xforc(i).lt.1.2357111318d0).and.
183  & (xforc(i).gt.1.2357111316d0)) then
184  iabsload=2
185 !
186 ! user subroutine for the concentrated heat flux
187 !
188  node=nodeforc(1,i)
189 !
190 ! check whether node is a gasnode
191 !
192  gasnode=.false.
193  call nident(itg,node,ntg,id)
194  if(id.gt.0) then
195  if(itg(id).eq.node) then
196  gasnode=.true.
197  endif
198  endif
199 !
200  abqtime(1)=time
201  abqtime(2)=ttime+time
202 !
203 ! a gasnode cannot move (displacement DOFs are used
204 ! for other purposes, e.g. mass flow and pressure)
205 !
206  if(gasnode) then
207  do j=1,3
208  coords(j)=co(j,node)
209  enddo
210  else
211  do j=1,3
212  coords(j)=co(j,node)+vold(j,node)
213  enddo
214  endif
215 !
216  if(iabsload.eq.0) then
217  xforcdiff(i)=xforcact(i)
218  else
219  xforcdiff(i)=xforcact(i)-xforcdiff(i)
220  endif
221  call cflux(xforcact(i),msecpt,istep,iinc,abqtime,node,
222  & coords,vold,mi)
223  xforcdiff(i)=xforcact(i)-xforcdiff(i)
224  cycle
225  endif
226  else
227  if((xforc(i).lt.1.2357111318d0).and.
228  & (xforc(i).gt.1.2357111316d0)) then
229  iabsload=2
230 !
231 ! user subroutine for the concentrated force
232 !
233  node=nodeforc(1,i)
234 !
235  abqtime(1)=time
236  abqtime(2)=ttime+time
237 !
238  do j=1,3
239  coords(j)=co(j,node)+vold(j,node)
240  enddo
241 !
242  if(iabsload.eq.0) then
243  xforcdiff(i)=xforcact(i)
244  else
245  xforcdiff(i)=xforcact(i)-xforcdiff(i)
246  endif
247  call cload(xforcact(i),istep,iinc,abqtime,node,
248  & ndirforc(i),coords,vold,mi,ntrans,trab,inotr,veold)
249  xforcdiff(i)=xforcact(i)-xforcdiff(i)
250  cycle
251  endif
252  endif
253  if(nam.gt.0) then
254  iamforci=iamforc(i)
255  else
256  iamforci=0
257  endif
258 !
259  if(iabsload.eq.0) then
260  xforcdiff(i)=xforcact(i)
261  else
262  xforcdiff(i)=xforcact(i)-xforcdiff(i)
263  endif
264  if(iamforci.gt.0) then
265  xforcact(i)=xforc(i)*ampli(iamforci)
266  elseif(nmethod.eq.1) then
267  xforcact(i)=xforcold(i)+
268  & (xforc(i)-xforcold(i))*reltime
269  else
270  xforcact(i)=xforc(i)
271  endif
272  xforcdiff(i)=xforcact(i)-xforcdiff(i)
273  enddo
274 !
275  do i=1,nload
276 !
277 ! check for dload subroutine
278 !
279  if(sideload(i)(3:4).eq.'NU') then
280  iabsload=2
281  cycle
282  endif
283 !
284  ipresboun=0
285 !
286 ! check for pressure boundary conditions
287 !
288  if(sideload(i)(3:4).eq.'NP') then
289  node=nelemload(2,i)
290  idof=8*(node-1)+2
291  call nident(ikboun,idof,nboun,id)
292  if(id.gt.0) then
293  if(ikboun(id).eq.idof) then
294  ipresboun=1
295  if(iabsload.eq.0) then
296  xloaddiff(1,i)=xloadact(1,i)
297  else
298  xloaddiff(1,i)=xloadact(1,i)-xloaddiff(1,i)
299  endif
300  xloadact(1,i)=xbounact(ilboun(id))
301  xloaddiff(1,i)=xloadact(1,i)-xloaddiff(1,i)
302  endif
303  endif
304  endif
305 !
306  if(ipresboun.eq.0) then
307  if(nam.gt.0) then
308  iamloadi1=iamload(1,i)
309  iamloadi2=iamload(2,i)
310  else
311  iamloadi1=0
312  iamloadi2=0
313  endif
314 !
315  if(iabsload.eq.0) then
316  xloaddiff(1,i)=xloadact(1,i)
317  else
318  xloaddiff(1,i)=xloadact(1,i)-xloaddiff(1,i)
319  endif
320  if(iamloadi1.gt.0) then
321  xloadact(1,i)=xload(1,i)*ampli(iamloadi1)
322  elseif(nmethod.eq.1) then
323  xloadact(1,i)=xloadold(1,i)+
324  & (xload(1,i)-xloadold(1,i))*reltime
325  else
326  xloadact(1,i)=xload(1,i)
327  endif
328  xloaddiff(1,i)=xloadact(1,i)-xloaddiff(1,i)
329 !
330  if(iabsload.eq.0) then
331  xloaddiff(2,i)=xloadact(1,i)
332  else
333  xloaddiff(2,i)=xloadact(2,i)-xloaddiff(2,i)
334  endif
335  if(iamloadi2.gt.0) then
336  xloadact(2,i)=xload(2,i)*ampli(iamloadi2)
337  elseif(nmethod.eq.1) then
338  xloadact(2,i)=xload(2,i)
339  else
340  xloadact(2,i)=xload(2,i)
341  endif
342  xloaddiff(2,i)=xloadact(2,i)-xloaddiff(2,i)
343  endif
344  enddo
345 !
346  do i=1,nbody
347  if(nam.gt.0) then
348  iambodyi=ibody(2,i)
349  else
350  iambodyi=0
351  endif
352 !
353  if(iabsload.eq.0) then
354  xbodydiff(1,i)=xbodyact(1,i)
355  else
356  xbodydiff(1,i)=xbodyact(1,i)-xbodydiff(1,i)
357  endif
358  if(iambodyi.gt.0) then
359  xbodyact(1,i)=xbody(1,i)*ampli(iambodyi)
360  elseif(nmethod.eq.1) then
361  xbodyact(1,i)=xbodyold(1,i)+
362  & (xbody(1,i)-xbodyold(1,i))*reltime
363  else
364  xbodyact(1,i)=xbody(1,i)
365  endif
366  xbodydiff(1,i)=xbodyact(1,i)-xbodydiff(1,i)
367  enddo
368 !
369  return
subroutine uamplitude(time, name, amplitude)
Definition: uamplitude.f:20
subroutine cflux(flux, msecpt, kstep, kinc, time, node, coords, vold, mi)
Definition: cflux.f:21
subroutine utemp(temp, msecpt, kstep, kinc, time, node, coords, vold, mi, iponoel, inoel, ipobody, xbody, ibody)
Definition: utemp.f:21
subroutine identamta(amta, reftime, istart, iend, id)
Definition: identamta.f:26
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine uboun(boun, kstep, kinc, time, node, idof, coords, vold, mi, iponoel, inoel, ipobody, xbody, ibody)
Definition: uboun.f:21
subroutine cload(xload, kstep, kinc, time, node, idof, coords, vold, mi, ntrans, trab, inotr, veold)
Definition: cload.f:21
Hosted by OpenAircraft.com, (Michigan UAV, LLC)