33 & ctime, tincr, iter, cstep, dtime, fstrPARAM, hecLagMAT, ndof, ctAlgo, conMAT)
36 type (hecmwST_local_mesh) :: hecMESH
37 type (hecmwST_matrix) :: hecMAT
38 type (fstr_solid) :: fstrSOLID
39 real(kind=kreal),
intent(in) :: ctime
40 real(kind=kreal),
intent(in) :: dtime
41 type (fstr_param) :: fstrPARAM
42 real(kind=kreal),
intent(inout) :: tincr
43 integer(kind=kint) :: iter
44 integer,
intent(in) :: cstep
45 type (hecmwST_matrix_lagrange) :: hecLagMAT
46 integer(kind=kint),
intent(inout) :: ndof
47 integer(kind=kint),
intent(in) :: ctAlgo
48 type (hecmwST_matrix) :: conMAT
50 hecmat%NDOF = hecmesh%n_dof
54 if( fstrsolid%step_ctrl(cstep)%solution == stepstatic ) tincr = 0.d0
56 fstrsolid%dunode(:) = 0.0d0
57 fstrsolid%NRstat_i(:) = 0
59 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
61 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
67 call hecmw_mat_clear_b(conmat)
78 subroutine fstr_newton( cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, &
79 restrt_step_num, sub_step, ctime, dtime )
81 integer,
intent(in) :: cstep
82 type (hecmwST_local_mesh) :: hecMESH
83 type (hecmwST_matrix) :: hecMAT
84 type (fstr_solid) :: fstrSOLID
85 integer,
intent(in) :: sub_step
86 real(kind=kreal),
intent(in) :: ctime
87 real(kind=kreal),
intent(in) :: dtime
88 type (fstr_param) :: fstrPARAM
89 type (hecmwST_matrix_lagrange) :: hecLagMAT
91 type (hecmwST_local_mesh),
pointer :: hecMESHmpc
92 type (hecmwST_matrix),
pointer :: hecMATmpc
93 integer(kind=kint) :: ndof
94 integer(kind=kint) :: i, iter
95 integer(kind=kint) :: stepcnt
96 integer(kind=kint) :: restrt_step_num
97 real(kind=kreal) :: tt0, tt, res, qnrm, rres, tincr, xnrm, dunrm, rxnrm
98 real(kind=kreal),
allocatable :: coord(:), p(:)
99 logical :: isLinear = .false.
100 integer(kind=kint) :: iterStatus
102 call hecmw_mpc_mat_init(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
104 if(.not.
fstrpr%nlgeom)
then
108 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, 0, hecmat)
110 allocate(p(hecmesh%n_node*ndof))
111 allocate(coord(hecmesh%n_node*ndof))
116 do iter=1,fstrsolid%step_ctrl(cstep)%max_iter
123 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt)
124 call hecmw_mpc_mat_ass(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
125 call hecmw_mpc_trans_rhs(hecmesh, hecmat, hecmatmpc)
128 if( sub_step == restrt_step_num .and. iter == 1 ) hecmatmpc%Iarray(98) = 1
130 hecmatmpc%Iarray(97) = 2
132 hecmatmpc%Iarray(97) = 1
136 call solve_lineq(hecmeshmpc,hecmatmpc)
139 if( hecmw_mat_get_flag_converged(hecmatmpc) ==
kno )
then
140 if( hecmesh%my_rank == 0)
then
141 write( *,
'(a,i5,a,i5)')
' ### Fail to Converge : at total_step=', cstep,
' sub_step=', sub_step
143 fstrsolid%NRstat_i(knstdresn) = 4
144 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
147 call hecmw_mpc_tback_sol(hecmesh, hecmat, hecmatmpc)
160 ndof, iter, sub_step, cstep, &
170 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
171 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
181 fstrsolid%CutBack_stat = 0
184 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
191 restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT )
193 integer,
intent(in) :: cstep
194 type (hecmwST_local_mesh) :: hecMESH
195 type (hecmwST_matrix) :: hecMAT
196 type (fstr_solid) :: fstrSOLID
197 integer,
intent(in) :: sub_step
198 real(kind=kreal),
intent(in) :: ctime
199 real(kind=kreal),
intent(in) :: dtime
200 type (fstr_param) :: fstrPARAM
201 type (fstr_info_contactChange) :: infoCTChange
202 type (hecmwST_matrix_lagrange) :: hecLagMAT
203 type (hecmwST_matrix) :: conMAT
205 integer(kind=kint) :: ndof
206 integer(kind=kint) :: ctAlgo
207 integer(kind=kint) :: i, iter
208 integer(kind=kint) :: al_step, n_al_step, stepcnt, count_step
209 real(kind=kreal) :: tt0, tt, res, res0, res1, relres, tincr
210 integer(kind=kint) :: restart_step_num, restart_substep_num
211 logical :: convg, ctchange
212 integer(kind=kint) :: n_node_global
213 integer(kind=kint) :: contact_changed_global
214 real(kind=kreal),
allocatable :: coord(:)
215 integer(kind=kint) :: istat
216 logical :: is_first_Stiffmatrixcall
217 integer(kind=kint) :: iterStatus, nresid
218 real(kind=kreal),
allocatable :: resid_work(:)
222 n_node_global = hecmesh%nn_internal
223 call hecmw_allreduce_i1(hecmesh,n_node_global,hecmw_sum)
225 ctalgo = fstrparam%contact_algo
227 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, ctalgo, conmat)
229 if( cstep == 1 .and. sub_step == restart_substep_num )
then
231 if( restart_step_num > 1 .or. restart_substep_num > 1 )
then
233 infoctchange%contactNode_current = infoctchange%contactNode_previous
235 if(hecmesh%my_rank==0)
write(*,*)
"---Scanning initial contact state---"
238 call hecmw_mat_copy_profile( hecmat, conmat )
241 elseif( hecmat%Iarray(99)==4 )
then
242 write(*, *)
' This type of direct solver is not yet available in such case ! '
243 write(*, *)
' Please change the solver type to intel MKL direct solver !'
244 call hecmw_abort(hecmw_comm_get_comm())
252 allocate(coord(hecmesh%n_node*ndof))
253 allocate(resid_work(hecmesh%n_node*ndof + conmat%NP*ndof))
256 n_al_step = fstrparam%augiter
258 is_first_stiffmatrixcall = .true.
260 loopforcontactanalysis:
do while( .true. )
261 count_step = count_step + 1
263 do al_step = 1, n_al_step
265 if( hecmesh%my_rank == 0)
then
266 write(*,*)
"Contact iter: ", count_step,
" Augmentation iter: ", al_step
274 do iter = 1,fstrsolid%step_ctrl(cstep)%max_iter
280 call hecmw_mat_clear( conmat )
284 if( is_first_stiffmatrixcall )
then
286 is_first_stiffmatrixcall = .false.
293 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, conmat)
302 call hecmw_update_r (hecmesh, hecmat%X, hecmat%NP, hecmesh%n_dof)
312 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
317 if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
318 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
321 call hecmw_mat_clear_b( conmat )
331 ndof, iter, sub_step, cstep, &
332 resid_work, nresid, &
338 fstrsolid%NRstat_i(knstciter) = al_step
345 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
346 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
353 call hecmw_mat_clear_b( conmat )
369 contact_changed_global = 0
372 contact_changed_global = 1
374 call hecmw_allreduce_i1(hecmesh, contact_changed_global, hecmw_max)
375 if (contact_changed_global > 0)
then
376 call hecmw_mat_clear_b( hecmat )
377 call hecmw_mat_clear_b( conmat )
381 if(
fstr_is_contact_conv(ctalgo,infoctchange,hecmesh) .and. .not. ctchange )
exit loopforcontactanalysis
384 if( count_step >= fstrsolid%step_ctrl(cstep)%max_contiter )
then
385 if( hecmesh%my_rank == 0)
then
386 write( *,
'(a,i5,a,i5)')
' ### Contact failed to Converge : at total_step=', cstep,
' sub_step=', sub_step
388 fstrsolid%NRstat_i(knstciter) = count_step
389 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
390 fstrsolid%NRstat_i(knstdresn) = 3
398 call hecmw_mat_clear_b( conmat )
405 enddo loopforcontactanalysis
411 fstrsolid%NRstat_i(knstciter) = count_step
419 deallocate(resid_work)
420 fstrsolid%CutBack_stat = 0
426 restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT )
428 integer,
intent(in) :: cstep
429 type (hecmwST_local_mesh) :: hecMESH
430 type (hecmwST_matrix) :: hecMAT
431 type (fstr_solid) :: fstrSOLID
432 integer,
intent(in) :: sub_step
433 real(kind=kreal),
intent(in) :: ctime
434 real(kind=kreal),
intent(in) :: dtime
435 type (fstr_param) :: fstrPARAM
436 type (fstr_info_contactChange) :: infoCTChange
437 type (hecmwST_matrix_lagrange) :: hecLagMAT
438 type (hecmwST_matrix) :: conMAT
440 integer(kind=kint) :: ndof
441 integer(kind=kint) :: ctAlgo
442 integer(kind=kint) :: i, iter, max_iter_contact
443 integer(kind=kint) :: stepcnt, count_step
444 real(kind=kreal) :: tt0, tt, res, res0, res1, relres, tincr, resx
445 integer(kind=kint) :: restart_step_num, restart_substep_num
446 logical :: is_mat_symmetric
447 integer(kind=kint) :: n_node_global
448 integer(kind=kint) :: contact_changed_global
449 integer(kint) :: nndof
450 real(kreal) :: q_residual,x_residual
451 real(kind=kreal),
allocatable :: coord(:)
452 integer(kind=kint) :: istat
453 integer(kind=kint) :: iterStatus, nresid
454 real(kind=kreal),
allocatable :: resid_work(:)
456 ctalgo = fstrparam%contact_algo
459 n_node_global = hecmesh%nn_internal
460 call hecmw_allreduce_i1(hecmesh,n_node_global,hecmw_sum)
463 write(*, *)
' This type of direct solver is not yet available in such case ! '
464 write(*, *)
' Please use intel MKL direct solver !'
465 call hecmw_abort( hecmw_comm_get_comm() )
468 do i=1,fstrsolid%n_contacts
469 fstrsolid%contacts(i)%ctime = ctime + dtime
472 if( cstep==1 .and. sub_step==restart_substep_num )
then
474 if( restart_step_num > 1 .or. restart_substep_num > 1 )
then
476 infoctchange%contactNode_current = infoctchange%contactNode_previous
480 call hecmw_mat_copy_profile( hecmat, conmat )
483 elseif( hecmat%Iarray(99)==4 )
then
484 write(*, *)
' This type of direct solver is not yet available in such case ! '
485 write(*, *)
' Please change the solver type to intel MKL direct solver !'
486 call hecmw_abort(hecmw_comm_get_comm())
492 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, ctalgo, conmat)
496 allocate(coord(hecmesh%n_node*ndof))
497 allocate(resid_work(hecmesh%n_node*ndof + conmat%NP*ndof))
499 loopforcontactanalysis:
do while( .true. )
500 count_step = count_step+1
507 do iter = 1, fstrsolid%step_ctrl(cstep)%max_iter
508 call hecmw_barrier(hecmesh)
509 if(
myrank == 0 ) print *,
'-------------------------------------------------'
510 call hecmw_barrier(hecmesh)
516 call hecmw_mat_clear( conmat )
524 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, conmat)
526 nndof = hecmat%N*hecmat%ndof
536 if( istat /= 0 )
then
537 if( hecmesh%my_rank == 0)
then
538 write( *,
'(a,i5,a,i5)')
' ### Fail to Converge : at total_step=', cstep,
' sub_step=', sub_step
540 fstrsolid%NRstat_i(knstdresn) = 4
541 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
547 call hecmw_innerproduct_r(hecmesh,ndof,hecmat%X,hecmat%X,resx)
548 resx = sqrt(resx)/n_node_global
550 if( hecmesh%my_rank==0 )
then
551 write(*,
'(a,i3,a,e15.7)')
' - ResidualX (',iter,
') =',resx
552 write(*,
'(a,i3,a,e15.7)')
' - ResidualX+LAG(',iter,
') =',sqrt(x_residual)/n_node_global
553 write(*,
'(a,i3,a,e15.7)')
' - ResidualQ (',iter,
') =',sqrt(q_residual)/n_node_global
561 do i = 1, heclagmat%num_lagrange
562 heclagmat%lagrange(i) = heclagmat%lagrange(i)+hecmat%X(hecmesh%n_node*ndof+i)
569 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
574 if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
575 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
580 call hecmw_mat_clear_b( conmat )
591 ndof, iter, sub_step, cstep, &
592 resid_work, nresid, &
600 fstrsolid%NRstat_i(knstciter) = count_step
611 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
612 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
617 write(*, *)
' This type of direct solver is not yet available in such case ! '
618 write(*, *)
' Please use intel MKL direct solver !'
619 call hecmw_abort( hecmw_comm_get_comm() )
623 contact_changed_global = 0
626 contact_changed_global = 1
631 call hecmw_allreduce_i1(hecmesh, contact_changed_global, hecmw_max)
632 if (contact_changed_global > 0)
then
633 call hecmw_mat_clear_b( hecmat )
634 call hecmw_mat_clear_b( conmat )
639 if( count_step >= fstrsolid%step_ctrl(cstep)%max_contiter )
then
640 if( hecmesh%my_rank == 0)
then
641 write( *,
'(a,i5,a,i5)')
' ### Contact failed to Converge : at total_step=', cstep,
' sub_step=', sub_step
643 fstrsolid%NRstat_i(knstciter) = count_step
644 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
645 fstrsolid%NRstat_i(knstdresn) = 3
653 call hecmw_mat_clear_b( conmat )
660 enddo loopforcontactanalysis
662 fstrsolid%NRstat_i(knstciter) = count_step
671 call fstr_setup_parancon_contactvalue(hecmesh,ndof,fstrsolid%EMBED_NFORCE,1)
678 deallocate(resid_work)
679 fstrsolid%CutBack_stat = 0
This module provides a function to deal with prescribed displacement.
subroutine fstr_addbc(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, hecLagMAT, iter, conMAT, RHSvector)
Add Essential Boundary Conditions.
This module provides functions to take into account external load.
subroutine fstr_ass_load(cstep, ctime, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
This subroutine assmble following external force into fstrSOLIDGL and hecMATB afterwards.
This module assembles the tangent stiffness matrix and, in the implicit dynamic case,...
subroutine, public fstr_creatematrix_and_dampingforce(hecMESH, hecMAT, fstrSOLID, time, tincr, fstrDYNAMIC, coef)
Assemble the system matrix and, optionally, the dynamic damping force.
This module provide a function to elemact elements.
subroutine fstr_update_elemact_solid_by_value(hecMESH, fstrSOLID, cstep, ctime)
This module provides a unified convergence check for Newton iteration.
subroutine, public fstr_check_convergence(hecMESH, hecMAT, fstrSOLID, fstrPR, ndof, iter, sub_step, cstep, residual_vec, nresid, resb, res_prev, n_node_global, iterStatus, maxDLag, converg_dlag)
Wrapper that calls fstr_check_convergence_main and applies the common divergence/NaN handling (status...
Finite-rotation nodal kinematics for NLGEOM.
subroutine, public fstr_apply_solution_increment(hecMESH, fstrSOLID, ndof, x)
Apply the linear-solver solution increment x to the step displacement dunode.
subroutine, public fstr_commit_solution_increment(hecMESH, fstrSOLID, ndof)
Commit the converged step increment dunode into the total displacement unode.
This module provides functions on nonlinear analysis.
subroutine fstr_newton_contactslag(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, hecLagMAT, restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT)
This subroutine solve nonlinear solid mechanics problems by Newton-Raphson method....
subroutine fstr_newton_contactalag(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT)
This subroutine solve nonlinear solid mechanics problems by Newton-Raphson method combined with Neste...
subroutine fstr_init_newton(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM, hecLagMAT, ndof, ctAlgo, conMAT)
subroutine fstr_newton(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, restrt_step_num, sub_step, ctime, dtime)
This subroutine solve nonlinear solid mechanics problems by Newton-Raphson method.
This module provides function to calculate residual of nodal force.
subroutine, public fstr_update_ndforce_spc(cstep, hecMESH, fstrSOLID, B)
subroutine, public fstr_update_ndforce(cstep, hecMESH, hecMAT, fstrSOLID, conMAT)
real(kind=kreal) function, public fstr_get_norm_para_contact(hecMAT, hecLagMAT, conMAT, hecMESH)
subroutine fstr_calc_residual_vector(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
\breaf This subroutine calculate residual vector
subroutine, public fstr_assemble_residual_contact(hecMAT, hecLagMAT, conMAT, hecMESH, resid_vec, nresid)
Assemble contact residual vector (hecMATB + conMATB + Lagrange) into a single vector.
real(kind=kreal) function, public fstr_get_x_norm_contact(hecMAT, hecLagMAT, hecMESH)
subroutine, public fstr_update_reaction_spc(cstep, hecMESH, fstrSOLID)
Set fstrSOLIDREACTION at constrained DOFs using current fstrSOLIDQFORCE. Constrained DOFs are enumera...
This module provides functions to read in and write out restart files.
This module provides functions to deal with spring force.
subroutine fstr_addspring(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
This module provides function to calculate to do updates.
subroutine fstr_updatestate(hecMESH, fstrSOLID, tincr)
Update elastiplastic status.
subroutine fstr_updatenewton(hecMESH, hecMAT, fstrSOLID, time, tincr, iter, strainEnergy)
Update displacement, stress, strain and internal forces.
This module defines common data and basic structures for analysis.
integer(kind=kint) myrank
PARALLEL EXECUTION.
subroutine fstr_recover_initial_config_to_mesh(hecMESH, fstrSOLID, coord)
integer(kind=kint), parameter kitrfloatingerror
integer(kind=kint), parameter kitrconverged
subroutine fstr_set_current_config_to_mesh(hecMESH, fstrSOLID, coord)
type(fstr_param), target fstrpr
GLOBAL VARIABLE INITIALIZED IN FSTR_SETUP.
integer(kind=kint), parameter kno
integer(kind=kint), parameter kitrdiverged
logical paracontactflag
PARALLEL CONTACT FLAG.
This modules just summarizes all modules used in static analysis.
This module provides functions to output result.