31 type (hecmwST_local_mesh) :: hecMESH
32 type (hecmwST_matrix ) :: hecMAT
33 type (fstr_param ) :: fstrPARAM
34 type (fstr_solid ) :: fstrSOLID
35 type (hecmwST_matrix_lagrange) :: hecLagMAT
36 type (fstr_info_contactChange) :: infoCTChange, infoCTChange_bak
37 type (hecmwST_matrix ) :: conMAT
39 integer(kind=kint) :: ndof, nn
40 integer(kind=kint) :: j, i, tot_step, step_count, tot_step_print, CBbound
41 integer(kind=kint) :: sub_step
42 integer(kind=kint) :: restart_step_num, restart_substep_num
43 real(kind=kreal) :: ctime, dtime, endtime, factor
44 real(kind=kreal) :: time_1, time_2
45 logical :: ctchanged, is_OutPoint, is_interaction_active
49 hecmat%NDOF = hecmesh%n_dof
54 is_interaction_active = (
associated( fstrsolid%contacts ) .or.
associated( fstrsolid%embeds ) )
56 if( fstrsolid%TEMP_ngrp_tot>0 .and. hecmesh%hecmw_flag_initcon==1 )
then
57 fstrsolid%last_temp = 0.0d0
58 fstrsolid%temperature = 0.0d0
59 do j=1,
size(hecmesh%node_init_val_item)
60 i = hecmesh%node_init_val_index(j)
61 fstrsolid%last_temp(j) = hecmesh%node_init_val_item(i)
62 fstrsolid%temperature(j) = hecmesh%node_init_val_item(i)
65 if( fstrsolid%TEMP_ngrp_tot>0 .and.
associated(
g_initialcnd) )
then
66 fstrsolid%last_temp = 0.0d0
67 fstrsolid%temperature = 0.0d0
70 if( .not.
associated(fstrsolid%temperature) )
then
71 allocate( fstrsolid%temperature( hecmesh%n_node ) )
72 allocate( fstrsolid%temp_bak( hecmesh%n_node ) )
73 allocate( fstrsolid%last_temp( hecmesh%n_node ) )
75 do i= 1, hecmesh%n_node
77 fstrsolid%temperature(i) = fstrsolid%last_temp(i)
83 if(
associated( fstrsolid%contacts ) )
then
90 restart_substep_num = 1
91 fstrsolid%unode = 0.0d0
93 infoctchange%contactNode_previous = 0
94 infoctchange%contactNode_current = 0
95 if( fstrsolid%restart_nout < 0 )
then
96 call fstr_read_restart(restart_step_num,restart_substep_num,step_count,ctime,dtime,hecmesh,fstrsolid, &
97 fstrparam,infoctchange%contactNode_previous)
101 fstrsolid%restart_nout = - fstrsolid%restart_nout
106 fstrsolid%FACTOR = 0.0d0
110 do tot_step=1, fstrsolid%nstep_tot
111 tot_step_print = tot_step+restart_step_num-1
112 if(hecmesh%my_rank==0)
write(*,*)
''
113 if(hecmesh%my_rank==0)
write(*,
'(a,i5)')
' loading step=',tot_step_print
115 if( fstrsolid%TEMP_ngrp_tot>0 )
then
116 do j=1, hecmesh%n_node
117 fstrsolid%temp_bak(j) = fstrsolid%temperature(j)
120 call fstr_updatestate( hecmesh, fstrsolid, 0.0d0 )
122 fstrsolid%unode_bak(:) = fstrsolid%unode(:)
127 sub_step = restart_substep_num
132 & fstrsolid%NRstat_i, fstrsolid%NRstat_r, fstrsolid%AutoINC_stat, fstrsolid%CutBack_stat )
133 if( fstrsolid%TEMP_irres > 0 )
then
134 fstrsolid%FACTOR(1) = 0.d0
135 fstrsolid%FACTOR(2) = 1.d0
137 fstrsolid%TEMP_FACTOR = factor
140 fstrsolid%FACTOR(1) = factor
142 fstrsolid%FACTOR(2) = factor
145 if(hecmesh%my_rank==0)
then
146 write(*,
'(A,I0,2(A,E12.4))')
' sub_step= ',sub_step,
', &
148 write(*,
'(A,2f12.7)')
' loading_factor= ', fstrsolid%FACTOR
149 if( fstrsolid%TEMP_irres > 0 )
write(*,
'(A,2f12.7)')
' readtemp_factor= ', fstrsolid%TEMP_FACTOR
152 time_1 = hecmw_wtime()
155 if( .not. is_interaction_active )
then
156 if( fstrparam%nlsolver_method ==
knsmnewton )
then
157 call fstr_newton( tot_step, hecmesh, hecmat, fstrsolid, fstrparam, &
175 & tot_step_print, sub_step, fstrsolid%NRstat_i, fstrsolid%NRstat_r, &
176 & fstrsolid%AutoINC_stat, fstrsolid%CutBack_stat )
179 if( fstrsolid%CutBack_stat == 0 )
then
184 cbbound = fstrparam%ainc(fstrsolid%step_ctrl(tot_step)%AincParam_id)%CBbound
185 if( fstrsolid%CutBack_stat == cbbound )
then
186 if( hecmesh%my_rank == 0 )
then
187 write(*,*)
'Number of successive cutback reached max number: ',cbbound
190 call hecmw_abort( hecmw_comm_get_comm() )
196 if( is_interaction_active .and. fstrparam%contact_algo ==
kcaslagrange )
then
202 if( hecmesh%my_rank == 0 )
write(*,*)
'### State has been restored at time =',
fstr_get_time()
205 if( sub_step == fstrsolid%step_ctrl(tot_step)%num_substep )
then
206 if( hecmesh%my_rank == 0 )
then
207 write(*,
'(a,i5,a,f6.3)')
'### Number of substeps reached max number: at total_step=', &
210 call hecmw_abort( hecmw_comm_get_comm())
214 time_2 = hecmw_wtime()
215 if( hecmesh%my_rank==0)
write(
imsg,
'(a,",",2(I8,","),f10.2)') &
216 &
'step, substep, solve (sec) :', tot_step_print, sub_step, time_2 - time_1
220 if( fstrsolid%CutBack_stat > 0 ) stop
224 step_count = step_count + 1
227 if( fstrsolid%restart_nout > 0)
then
228 if( mod(step_count,fstrsolid%restart_nout) == 0 )
then
238 &
fstrpr%solution_type, is_outpoint )
240 time_2 = hecmw_wtime()
241 if( hecmesh%my_rank==0 )
then
242 write(
imsg,
'(A,",",2(I8,","),f10.2)')
'step, substep, solve (sec) :', tot_step_print, sub_step, time_2 - time_1
243 write(
imsg,
'(A,I0,",",1pE15.8)')
'### stepcount (for output), time :', step_count,
fstr_get_time()
249 if( sub_step == fstrsolid%step_ctrl(tot_step)%num_substep )
then
250 if( hecmesh%my_rank == 0 )
then
251 write(*,
'(a,i5,a,f6.3)')
'### Number of substeps reached max number: at total_step=', &
258 sub_step = sub_step + 1
262 if( fstrsolid%restart_nout > 0 )
then
264 & hecmesh,fstrsolid,fstrparam,.true.,infoctchange%contactNode_current)
266 restart_substep_num = 1
267 if( fstrsolid%TEMP_irres > 0 )
exit
275 write(
imsg,
'("### FSTR_SOLVE_NLGEOM FINISHED!")')
276 write(*,
'("### FSTR_SOLVE_NLGEOM FINISHED!")')
285 subroutine table_nlsta(hecMESH, fstrSOLID, cstep, time, f_t)
286 type ( hecmwST_local_mesh ),
intent(in) :: hecMESH
287 type ( fstr_solid ),
intent(in) :: fstrSOLID
288 integer(kind=kint),
intent(in) :: cstep
289 real(kind=kreal),
intent(in) :: time
290 real(kind=kreal),
intent(out) :: f_t
292 integer(kind=kint) :: jj_n_amp
294 jj_n_amp = fstrsolid%step_ctrl( cstep )%amp_id
296 if( jj_n_amp <= 0 )
then
297 f_t = (time-fstrsolid%step_ctrl(cstep)%starttime)/fstrsolid%step_ctrl(cstep)%elapsetime
298 if( f_t>1.d0 ) f_t=1.d0
300 call table_amp(hecmesh, fstrsolid, cstep, jj_n_amp, time, f_t)