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

Go to the source code of this file.

Functions/Subroutines

subroutine restartwrite (istepnew, nset, nload, nforc, nboun, nk, ne, nmpc, nalset, nmat, ntmat_, npmat_, norien, nam, nprint, mi, ntrans, ncs_, namtot_, ncmat_, mpcend, maxlenmpc, ne1d, ne2d, nflow, nlabel, iplas, nkon, ithermal, nmethod, iperturb, nstate_, nener, set, istartset, iendset, ialset, co, kon, ipkon, lakon, nodeboun, ndirboun, iamboun, xboun, ikboun, ilboun, ipompc, nodempc, coefmpc, labmpc, ikmpc, ilmpc, nodeforc, ndirforc, iamforc, xforc, ikforc, ilforc, nelemload, iamload, sideload, xload, elcon, nelcon, rhcon, nrhcon, alcon, nalcon, alzero, plicon, nplicon, plkcon, nplkcon, orname, orab, ielorien, trab, inotr, amname, amta, namta, t0, t1, iamt1, veold, ielmat, matname, prlab, prset, filab, vold, nodebounold, ndirbounold, xbounold, xforcold, xloadold, t1old, eme, iponor, xnor, knor, thicke, offset, iponoel, inoel, rig, shcon, nshcon, cocon, ncocon, ics, sti, ener, xstate, jobnamec, infree, prestr, iprestr, cbody, ibody, xbody, nbody, xbodyold, ttime, qaold, cs, mcs, output, physcon, ctrl, typeboun, fmpc, tieset, ntie, tietol, nslavs, t0g, t1g, nprop, ielprop, prop, mortar, nintpoint, ifacecount, islavsurf, pslavsurf, clearini)
 

Function/Subroutine Documentation

◆ restartwrite()

subroutine restartwrite ( integer  istepnew,
integer  nset,
integer  nload,
integer  nforc,
integer  nboun,
integer  nk,
integer  ne,
integer  nmpc,
integer  nalset,
integer  nmat,
integer  ntmat_,
integer  npmat_,
integer  norien,
integer  nam,
integer  nprint,
integer, dimension(*)  mi,
integer  ntrans,
integer  ncs_,
integer  namtot_,
integer  ncmat_,
integer  mpcend,
integer  maxlenmpc,
integer  ne1d,
integer  ne2d,
integer  nflow,
integer  nlabel,
integer  iplas,
integer  nkon,
integer  ithermal,
integer  nmethod,
integer, dimension(*)  iperturb,
integer  nstate_,
integer  nener,
character*81, dimension(*)  set,
integer, dimension(*)  istartset,
integer, dimension(*)  iendset,
integer, dimension(*)  ialset,
real*8, dimension(*)  co,
integer, dimension(*)  kon,
integer, dimension(*)  ipkon,
character*8, dimension(*)  lakon,
integer, dimension(*)  nodeboun,
integer, dimension(*)  ndirboun,
integer, dimension(*)  iamboun,
real*8, dimension(*)  xboun,
integer, dimension(*)  ikboun,
integer, dimension(*)  ilboun,
integer, dimension(*)  ipompc,
integer, dimension(*)  nodempc,
real*8, dimension(*)  coefmpc,
character*20, dimension(*)  labmpc,
integer, dimension(*)  ikmpc,
integer, dimension(*)  ilmpc,
integer, dimension(*)  nodeforc,
integer, dimension(*)  ndirforc,
integer, dimension(*)  iamforc,
real*8, dimension(*)  xforc,
integer, dimension(*)  ikforc,
integer, dimension(*)  ilforc,
integer, dimension(*)  nelemload,
integer, dimension(*)  iamload,
character*20, dimension(*)  sideload,
real*8, dimension(*)  xload,
real*8, dimension(*)  elcon,
integer, dimension(*)  nelcon,
real*8, dimension(*)  rhcon,
integer, dimension(*)  nrhcon,
real*8, dimension(*)  alcon,
integer, dimension(*)  nalcon,
real*8, dimension(*)  alzero,
real*8, dimension(*)  plicon,
integer, dimension(*)  nplicon,
real*8, dimension(*)  plkcon,
integer, dimension(*)  nplkcon,
character*80, dimension(*)  orname,
real*8, dimension(*)  orab,
integer, dimension(*)  ielorien,
real*8, dimension(*)  trab,
integer, dimension(*)  inotr,
character*80, dimension(*)  amname,
real*8, dimension(*)  amta,
integer, dimension(*)  namta,
real*8, dimension(*)  t0,
real*8, dimension(*)  t1,
integer, dimension(*)  iamt1,
real*8, dimension(*)  veold,
integer, dimension(*)  ielmat,
character*80, dimension(*)  matname,
character*6, dimension(*)  prlab,
character*81, dimension(*)  prset,
character*87, dimension(*)  filab,
real*8, dimension(*)  vold,
integer, dimension(*)  nodebounold,
integer, dimension(*)  ndirbounold,
real*8, dimension(*)  xbounold,
real*8, dimension(*)  xforcold,
real*8, dimension(*)  xloadold,
real*8, dimension(*)  t1old,
real*8, dimension(*)  eme,
integer, dimension(*)  iponor,
real*8, dimension(*)  xnor,
integer, dimension(*)  knor,
real*8, dimension(*)  thicke,
real*8, dimension(*)  offset,
integer, dimension(*)  iponoel,
integer, dimension(*)  inoel,
integer, dimension(*)  rig,
real*8, dimension(*)  shcon,
integer, dimension(*)  nshcon,
real*8, dimension(*)  cocon,
integer, dimension(*)  ncocon,
integer, dimension(*)  ics,
real*8, dimension(*)  sti,
real*8, dimension(*)  ener,
real*8, dimension(*)  xstate,
character*132, dimension(*)  jobnamec,
integer, dimension(*)  infree,
real*8, dimension(*)  prestr,
integer  iprestr,
character*81, dimension(*)  cbody,
integer, dimension(*)  ibody,
real*8, dimension(*)  xbody,
integer  nbody,
real*8, dimension(*)  xbodyold,
real*8  ttime,
real*8, dimension(2)  qaold,
real*8, dimension(*)  cs,
integer  mcs,
character*3  output,
real*8, dimension(*)  physcon,
real*8, dimension(*)  ctrl,
character*1, dimension(*)  typeboun,
real*8, dimension(*)  fmpc,
character*81, dimension(*)  tieset,
integer  ntie,
real*8, dimension(*)  tietol,
integer  nslavs,
real*8, dimension(*)  t0g,
real*8, dimension(*)  t1g,
integer  nprop,
integer, dimension(*)  ielprop,
real*8, dimension(*)  prop,
integer  mortar,
integer  nintpoint,
integer  ifacecount,
integer, dimension(*)  islavsurf,
real*8, dimension(*)  pslavsurf,
real*8, dimension(*)  clearini 
)
39 !
40 ! writes all information needed for a restart to file
41 !
42 ! ONLY ONE-DIMENSIONAL FIELDS ALLOWED! More-dimensional fields
43 ! must be stored as one-dimensional ones.
44 !
45  implicit none
46 !
47  logical op
48 !
49  character*1 typeboun(*)
50  character*3 output
51  character*6 prlab(*)
52  character*8 lakon(*)
53  character*20 labmpc(*),sideload(*)
54  character*80 orname(*),amname(*),matname(*),version
55  character*81 set(*),prset(*),tieset(*),cbody(*)
56  character*87 filab(*)
57  character*132 fnrstrt,jobnamec(*)
58 !
59  integer nset,nload,nforc,nboun,nk,ne,nmpc,nalset,nmat,
60  & ntmat_,npmat_,norien,nam,nprint,mi(*),ntrans,ncs_,
61  & namtot_,ncmat_,mpcend,ne1d,ne2d,nflow,nlabel,iplas,nkon,
62  & ithermal,nmethod,iperturb(*),nstate_,istartset(*),iendset(*),
63  & ialset(*),kon(*),ipkon(*),nodeboun(*),ndirboun(*),iamboun(*),
64  & ikboun(*),ilboun(*),ipompc(*),nodempc(*),ikmpc(*),ilmpc(*),
65  & nodeforc(*),ndirforc(*),iamforc(*),ikforc(*),ilforc(*),
66  & nelemload(*),iamload(*),nelcon(*),nprop,mortar,
67  & nrhcon(*),nalcon(*),nplicon(*),nplkcon(*),ielorien(*),
68  & inotr(*),nintpoint,ifacecount,islavsurf(*),ielprop(*),
69  & namta(*),iamt1(*),ielmat(*),nodebounold(*),ndirbounold(*),
70  & iponor(*),knor(*),iponoel(*),inoel(*),rig(*),
71  & nshcon(*),ncocon(*),ics(*),infree(*),i,ipos,
72  & nener,iprestr,istepnew,maxlenmpc,mcs,ntie,
73  & ibody(*),nbody,mt,nslavs
74 !
75  real*8 co(*),xboun(*),coefmpc(*),xforc(*),xload(*),elcon(*),
76  & rhcon(*),alcon(*),alzero(*),plicon(*),plkcon(*),orab(*),
77  & trab(*),amta(*),t0(*),t1(*),prestr(*),veold(*),tietol(*),
78  & vold(*),xbounold(*),xforcold(*),xloadold(*),t1old(*),eme(*),
79  & xnor(*),thicke(*),offset(*),t0g(*),t1g(*),clearini(*),
80  & shcon(*),cocon(*),sti(*),ener(*),xstate(*),pslavsurf(*),
81  & qaold(2),cs(*),physcon(*),ctrl(*),prop(*),
82  & ttime,fmpc(*),xbody(*),xbodyold(*)
83 !
84  mt=mi(2)+1
85 !
86  ipos=index(jobnamec(1),char(0))
87  fnrstrt(1:ipos-1)=jobnamec(1)(1:ipos-1)
88  fnrstrt(ipos:ipos+4)=".rout"
89  do i=ipos+5,132
90  fnrstrt(i:i)=' '
91  enddo
92 !
93 ! check whether the restart file exists and is opened
94 !
95  inquire(file=fnrstrt,opened=op,err=152)
96 !
97  if(.not.op) then
98  open(15,file=fnrstrt,access='SEQUENTIAL',form='UNFORMATTED',
99  & err=151)
100  endif
101 !
102  do i=1,80
103  version(i:i)=' '
104  enddo
105  version(1:20)='Version 2.13'
106  write(15) version
107 !
108  write(15)istepnew
109 !
110 ! set size
111 !
112  write(15)nset
113  write(15)nalset
114 !
115 ! load size
116 !
117  write(15)nload
118  write(15)nbody
119  write(15)nforc
120  write(15)nboun
121  write(15)nflow
122 !
123 ! mesh size
124 !
125  write(15)nk
126  write(15)ne
127  write(15)nkon
128  write(15)(mi(i),i=1,3)
129 !
130 ! constraint size
131 !
132  write(15)nmpc
133  write(15)mpcend
134  write(15)maxlenmpc
135 !
136 ! material size
137 !
138  write(15)nmat
139  write(15)ntmat_
140  write(15)npmat_
141  write(15)ncmat_
142 !
143 ! property info
144 !
145  write(15)nprop
146 !
147 ! transformation size
148 !
149  write(15)norien
150  write(15)ntrans
151 !
152 ! amplitude size
153 !
154  write(15)nam
155  write(15)namtot_
156 !
157 ! print size
158 !
159  write(15)nprint
160  write(15)nlabel
161 !
162 ! tie size
163 !
164  write(15)ntie
165 !
166 ! cyclic symmetry size
167 !
168  write(15)ncs_
169  write(15)mcs
170 !
171 ! 1d and 2d element size
172 !
173  write(15)ne1d
174  write(15)ne2d
175  write(15)(infree(i),i=1,4)
176 !
177 ! procedure info
178 !
179  write(15)nmethod
180  write(15)(iperturb(i),i=1,2)
181  write(15)nener
182  write(15)iplas
183  write(15)ithermal
184  write(15)nstate_
185  write(15)nslavs
186  write(15)iprestr
187  write(15)mortar
188  if(mortar.eq.1) then
189  write(15)ifacecount
190  write(15)nintpoint
191  endif
192 !
193 ! sets
194 !
195  write(15)(set(i),i=1,nset)
196  write(15)(istartset(i),i=1,nset)
197  write(15)(iendset(i),i=1,nset)
198 !
199 ! watch out: the statement
200 ! write(15)(ialset(i),i=nalset) (short form)
201 ! needs less space to store than
202 ! do i=1,nalset
203 ! write(15) ialset(i) (long form)
204 ! enddo
205 ! but cannot be accessed by read statements of the form
206 ! do i=1,nalset
207 ! read(15) im0
208 ! enddo
209 ! as needed in routine restartshort. Therefore the long form
210 ! is used for ialset.
211 !
212  do i=1,nalset
213  write(15) ialset(i)
214  enddo
215 !
216 ! mesh
217 !
218  write(15)(co(i),i=1,3*nk)
219  write(15)(kon(i),i=1,nkon)
220  write(15)(ipkon(i),i=1,ne)
221  write(15)(lakon(i),i=1,ne)
222 !
223 ! single point constraints
224 !
225  write(15)(nodeboun(i),i=1,nboun)
226  write(15)(ndirboun(i),i=1,nboun)
227  write(15)(typeboun(i),i=1,nboun)
228  write(15)(xboun(i),i=1,nboun)
229  write(15)(ikboun(i),i=1,nboun)
230  write(15)(ilboun(i),i=1,nboun)
231  if(nam.gt.0) write(15)(iamboun(i),i=1,nboun)
232  write(15)(nodebounold(i),i=1,nboun)
233  write(15)(ndirbounold(i),i=1,nboun)
234  write(15)(xbounold(i),i=1,nboun)
235 !
236 ! multiple point constraints
237 !
238  write(15)(ipompc(i),i=1,nmpc)
239  write(15)(labmpc(i),i=1,nmpc)
240  write(15)(ikmpc(i),i=1,nmpc)
241  write(15)(ilmpc(i),i=1,nmpc)
242  write(15)(fmpc(i),i=1,nmpc)
243  write(15)(nodempc(i),i=1,3*mpcend)
244  write(15)(coefmpc(i),i=1,mpcend)
245 !
246 ! point forces
247 !
248  write(15)(nodeforc(i),i=1,2*nforc)
249  write(15)(ndirforc(i),i=1,nforc)
250  write(15)(xforc(i),i=1,nforc)
251  write(15)(ikforc(i),i=1,nforc)
252  write(15)(ilforc(i),i=1,nforc)
253  if(nam.gt.0) write(15)(iamforc(i),i=1,nforc)
254  write(15)(xforcold(i),i=1,nforc)
255 !
256 ! distributed loads
257 !
258  write(15)(nelemload(i),i=1,2*nload)
259  write(15)(sideload(i),i=1,nload)
260  write(15)(xload(i),i=1,2*nload)
261  if(nam.gt.0) write(15)(iamload(i),i=1,2*nload)
262  write(15)(xloadold(i),i=1,2*nload)
263  write(15)(cbody(i),i=1,nbody)
264  write(15)(ibody(i),i=1,3*nbody)
265  write(15)(xbody(i),i=1,7*nbody)
266  write(15)(xbodyold(i),i=1,7*nbody)
267 !
268 ! prestress
269 !
270  if(iprestr.gt.0) write(15) (prestr(i),i=1,6*mi(1)*ne)
271 !
272 ! labels
273 !
274  write(15) (prlab(i),i=1,nprint)
275  write(15) (prset(i),i=1,nprint)
276  write(15)(filab(i),i=1,nlabel)
277 !
278 ! elastic constants
279 !
280  write(15)(elcon(i),i=1,(ncmat_+1)*ntmat_*nmat)
281  write(15)(nelcon(i),i=1,2*nmat)
282 !
283 ! density
284 !
285  write(15)(rhcon(i),i=1,2*ntmat_*nmat)
286  write(15)(nrhcon(i),i=1,nmat)
287 !
288 ! specific heat
289 !
290  write(15)(shcon(i),i=1,4*ntmat_*nmat)
291  write(15)(nshcon(i),i=1,nmat)
292 !
293 ! conductivity
294 !
295  write(15)(cocon(i),i=1,7*ntmat_*nmat)
296  write(15)(ncocon(i),i=1,2*nmat)
297 !
298 ! expansion coefficients
299 !
300  write(15)(alcon(i),i=1,7*ntmat_*nmat)
301  write(15)(nalcon(i),i=1,2*nmat)
302  write(15)(alzero(i),i=1,nmat)
303 !
304 ! physical constants
305 !
306  write(15)(physcon(i),i=1,10)
307 !
308 ! plastic data
309 !
310  if(npmat_.ne.0)then
311  write(15)(plicon(i),i=1,(2*npmat_+1)*ntmat_*nmat)
312  write(15)(nplicon(i),i=1,(ntmat_+1)*nmat)
313  write(15)(plkcon(i),i=1,(2*npmat_+1)*ntmat_*nmat)
314  write(15)(nplkcon(i),i=1,(ntmat_+1)*nmat)
315  endif
316 !
317 ! material orientation
318 !
319  if(norien.ne.0)then
320  write(15)(orname(i),i=1,norien)
321  write(15)(orab(i),i=1,7*norien)
322  write(15)(ielorien(i),i=1,mi(3)*ne)
323  endif
324 !
325 ! fluid section properties
326 !
327  if(nprop.ne.0) then
328  write(15)(ielprop(i),i=1,ne)
329  write(15)(prop(i),i=1,nprop)
330  endif
331 !
332 ! transformations
333 !
334  if(ntrans.ne.0)then
335  write(15)(trab(i),i=1,7*ntrans)
336  write(15)(inotr(i),i=1,2*nk)
337  endif
338 !
339 ! amplitudes
340 !
341  if(nam.gt.0)then
342  write(15)(amname(i),i=1,nam)
343  write(15)(namta(i),i=1,3*nam-1)
344  write(15) namta(3*nam)
345  write(15)(amta(i),i=1,2*namta(3*nam-1))
346  endif
347 !
348 ! temperatures
349 !
350  if(ithermal.gt.0)then
351  write(15)(t0(i),i=1,nk)
352  write(15)(t1(i),i=1,nk)
353  if((ne1d.gt.0).or.(ne2d.gt.0))then
354  write(15)(t0g(i),i=1,2*nk)
355  write(15)(t1g(i),i=1,2*nk)
356  endif
357  if(nam.gt.0) write(15)(iamt1(i),i=1,nk)
358  write(15)(t1old(i),i=1,nk)
359  endif
360 !
361 ! materials
362 !
363  write(15)(matname(i),i=1,nmat)
364  write(15)(ielmat(i),i=1,mi(3)*ne)
365 !
366 ! temperature, displacement, static pressure, velocity and acceleration
367 !
368  write(15)(vold(i),i=1,mt*nk)
369  if((nmethod.eq.4).or.((nmethod.eq.1).and.(iperturb(1).ge.2))) then
370  write(15)(veold(i),i=1,mt*nk)
371  endif
372 !
373 ! 1d and 2d elements
374 !
375  if((ne1d.gt.0).or.(ne2d.gt.0))then
376  write(15)(iponor(i),i=1,2*nkon)
377  write(15)(xnor(i),i=1,infree(1))
378  write(15)(knor(i),i=1,infree(2))
379  write(15)(thicke(i),i=1,mi(3)*nkon)
380  write(15)(offset(i),i=1,2*ne)
381  write(15)(iponoel(i),i=1,infree(4))
382  write(15)(inoel(i),i=1,3*(infree(3)-1))
383  write(15)(rig(i),i=1,infree(4))
384  endif
385 !
386 ! tie constraints
387 !
388  if(ntie.gt.0) then
389  write(15)(tieset(i),i=1,3*ntie)
390  write(15)(tietol(i),i=1,3*ntie)
391  endif
392 !
393 ! cyclic symmetry
394 !
395  if(ncs_.gt.0)then
396  write(15)(ics(i),i=1,ncs_)
397  endif
398  if(mcs.gt.0) then
399  write(15)(cs(i),i=1,17*mcs)
400  endif
401 !
402 ! integration point variables
403 !
404  write(15)(sti(i),i=1,6*mi(1)*ne)
405  write(15)(eme(i),i=1,6*mi(1)*ne)
406  if(nener.eq.1) then
407  write(15)(ener(i),i=1,mi(1)*ne)
408  endif
409  if(nstate_.gt.0)then
410  if(mortar.eq.0) then
411  write(15)(xstate(i),i=1,nstate_*mi(1)*(ne+nslavs))
412  elseif(mortar.eq.1) then
413  write(15)(xstate(i),i=1,nstate_*mi(1)*(ne+nintpoint))
414  endif
415  endif
416 !
417 ! face-to-face penalty contact variables
418 !
419  if(mortar.eq.1) then
420  write(15) (islavsurf(i),i=1,2*ifacecount+2)
421  write(15) (pslavsurf(i),i=1,3*nintpoint)
422  write(15) (clearini(i),i=1,3*9*ifacecount)
423  endif
424 !
425 ! control parameters
426 !
427  write(15) (ctrl(i),i=1,39)
428  write(15) (qaold(i),i=1,2)
429  write(15) output
430  write(15) ttime
431 !
432  return
433 !
434  151 write(*,*) '*ERROR in restartwrite: could not open file ',fnrstrt
435  call exit(201)
436 !
437  152 write(*,*) '*ERROR in restartwrite: could not inquire file ',
438  & fnrstrt
439  call exit(201)
subroutine op(n, x, y, ad, au, jq, irow)
Definition: op.f:26
Hosted by OpenAircraft.com, (Michigan UAV, LLC)