34 & ctime, tincr, iter, cstep, dtime, fstrPARAM, hecLagMAT, ndof, ctAlgo, conMAT)
37 type (hecmwST_local_mesh) :: hecMESH
38 type (hecmwST_matrix) :: hecMAT
39 type (fstr_solid) :: fstrSOLID
40 real(kind=kreal),
intent(in) :: ctime
41 real(kind=kreal),
intent(in) :: dtime
42 type (fstr_param) :: fstrPARAM
43 real(kind=kreal),
intent(inout) :: tincr
44 integer(kind=kint) :: iter
45 integer,
intent(in) :: cstep
46 type (hecmwST_matrix_lagrange) :: hecLagMAT
47 integer(kind=kint),
intent(inout) :: ndof
48 integer(kind=kint),
intent(in) :: ctAlgo
49 type (hecmwST_matrix) :: conMAT
51 hecmat%NDOF = hecmesh%n_dof
60 if( fstrsolid%step_ctrl(cstep)%solution == stepstatic ) tincr = 0.d0
62 fstrsolid%dunode(:) = 0.0d0
63 fstrsolid%NRstat_i(:) = 0
65 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
67 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
74 if(
associated(conmat%B) .and. .not.
associated(conmat%B, hecmat%B) )
call hecmw_mat_clear_b(conmat)
86 subroutine fstr_newton( cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, &
87 restrt_step_num, sub_step, ctime, dtime )
89 integer,
intent(in) :: cstep
90 type (hecmwST_local_mesh) :: hecMESH
91 type (hecmwST_matrix) :: hecMAT
92 type (fstr_solid) :: fstrSOLID
93 integer,
intent(in) :: sub_step
94 real(kind=kreal),
intent(in) :: ctime
95 real(kind=kreal),
intent(in) :: dtime
96 type (fstr_param) :: fstrPARAM
97 type (hecmwST_matrix_lagrange) :: hecLagMAT
99 type (hecmwST_local_mesh),
pointer :: hecMESHmpc
100 type (hecmwST_matrix),
pointer :: hecMATmpc
101 type (hecmwST_ebc) :: hecEBC
102 integer(kind=kint) :: ndof
103 integer(kind=kint) :: iter
104 integer(kind=kint) :: stepcnt
105 integer(kind=kint) :: restrt_step_num
106 real(kind=kreal) :: tincr
107 real(kind=kreal),
allocatable :: coord(:), p(:)
108 logical :: isLinear = .false.
109 integer(kind=kint) :: iterStatus
110 type(fstr_convergence_state) :: cnvstat
112 call hecmw_mpc_mat_init(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
114 if(.not. fstrparam%nlgeom)
then
118 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, 0, hecmat)
120 allocate(p(hecmesh%n_node*ndof))
121 allocate(coord(hecmesh%n_node*ndof))
126 do iter=1,fstrsolid%step_ctrl(cstep)%max_iter
134 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, hecebc)
135 call hecmw_mpc_mat_ass(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
136 call hecmw_mpc_trans_rhs(hecmesh, hecmat, hecmatmpc)
140 if( sub_step == restrt_step_num .and. iter == 1 ) hecmatmpc%Iarray(98) = 1
142 hecmatmpc%Iarray(97) = 2
144 hecmatmpc%Iarray(97) = 1
148 call solve_lineq(hecmeshmpc,hecmatmpc)
154 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
157 call hecmw_mpc_tback_sol(hecmesh, hecmat, hecmatmpc)
170 ndof, iter, sub_step, cstep, &
171 hecmat%B, cnvstat, iterstatus)
175 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
181 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
182 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
192 fstrsolid%CutBack_stat = 0
196 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
203 restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT )
205 integer,
intent(in) :: cstep
206 type (hecmwST_local_mesh) :: hecMESH
207 type (hecmwST_matrix) :: hecMAT
208 type (fstr_solid) :: fstrSOLID
209 integer,
intent(in) :: sub_step
210 real(kind=kreal),
intent(in) :: ctime
211 real(kind=kreal),
intent(in) :: dtime
212 type (fstr_param) :: fstrPARAM
213 type (fstr_info_contactChange) :: infoCTChange
214 type (hecmwST_matrix_lagrange) :: hecLagMAT
215 type (hecmwST_matrix) :: conMAT
217 type (hecmwST_ebc) :: hecEBC
218 integer(kind=kint) :: ndof
219 integer(kind=kint) :: ctAlgo
220 integer(kind=kint) :: iter
221 integer(kind=kint) :: al_step, n_al_step, stepcnt, count_step
222 real(kind=kreal) :: tincr
223 integer(kind=kint) :: restart_step_num, restart_substep_num
225 integer(kind=kint) :: contact_changed_global
226 logical :: need_prof_refresh
227 real(kind=kreal),
allocatable :: coord(:)
228 integer(kind=kint) :: istat
229 logical :: is_first_Stiffmatrixcall
230 integer(kind=kint) :: iterStatus, nresid
231 real(kind=kreal),
allocatable :: resid_work(:)
232 type(fstr_convergence_state) :: cnvstat
234 ctalgo = fstrparam%contact_algo
239 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, ctalgo, conmat)
241 if( cstep == 1 .and. sub_step == restart_substep_num )
then
243 if( restart_step_num > 1 .or. restart_substep_num > 1 )
then
245 infoctchange%contactNode_current = infoctchange%contactNode_previous
247 if(hecmesh%my_rank==0)
write(*,*)
"---Scanning initial contact state---"
250 call hecmw_mat_copy_profile( hecmat, conmat )
253 elseif( hecmat%Iarray(99)==4 )
then
254 write(*, *)
' This type of direct solver is not yet available in such case ! '
255 write(*, *)
' Please change the solver type to intel MKL direct solver !'
256 call hecmw_abort(hecmw_comm_get_comm())
268 allocate(coord(hecmesh%n_node*ndof))
269 allocate(resid_work(hecmesh%n_node*ndof + conmat%NP*ndof))
272 n_al_step = fstrparam%augiter
274 is_first_stiffmatrixcall = .true.
276 loopforcontactanalysis:
do while( .true. )
277 count_step = count_step + 1
279 do al_step = 1, n_al_step
281 if( hecmesh%my_rank == 0)
then
282 write(*,*)
"Contact iter: ", count_step,
" Augmentation iter: ", al_step
286 do iter = 1,fstrsolid%step_ctrl(cstep)%max_iter
292 call hecmw_mat_clear( conmat )
296 if( is_first_stiffmatrixcall )
then
298 is_first_stiffmatrixcall = .false.
306 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, hecebc, conmat)
318 fstrsolid%NRstat_i(knstciter) = count_step
322 call hecmw_update_r (hecmesh, hecmat%X, hecmat%NP, hecmesh%n_dof)
330 call fstr_updatenewton(hecmesh, hecmat, fstrsolid, fstrparam, ctime, tincr, iter)
332 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
337 if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
338 call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam)
341 call hecmw_mat_clear_b( conmat )
350 ndof, iter, sub_step, cstep, &
351 resid_work, cnvstat, iterstatus, heclagmat)
354 fstrsolid%NRstat_i(knstciter) = count_step
361 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
362 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
369 call hecmw_mat_clear_b( conmat )
385 contact_changed_global = 0
388 need_prof_refresh = .false.
393 contact_changed_global = 1
395 call hecmw_allreduce_i1(hecmesh, contact_changed_global, hecmw_max)
396 if (contact_changed_global > 0)
then
397 call hecmw_mat_clear_b( hecmat )
398 call hecmw_mat_clear_b( conmat )
402 if(
fstr_is_contact_conv(ctalgo,infoctchange,hecmesh) .and. .not. ctchange )
exit loopforcontactanalysis
405 if( count_step >= fstrsolid%step_ctrl(cstep)%max_contiter )
then
406 if( hecmesh%my_rank == 0)
then
407 write( *,
'(a,i5,a,i5)')
' ### Contact failed to Converge : at total_step=', cstep,
' sub_step=', sub_step
409 fstrsolid%NRstat_i(knstciter) = count_step
410 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
411 fstrsolid%NRstat_i(knstdresn) = 3
419 call hecmw_mat_clear_b( conmat )
426 enddo loopforcontactanalysis
432 fstrsolid%NRstat_i(knstciter) = count_step
443 deallocate(resid_work)
444 fstrsolid%CutBack_stat = 0
450 restart_step_num, restart_substep_num, sub_step, ctime, dtime, infoCTChange, conMAT )
452 integer,
intent(in) :: cstep
453 type (hecmwst_local_mesh) :: hecMESH
454 type (hecmwST_matrix) :: hecMAT
455 type (fstr_solid) :: fstrSOLID
456 integer,
intent(in) :: sub_step
457 real(kind=kreal),
intent(in) :: ctime
458 real(kind=kreal),
intent(in) :: dtime
459 type (fstr_param) :: fstrPARAM
460 type (fstr_info_contactChange) :: infoCTChange
461 type (hecmwST_matrix_lagrange) :: hecLagMAT
462 type (hecmwST_matrix) :: conMAT
464 type (hecmwST_ebc) :: hecEBC
465 integer(kind=kint) :: ndof
466 integer(kind=kint) :: ctAlgo
467 integer(kind=kint) :: i, iter
468 integer(kind=kint) :: stepcnt, count_step
469 real(kind=kreal) :: tincr
470 integer(kind=kint) :: restart_step_num, restart_substep_num
471 logical :: is_mat_symmetric
472 integer(kind=kint) :: contact_changed_global
473 real(kind=kreal),
allocatable :: coord(:)
474 integer(kind=kint) :: istat
475 integer(kind=kint) :: iterStatus, nresid
476 real(kind=kreal),
allocatable :: resid_work(:)
477 type(fstr_convergence_state) :: cnvstat
479 ctalgo = fstrparam%contact_algo
482 write(*, *)
' This type of direct solver is not yet available in such case ! '
483 write(*, *)
' Please use intel MKL direct solver !'
484 call hecmw_abort( hecmw_comm_get_comm() )
487 do i=1,fstrsolid%n_contacts
488 fstrsolid%contacts(i)%ctime = ctime + dtime
491 if( cstep==1 .and. sub_step==restart_substep_num )
then
493 if( restart_step_num > 1 .or. restart_substep_num > 1 )
then
495 infoctchange%contactNode_current = infoctchange%contactNode_previous
499 call hecmw_mat_copy_profile( hecmat, conmat )
502 elseif( hecmat%Iarray(99)==4 )
then
503 write(*, *)
' This type of direct solver is not yet available in such case ! '
504 write(*, *)
' Please change the solver type to intel MKL direct solver !'
505 call hecmw_abort(hecmw_comm_get_comm())
511 call fstr_init_newton(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam, heclagmat, ndof, ctalgo, conmat)
515 allocate(coord(hecmesh%n_node*ndof))
516 allocate(resid_work(hecmesh%n_node*ndof + conmat%NP*ndof))
518 loopforcontactanalysis:
do while( .true. )
519 count_step = count_step+1
522 do iter = 1, fstrsolid%step_ctrl(cstep)%max_iter
523 call hecmw_barrier(hecmesh)
524 if(
myrank == 0 ) print *,
'-------------------------------------------------'
525 call hecmw_barrier(hecmesh)
531 call hecmw_mat_clear( conmat )
540 call fstr_addbc(cstep, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, stepcnt, hecebc, conmat)
552 fstrsolid%NRstat_i(knstciter) = count_step
561 do i = 1, heclagmat%num_lagrange
562 heclagmat%lagrange(i) = heclagmat%lagrange(i)+hecmat%X(hecmesh%n_node*ndof+i)
567 call fstr_updatenewton(hecmesh, hecmat, fstrsolid, fstrparam, ctime, tincr, iter)
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 )
589 ndof, iter, sub_step, cstep, &
590 resid_work, cnvstat, iterstatus, heclagmat)
595 fstrsolid%NRstat_i(knstciter) = count_step
606 fstrsolid%NRstat_i(knstmaxit) = max(fstrsolid%NRstat_i(knstmaxit),iter)
607 fstrsolid%NRstat_i(knstsumit) = fstrsolid%NRstat_i(knstsumit) + iter
612 write(*, *)
' This type of direct solver is not yet available in such case ! '
613 write(*, *)
' Please use intel MKL direct solver !'
614 call hecmw_abort( hecmw_comm_get_comm() )
618 contact_changed_global = 0
621 contact_changed_global = 1
626 call hecmw_allreduce_i1(hecmesh, contact_changed_global, hecmw_max)
627 if (contact_changed_global > 0)
then
628 call hecmw_mat_clear_b( hecmat )
629 call hecmw_mat_clear_b( conmat )
634 if( count_step >= fstrsolid%step_ctrl(cstep)%max_contiter )
then
635 if( hecmesh%my_rank == 0)
then
636 write( *,
'(a,i5,a,i5)')
' ### Contact failed to Converge : at total_step=', cstep,
' sub_step=', sub_step
638 fstrsolid%NRstat_i(knstciter) = count_step
639 fstrsolid%CutBack_stat = fstrsolid%CutBack_stat + 1
640 fstrsolid%NRstat_i(knstdresn) = 3
648 call hecmw_mat_clear_b( conmat )
655 enddo loopforcontactanalysis
657 fstrsolid%NRstat_i(knstciter) = count_step
666 call fstr_setup_parancon_contactvalue(hecmesh,ndof,fstrsolid%EMBED_NFORCE,1)
673 deallocate(resid_work)
674 fstrsolid%CutBack_stat = 0
Essential boundary conditions kept as per-DOF marks and values so that they can be imposed on the mat...
subroutine, public hecmw_ebc_init(hecMAT, hecEBC)
subroutine, public hecmw_ebc_apply(hecMESH, hecMAT, hecEBC, conMAT)
subroutine, public hecmw_ebc_finalize(hecEBC)
This module provides a function to deal with prescribed displacement.
subroutine fstr_addbc(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, hecLagMAT, iter, hecEBC, 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_linear_solver(hecMESH, hecMAT, fstrSOLID, cstep, sub_step, iterStatus, istat)
Classify the linear solver result and record why the solve failed.
subroutine, public fstr_check_convergence(hecMESH, hecMAT, fstrSOLID, fstrPARAM, ndof, iter, sub_step, cstep, residual_vec, cnvstat, iterStatus, hecLagMAT)
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)
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.
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, fstrPARAM, 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)
integer(kind=kint), parameter kcaalagrange
integer(kind=kint), parameter kitrcontinue
iteration control
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.