17 subroutine fstr_read_restart(cstep,substep,step_count,ctime,dtime,hecMESH,fstrSOLID,fstrPARAM,contactNode)
19 integer,
intent(out) :: cstep
20 integer,
intent(out) :: substep
21 integer,
intent(out) :: step_count
22 real(kind=kreal),
intent(out) :: ctime
23 real(kind=kreal),
intent(out) :: dtime
24 integer,
intent(out) :: contactNode
25 type (hecmwST_local_mesh),
intent(in) :: hecMESH
26 type (fstr_solid),
intent(inout) :: fstrSOLID
29 integer :: i,j,restrt_step(3),nif(2),istat(1),nload_prev(1)
30 real(kind=kreal) :: times(3)
32 call hecmw_restart_open()
34 call hecmw_restart_read_int(restrt_step)
35 if( fstrparam%restart_version >= 5 )
then
36 if(
myrank == 0 )
write(*,*)
'Reading restart file as new format(>=ver5.0)'
37 call hecmw_restart_read_real(times)
38 call hecmw_restart_read_int(fstrsolid%NRstat_i)
39 call hecmw_restart_read_real(fstrsolid%NRstat_r)
40 call hecmw_restart_read_int(istat)
42 if(
myrank == 0 )
write(*,*)
'Reading restart file as old format(<ver5.0)'
44 call hecmw_restart_read_int(nload_prev)
45 if( nload_prev(1)>0 )
then
46 allocate(fstrsolid%step_ctrl_restart%Load(nload_prev(1)))
47 call hecmw_restart_read_int(fstrsolid%step_ctrl_restart%Load)
50 call hecmw_restart_read_real(fstrsolid%unode)
51 call hecmw_restart_read_real(fstrsolid%QFORCE)
53 do i= 1, hecmesh%n_elem
54 if (hecmw_is_etype_link( fstrsolid%elements(i)%etype )) cycle
55 if (hecmw_is_etype_patch( fstrsolid%elements(i)%etype )) cycle
56 do j= 1,
size(fstrsolid%elements(i)%gausses)
57 call hecmw_restart_read_int(nif)
58 call hecmw_restart_read_real(fstrsolid%elements(i)%gausses(j)%strain)
59 call hecmw_restart_read_real(fstrsolid%elements(i)%gausses(j)%stress)
60 if( nif(1)>0 )
call hecmw_restart_read_int(fstrsolid%elements(i)%gausses(j)%istatus)
61 if( nif(2)>0 )
call hecmw_restart_read_real(fstrsolid%elements(i)%gausses(j)%fstatus)
65 if(
associated( fstrsolid%contacts ) )
then
66 call hecmw_restart_read_int(nif)
68 do i= 1,
size(fstrsolid%contacts)
69 do j= 1,
size(fstrsolid%contacts(i)%slave)
70 call hecmw_restart_read_int(nif)
71 fstrsolid%contacts(i)%states(j)%surface = nif(1)
72 fstrsolid%contacts(i)%states(j)%state = nif(2)
73 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%lpos)
74 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%direction)
75 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%multiplier)
76 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%tangentForce_trial)
77 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%tangentForce_final)
82 call hecmw_restart_close()
84 cstep = restrt_step(1)
85 substep = restrt_step(2) + 1
86 step_count = restrt_step(3)
87 if( fstrparam%restart_version >= 5 )
then
90 fstrsolid%AutoINC_stat = istat(1)
91 if( dabs(times(1)-times(3)) < 1.d-10 )
then
95 do i=1,
size(fstrsolid%step_ctrl)
96 fstrsolid%step_ctrl(i)%starttime = fstrsolid%step_ctrl(i)%starttime + times(3)
99 ctime = fstrsolid%step_ctrl(cstep)%starttime
100 ctime = ctime + dble(substep-1)*fstrsolid%step_ctrl(cstep)%initdt
101 dtime = fstrsolid%step_ctrl(cstep)%initdt
102 if( dabs(ctime-fstrsolid%step_ctrl(cstep)%starttime-fstrsolid%step_ctrl(cstep)%elapsetime) < 1.d-10 )
then
113 & fstrSOLID,fstrPARAM,is_StepFinished,contactNode)
115 integer,
intent(in) :: cstep
116 integer,
intent(in) :: cstep_ext
117 integer,
intent(in) :: substep
118 integer,
intent(in) :: step_count
119 real(kind=kreal),
intent(in) :: ctime
120 real(kind=kreal),
intent(in) :: dtime
121 logical,
intent(in) :: is_StepFinished
122 integer,
intent(in) :: contactNode
123 type (hecmwST_local_mesh),
intent(in) :: hecMESH
124 type (fstr_solid),
intent(in) :: fstrSOLID
127 integer :: i,j,restrt_step(3),nif(2),istat(1),nload_prev(1)
128 real(kind=kreal) :: times(3)
130 restrt_step(1) = cstep_ext
131 restrt_step(2) = substep
132 restrt_step(3) = step_count
135 if( is_stepfinished )
then
138 times(3) = fstrsolid%step_ctrl(cstep)%starttime
140 istat(1) = fstrsolid%AutoINC_stat
141 call hecmw_restart_add_int(restrt_step,
size(restrt_step))
142 if( fstrparam%restart_version >= 5 )
then
143 call hecmw_restart_add_real(times,
size(times))
144 call hecmw_restart_add_int(fstrsolid%NRstat_i,
size(fstrsolid%NRstat_i))
145 call hecmw_restart_add_real(fstrsolid%NRstat_r,
size(fstrsolid%NRstat_r))
146 call hecmw_restart_add_int(istat,1)
149 if( is_stepfinished )
then
150 if(
associated(fstrsolid%step_ctrl(cstep)%Load) ) nload_prev(1) =
size(fstrsolid%step_ctrl(cstep)%Load)
151 call hecmw_restart_add_int(nload_prev,1)
152 if( nload_prev(1)>0 )
call hecmw_restart_add_int(fstrsolid%step_ctrl(cstep)%Load,nload_prev(1))
155 if(
associated(fstrsolid%step_ctrl(cstep-1)%Load) ) nload_prev(1) =
size(fstrsolid%step_ctrl(cstep-1)%Load)
156 call hecmw_restart_add_int(nload_prev,1)
157 if( nload_prev(1)>0 )
call hecmw_restart_add_int(fstrsolid%step_ctrl(cstep-1)%Load,nload_prev(1))
159 if(
associated(fstrsolid%step_ctrl_restart%Load) ) nload_prev(1) =
size(fstrsolid%step_ctrl_restart%Load)
160 call hecmw_restart_add_int(nload_prev,1)
161 if( nload_prev(1)>0 )
call hecmw_restart_add_int(fstrsolid%step_ctrl_restart%Load,nload_prev(1))
165 call hecmw_restart_add_real(fstrsolid%unode,
size(fstrsolid%unode))
166 call hecmw_restart_add_real(fstrsolid%QFORCE,
size(fstrsolid%QFORCE))
168 do i= 1, hecmesh%n_elem
169 if (hecmw_is_etype_link( fstrsolid%elements(i)%etype )) cycle
170 if (hecmw_is_etype_patch( fstrsolid%elements(i)%etype )) cycle
171 do j= 1,
size(fstrsolid%elements(i)%gausses)
173 if(
associated(fstrsolid%elements(i)%gausses(j)%istatus) ) nif(1)=
size(fstrsolid%elements(i)%gausses(j)%istatus)
174 if(
associated(fstrsolid%elements(i)%gausses(j)%fstatus) ) nif(2)=
size(fstrsolid%elements(i)%gausses(j)%fstatus)
175 call hecmw_restart_add_int(nif,
size(nif))
176 call hecmw_restart_add_real(fstrsolid%elements(i)%gausses(j)%strain,
size(fstrsolid%elements(i)%gausses(j)%strain))
177 call hecmw_restart_add_real(fstrsolid%elements(i)%gausses(j)%stress,
size(fstrsolid%elements(i)%gausses(j)%stress))
179 call hecmw_restart_add_int(fstrsolid%elements(i)%gausses(j)%istatus,
size(fstrsolid%elements(i)%gausses(j)%istatus))
182 call hecmw_restart_add_real(fstrsolid%elements(i)%gausses(j)%fstatus,
size(fstrsolid%elements(i)%gausses(j)%fstatus))
187 if(
associated( fstrsolid%contacts ) )
then
189 call hecmw_restart_add_int(nif,
size(nif))
190 do i= 1,
size(fstrsolid%contacts)
191 do j= 1,
size(fstrsolid%contacts(i)%slave)
192 nif(1) = fstrsolid%contacts(i)%states(j)%surface
193 nif(2) = fstrsolid%contacts(i)%states(j)%state
194 call hecmw_restart_add_int(nif,
size(nif))
195 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%lpos,
size(fstrsolid%contacts(i)%states(j)%lpos))
196 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%direction,
size(fstrsolid%contacts(i)%states(j)%direction))
197 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%multiplier,
size(fstrsolid%contacts(i)%states(j)%multiplier))
198 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%tangentForce_trial, &
199 size(fstrsolid%contacts(i)%states(j)%tangentForce_trial))
200 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%tangentForce_final, &
201 size(fstrsolid%contacts(i)%states(j)%tangentForce_final))
206 call hecmw_restart_write()
214 integer,
intent(out) :: cstep
215 integer,
intent(out),
optional :: contactNode
216 type (hecmwST_local_mesh),
intent(in) :: hecMESH
217 type (fstr_solid),
intent(inout) :: fstrSOLID
218 type ( fstr_dynamic),
intent(inout) :: fstrDYNAMIC
221 integer :: i,j,restrt_step(1),nif(2)
222 real(kind=kreal) ::
data(2)
224 call hecmw_restart_open()
226 call hecmw_restart_read_int(restrt_step)
227 cstep = restrt_step(1)
228 call hecmw_restart_read_real(fstrsolid%unode)
229 call hecmw_restart_read_real(fstrsolid%QFORCE)
231 do i= 1, hecmesh%n_elem
232 if (hecmw_is_etype_link( fstrsolid%elements(i)%etype )) cycle
233 if (hecmw_is_etype_patch( fstrsolid%elements(i)%etype )) cycle
234 do j= 1,
size(fstrsolid%elements(i)%gausses)
235 call hecmw_restart_read_int(nif)
236 call hecmw_restart_read_real(fstrsolid%elements(i)%gausses(j)%strain)
237 call hecmw_restart_read_real(fstrsolid%elements(i)%gausses(j)%stress)
238 if( nif(1)>0 )
call hecmw_restart_read_int(fstrsolid%elements(i)%gausses(j)%istatus)
239 if( nif(2)>0 )
call hecmw_restart_read_real(fstrsolid%elements(i)%gausses(j)%fstatus)
243 if(
present(contactnode))
then
244 call hecmw_restart_read_int(nif)
246 do i= 1,
size(fstrsolid%contacts)
247 do j= 1,
size(fstrsolid%contacts(i)%slave)
248 call hecmw_restart_read_int(nif)
249 fstrsolid%contacts(i)%states(j)%surface = nif(1)
250 fstrsolid%contacts(i)%states(j)%state = nif(2)
251 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%lpos)
252 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%direction)
253 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%multiplier)
254 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%tangentForce_trial)
255 call hecmw_restart_read_real(fstrsolid%contacts(i)%states(j)%tangentForce_final)
260 call hecmw_restart_read_int(restrt_step)
261 fstrdynamic%idx_eqa = restrt_step(1)
262 call hecmw_restart_read_real(data)
263 fstrdynamic%t_curr =
data(1)
264 fstrdynamic%strainEnergy =
data(2)
265 if( fstrdynamic%idx_eqa == 1 )
then
266 call hecmw_restart_read_real(fstrdynamic%DISP(:,1))
267 call hecmw_restart_read_real(fstrdynamic%VEL(:,1))
268 call hecmw_restart_read_real(fstrdynamic%ACC(:,1))
270 call hecmw_restart_read_real(fstrdynamic%DISP(:,1))
271 call hecmw_restart_read_real(fstrdynamic%DISP(:,3))
273 do i= 1, hecmesh%n_elem
274 call hecmw_restart_read_real(fstrsolid%elements(i)%equiForces)
277 call hecmw_restart_close()
285 integer,
intent(in) :: cstep
286 integer,
intent(in),
optional :: contactNode
287 type (hecmwST_local_mesh),
intent(in) :: hecMESH
288 type (fstr_solid),
intent(in) :: fstrSOLID
289 type ( fstr_dynamic),
intent(in) :: fstrDYNAMIC
292 integer :: i,j,restrt_step(1),nif(2)
293 real(kind=kreal) ::
data(2)
295 restrt_step(1) = cstep
296 call hecmw_restart_add_int(restrt_step,
size(restrt_step))
297 call hecmw_restart_add_real(fstrsolid%unode,
size(fstrsolid%unode))
298 call hecmw_restart_add_real(fstrsolid%QFORCE,
size(fstrsolid%QFORCE))
300 do i= 1, hecmesh%n_elem
301 if (hecmw_is_etype_link( fstrsolid%elements(i)%etype )) cycle
302 if (hecmw_is_etype_patch( fstrsolid%elements(i)%etype )) cycle
303 do j= 1,
size(fstrsolid%elements(i)%gausses)
305 if(
associated(fstrsolid%elements(i)%gausses(j)%istatus) ) nif(1)=
size(fstrsolid%elements(i)%gausses(j)%istatus)
306 if(
associated(fstrsolid%elements(i)%gausses(j)%fstatus) ) nif(2)=
size(fstrsolid%elements(i)%gausses(j)%fstatus)
307 call hecmw_restart_add_int(nif,
size(nif))
308 call hecmw_restart_add_real(fstrsolid%elements(i)%gausses(j)%strain,
size(fstrsolid%elements(i)%gausses(j)%strain))
309 call hecmw_restart_add_real(fstrsolid%elements(i)%gausses(j)%stress,
size(fstrsolid%elements(i)%gausses(j)%stress))
311 call hecmw_restart_add_int(fstrsolid%elements(i)%gausses(j)%istatus,
size(fstrsolid%elements(i)%gausses(j)%istatus))
314 call hecmw_restart_add_real(fstrsolid%elements(i)%gausses(j)%fstatus,
size(fstrsolid%elements(i)%gausses(j)%fstatus))
319 if(
present(contactnode))
then
321 call hecmw_restart_add_int(nif,
size(nif))
322 do i= 1,
size(fstrsolid%contacts)
323 do j= 1,
size(fstrsolid%contacts(i)%slave)
324 nif(1) = fstrsolid%contacts(i)%states(j)%surface
325 nif(2) = fstrsolid%contacts(i)%states(j)%state
326 call hecmw_restart_add_int(nif,
size(nif))
327 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%lpos,
size(fstrsolid%contacts(i)%states(j)%lpos))
328 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%direction,
size(fstrsolid%contacts(i)%states(j)%direction))
329 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%multiplier,
size(fstrsolid%contacts(i)%states(j)%multiplier))
330 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%tangentForce_trial, &
331 size(fstrsolid%contacts(i)%states(j)%tangentForce_trial))
332 call hecmw_restart_add_real(fstrsolid%contacts(i)%states(j)%tangentForce_final, &
333 size(fstrsolid%contacts(i)%states(j)%tangentForce_final))
338 restrt_step(1) = fstrdynamic%idx_eqa
339 call hecmw_restart_add_int(restrt_step,
size(restrt_step))
340 data(1) = fstrdynamic%t_curr
341 data(2) = fstrdynamic%strainEnergy
342 call hecmw_restart_add_real(
data,
size(data))
343 if( fstrdynamic%idx_eqa == 1 )
then
344 call hecmw_restart_add_real(fstrdynamic%DISP(:,1),
size(fstrdynamic%DISP(:,1)))
345 call hecmw_restart_add_real(fstrdynamic%VEL(:,1),
size(fstrdynamic%VEL(:,1)))
346 call hecmw_restart_add_real(fstrdynamic%ACC(:,1),
size(fstrdynamic%ACC(:,1)))
348 call hecmw_restart_add_real(fstrdynamic%DISP(:,1),
size(fstrdynamic%DISP(:,1)))
349 call hecmw_restart_add_real(fstrdynamic%DISP(:,3),
size(fstrdynamic%DISP(:,3)))
351 do i= 1, hecmesh%n_elem
352 call hecmw_restart_add_real(fstrsolid%elements(i)%equiForces,
size(fstrsolid%elements(i)%equiForces))
355 call hecmw_restart_write()
This module provides functions to read in and write out restart fiels.
subroutine fstr_read_restart(cstep, substep, step_count, ctime, dtime, hecMESH, fstrSOLID, fstrPARAM, contactNode)
Read in restart file.
subroutine fstr_write_restart_dyna_nl(cstep, hecMESH, fstrSOLID, fstrDYNAMIC, fstrPARAM, contactNode)
write out restart file for nonlinear dynamic analysis
subroutine fstr_read_restart_dyna_nl(cstep, hecMESH, fstrSOLID, fstrDYNAMIC, fstrPARAM, contactNode)
Read in restart file for nonlinear dynamic analysis.
subroutine fstr_write_restart(cstep, cstep_ext, substep, step_count, ctime, dtime, hecMESH, fstrSOLID, fstrPARAM, is_StepFinished, contactNode)
write out restart file
This module defined coomon data and basic structures for analysis.
integer(kind=kint) myrank
PARALLEL EXECUTION.
This module provides aux functions.
FSTR INNER CONTROL PARAMETERS (fstrPARAM)