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)
138 call hecmw_mpc_tback_sol(hecmesh, hecmat, hecmatmpc)
151 ndof, iter, sub_step, cstep, &
161 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
162 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
172 fstrsolid%CutBack_stat = 0
175 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
182 restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT )
184 integer,
intent(in) :: cstep
185 type (hecmwST_local_mesh) :: hecMESH
186 type (hecmwST_matrix) :: hecMAT
187 type (fstr_solid) :: fstrSOLID
188 integer,
intent(in) :: sub_step
189 real(kind=kreal),
intent(in) :: ctime
190 real(kind=kreal),
intent(in) :: dtime
191 type (fstr_param) :: fstrPARAM
192 type (fstr_info_contactChange) :: infoCTChange
193 type (hecmwST_matrix_lagrange) :: hecLagMAT
194 type (hecmwST_matrix) :: conMAT
196 integer(kind=kint) :: ndof
197 integer(kind=kint) :: ctAlgo
198 integer(kind=kint) :: i, iter
199 integer(kind=kint) :: al_step, n_al_step, stepcnt, count_step
200 real(kind=kreal) :: tt0, tt, res, res0, res1, relres, tincr
201 integer(kind=kint) :: restart_step_num, restart_substep_num
202 logical :: convg, ctchange
203 integer(kind=kint) :: n_node_global
204 integer(kind=kint) :: contact_changed_global
205 real(kind=kreal),
allocatable :: coord(:)
206 integer(kind=kint) :: istat
207 logical :: is_first_Stiffmatrixcall
208 integer(kind=kint) :: iterStatus, nresid
209 real(kind=kreal),
allocatable :: resid_work(:)
213 n_node_global = hecmesh%nn_internal
214 call hecmw_allreduce_i1(hecmesh,n_node_global,hecmw_sum)
216 ctalgo = fstrparam%contact_algo
218 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, ctalgo, conmat)
220 if( cstep == 1 .and. sub_step == restart_substep_num )
then
222 if(hecmesh%my_rank==0)
write(*,*)
"---Scanning initial contact state---"
224 call hecmw_mat_copy_profile( hecmat, conmat )
227 elseif( hecmat%Iarray(99)==4 )
then
228 write(*, *)
' This type of direct solver is not yet available in such case ! '
229 write(*, *)
' Please change the solver type to intel MKL direct solver !'
230 call hecmw_abort(hecmw_comm_get_comm())
238 allocate(coord(hecmesh%n_node*ndof))
239 allocate(resid_work(hecmesh%n_node*ndof + conmat%NP*ndof))
242 n_al_step = fstrparam%augiter
244 is_first_stiffmatrixcall = .true.
246 loopforcontactanalysis:
do while( .true. )
247 count_step = count_step + 1
249 do al_step = 1, n_al_step
251 if( hecmesh%my_rank == 0)
then
252 write(*,*)
"Contact iter: ", count_step,
" Augmentation iter: ", al_step
260 do iter = 1,fstrsolid%step_ctrl(cstep)%max_iter
266 call hecmw_mat_clear( conmat )
270 if( is_first_stiffmatrixcall )
then
272 is_first_stiffmatrixcall = .false.
279 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, conmat)
288 call hecmw_update_r (hecmesh, hecmat%X, hecmat%NP, hecmesh%n_dof)
298 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
303 if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
304 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
307 call hecmw_mat_clear_b( conmat )
317 ndof, iter, sub_step, cstep, &
318 resid_work, nresid, &
324 fstrsolid%NRstat_i(knstciter) = al_step
331 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
332 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
339 call hecmw_mat_clear_b( conmat )
355 contact_changed_global = 0
358 contact_changed_global = 1
360 call hecmw_allreduce_i1(hecmesh, contact_changed_global, hecmw_max)
361 if (contact_changed_global > 0)
then
362 call hecmw_mat_clear_b( hecmat )
363 call hecmw_mat_clear_b( conmat )
367 if(
fstr_is_contact_conv(ctalgo,infoctchange,hecmesh) .and. .not. ctchange )
exit loopforcontactanalysis
370 if( count_step >= fstrsolid%step_ctrl(cstep)%max_contiter )
then
371 if( hecmesh%my_rank == 0)
then
372 write( *,
'(a,i5,a,i5)')
' ### Contact failed to Converge : at total_step=', cstep,
' sub_step=', sub_step
374 fstrsolid%NRstat_i(knstciter) = count_step
375 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
376 fstrsolid%NRstat_i(knstdresn) = 3
384 call hecmw_mat_clear_b( conmat )
391 enddo loopforcontactanalysis
397 fstrsolid%NRstat_i(knstciter) = count_step
405 deallocate(resid_work)
406 fstrsolid%CutBack_stat = 0
412 restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT )
414 integer,
intent(in) :: cstep
415 type (hecmwST_local_mesh) :: hecMESH
416 type (hecmwST_matrix) :: hecMAT
417 type (fstr_solid) :: fstrSOLID
418 integer,
intent(in) :: sub_step
419 real(kind=kreal),
intent(in) :: ctime
420 real(kind=kreal),
intent(in) :: dtime
421 type (fstr_param) :: fstrPARAM
422 type (fstr_info_contactChange) :: infoCTChange
423 type (hecmwST_matrix_lagrange) :: hecLagMAT
424 type (hecmwST_matrix) :: conMAT
426 integer(kind=kint) :: ndof
427 integer(kind=kint) :: ctAlgo
428 integer(kind=kint) :: i, iter, max_iter_contact
429 integer(kind=kint) :: stepcnt, count_step
430 real(kind=kreal) :: tt0, tt, res, res0, res1, relres, tincr, resx
431 integer(kind=kint) :: restart_step_num, restart_substep_num
432 logical :: is_mat_symmetric
433 integer(kind=kint) :: n_node_global
434 integer(kind=kint) :: contact_changed_global
435 integer(kint) :: nndof
436 real(kreal) :: q_residual,x_residual
437 real(kind=kreal),
allocatable :: coord(:)
438 integer(kind=kint) :: istat
439 integer(kind=kint) :: iterStatus, nresid
440 real(kind=kreal),
allocatable :: resid_work(:)
442 ctalgo = fstrparam%contact_algo
445 n_node_global = hecmesh%nn_internal
446 call hecmw_allreduce_i1(hecmesh,n_node_global,hecmw_sum)
449 write(*, *)
' This type of direct solver is not yet available in such case ! '
450 write(*, *)
' Please use intel MKL direct solver !'
451 call hecmw_abort( hecmw_comm_get_comm() )
454 do i=1,fstrsolid%n_contacts
455 fstrsolid%contacts(i)%ctime = ctime + dtime
458 if( cstep==1 .and. sub_step==restart_substep_num )
then
461 call hecmw_mat_copy_profile( hecmat, conmat )
464 elseif( hecmat%Iarray(99)==4 )
then
465 write(*, *)
' This type of direct solver is not yet available in such case ! '
466 write(*, *)
' Please change the solver type to intel MKL direct solver !'
467 call hecmw_abort(hecmw_comm_get_comm())
473 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, ctalgo, conmat)
477 allocate(coord(hecmesh%n_node*ndof))
478 allocate(resid_work(hecmesh%n_node*ndof + conmat%NP*ndof))
480 loopforcontactanalysis:
do while( .true. )
481 count_step = count_step+1
488 do iter = 1, fstrsolid%step_ctrl(cstep)%max_iter
489 call hecmw_barrier(hecmesh)
490 if(
myrank == 0 ) print *,
'-------------------------------------------------'
491 call hecmw_barrier(hecmesh)
497 call hecmw_mat_clear( conmat )
505 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, conmat)
507 nndof = hecmat%N*hecmat%ndof
517 if( istat /= 0 )
then
518 if( hecmesh%my_rank == 0)
then
519 write( *,
'(a,i5,a,i5)')
' ### Fail to Converge : at total_step=', cstep,
' sub_step=', sub_step
521 fstrsolid%NRstat_i(knstdresn) = 4
522 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
528 call hecmw_innerproduct_r(hecmesh,ndof,hecmat%X,hecmat%X,resx)
529 resx = sqrt(resx)/n_node_global
531 if( hecmesh%my_rank==0 )
then
532 write(*,
'(a,i3,a,e15.7)')
' - ResidualX (',iter,
') =',resx
533 write(*,
'(a,i3,a,e15.7)')
' - ResidualX+LAG(',iter,
') =',sqrt(x_residual)/n_node_global
534 write(*,
'(a,i3,a,e15.7)')
' - ResidualQ (',iter,
') =',sqrt(q_residual)/n_node_global
542 do i = 1, heclagmat%num_lagrange
543 heclagmat%lagrange(i) = heclagmat%lagrange(i)+hecmat%X(hecmesh%n_node*ndof+i)
550 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
555 if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
556 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
561 call hecmw_mat_clear_b( conmat )
572 ndof, iter, sub_step, cstep, &
573 resid_work, nresid, &
581 fstrsolid%NRstat_i(knstciter) = count_step
592 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
593 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
598 write(*, *)
' This type of direct solver is not yet available in such case ! '
599 write(*, *)
' Please use intel MKL direct solver !'
600 call hecmw_abort( hecmw_comm_get_comm() )
604 contact_changed_global = 0
607 contact_changed_global = 1
612 call hecmw_allreduce_i1(hecmesh, contact_changed_global, hecmw_max)
613 if (contact_changed_global > 0)
then
614 call hecmw_mat_clear_b( hecmat )
615 call hecmw_mat_clear_b( conmat )
620 if( count_step >= fstrsolid%step_ctrl(cstep)%max_contiter )
then
621 if( hecmesh%my_rank == 0)
then
622 write( *,
'(a,i5,a,i5)')
' ### Contact failed to Converge : at total_step=', cstep,
' sub_step=', sub_step
624 fstrsolid%NRstat_i(knstciter) = count_step
625 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
626 fstrsolid%NRstat_i(knstdresn) = 3
634 call hecmw_mat_clear_b( conmat )
641 enddo loopforcontactanalysis
643 fstrsolid%NRstat_i(knstciter) = count_step
652 call fstr_setup_parancon_contactvalue(hecmesh,ndof,fstrsolid%EMBED_NFORCE,1)
659 deallocate(resid_work)
660 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 kitrdiverged
logical paracontactflag
PARALLEL CONTACT FLAG.
This modules just summarizes all modules used in static analysis.
This module provides functions to output result.