47 logical,
private :: active
63 integer(kind=kint) :: cstep
64 integer(kind=kint) :: ctAlgo
65 integer(kind=kint) :: iter
66 type(hecmwst_local_mesh) :: hecMESH
67 type(hecmwst_matrix) :: conMAT
69 type(hecmwst_matrix_lagrange) :: hecLagMAT
70 integer(kind=kint) :: i, grpid
72 if(
associated(heclagmat%AL_lagrange) ) heclagmat%AL_lagrange = 0.0d0
73 if(
associated(heclagmat%AU_lagrange) ) heclagmat%AU_lagrange = 0.0d0
75 do i = 1, fstrsolid%n_contacts
77 grpid = fstrsolid%contacts(i)%group
80 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
82 fstrsolid%dunode(:), conmat )
85 fstrsolid%dunode(:), iter, heclagmat%Lagrange(:), conmat, heclagmat)
89 do i = 1, fstrsolid%n_embeds
91 grpid = fstrsolid%embeds(i)%group
95 fstrsolid%dunode(:), iter, heclagmat%Lagrange(:), conmat, heclagmat)
103 integer(kind=kint),
intent(in) :: cstep
104 integer(kind=kint),
intent(in) :: ctAlgo
105 type(hecmwst_local_mesh) :: hecMESH
107 type(hecmwst_matrix_lagrange) :: hecLagMAT
108 type(hecmwst_matrix) :: conMAT
116 integer(kind=kint),
intent(in) :: cstep
117 integer(kind=kint),
intent(in) :: ctAlgo
118 type(hecmwst_local_mesh) :: hecMESH
120 type(hecmwst_matrix_lagrange) :: hecLagMAT
121 type(hecmwst_matrix) :: conMAT
137 type(hecmwst_local_mesh),
intent(in) :: hecmesh
140 integer(kind=kint) :: i
142 if( .not.
associated(fstrsolid%CONT_NFORCE) )
return
143 fstrsolid%CONT_NFORCE(:) = 0.d0
144 if(
associated(fstrsolid%CONT_FRIC) ) fstrsolid%CONT_FRIC(:) = 0.d0
146 do i = 1, fstrsolid%n_contacts
148 fstrsolid%unode(:), fstrsolid%dunode(:), fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC )
157 integer(kind=kint),
intent(in) :: purpose
158 integer(kind=kint),
intent(in) :: cstep
159 integer(kind=kint),
intent(in) :: ctAlgo
160 type(hecmwst_local_mesh) :: hecMESH
162 type(hecmwst_matrix_lagrange) :: hecLagMAT
163 type(hecmwst_matrix) :: conMAT
164 integer(kind=kint) :: i, grpid
168 if(
associated(fstrsolid%CONT_NFORCE) ) fstrsolid%CONT_NFORCE(:) = 0.d0
169 if(
associated(fstrsolid%CONT_FRIC) ) fstrsolid%CONT_FRIC(:) = 0.d0
170 if(
associated(fstrsolid%EMBED_NFORCE) ) fstrsolid%EMBED_NFORCE(:) = 0.d0
173 do i = 1, fstrsolid%n_contacts
174 grpid = fstrsolid%contacts(i)%group
176 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
178 fstrsolid%dunode(:), conmat, fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC )
181 fstrsolid%dunode(:), heclagmat%Lagrange(:), conmat, &
182 fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC )
186 do i = 1, fstrsolid%n_embeds
187 grpid = fstrsolid%embeds(i)%group
190 fstrsolid%dunode(:), heclagmat%Lagrange(:), conmat, &
191 fstrsolid%EMBED_NFORCE, fstrsolid%EMBED_NFORCE )
199 integer(kind=kint),
intent(in) :: cstep
200 type(hecmwst_local_mesh) :: hecMESH
201 type(hecmwst_matrix) :: hecMAT
204 integer(kind=kint) :: i, grpid, ndof
205 real(kind=kreal),
pointer :: diag(:)
213 do i = 1, fstrsolid%n_contacts
214 grpid = fstrsolid%contacts(i)%group
221 do i = 1, fstrsolid%n_embeds
222 grpid = fstrsolid%embeds(i)%group
233 integer(kind=kint),
intent(in) :: cstep
234 integer(kind=kint),
intent(in) :: sub_step
235 integer(kind=kint),
intent(in) :: cont_step
236 integer(kind=kint),
intent(in) :: ctAlgo
237 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
240 character(len=9) :: flag_ctAlgo
241 integer(kind=kint) :: i, j, k, grpid
242 integer(kind=kint) :: s_chg(3,3), s_emov, s_ebey, s_islid, s_act
243 integer(kind=kint),
allocatable :: in_contact(:)
244 logical :: iactive, is_init
246 if(
associated( fstrsolid%CONT_RELVEL ) ) fstrsolid%CONT_RELVEL(:) = 0.d0
247 if(
associated( fstrsolid%CONT_STATE ) ) fstrsolid%CONT_STATE(:) = 0.d0
250 flag_ctalgo =
'SLagrange'
252 flag_ctalgo =
'ALagrange'
257 do i = 1,
size(fstrsolid%unode)
258 fstrsolid%ddunode(i) = hecmesh%node(i) + fstrsolid%unode(i) + fstrsolid%dunode(i)
262 infoctchange%n_statechange = 0
263 infoctchange%contact2neighbor = 0
264 infoctchange%contact2beyond = 0
265 infoctchange%contact2diffLpos = 0
266 infoctchange%free2contact_new = 0
267 infoctchange%contactNode_current = 0
269 is_init = ( cstep == 1 .and. sub_step == 1 .and. cont_step == 0 )
271 do i=1,fstrsolid%n_contacts
272 grpid = fstrsolid%contacts(i)%group
276 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
277 call scan_contact_state_ss( fstrsolid%contacts(i), fstrsolid%ddunode(:), infoctchange, is_init, iactive )
280 & fstrsolid%ddunode(:), fstrsolid%dunode(:), infoctchange, &
281 & hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), &
282 & is_init, iactive, hecmesh=hecmesh, &
283 & flag_ctalgo=flag_ctalgo, ndforce=fstrsolid%QFORCE(:) )
285 if( .not. active ) active = iactive
288 do i=1,fstrsolid%n_embeds
289 grpid = fstrsolid%embeds(i)%group
294 & infoctchange, hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), is_init, iactive )
295 if( .not. active ) active = iactive
298 infoctchange%active = active
300 if( is_init .and. ctalgo ==
kcaslagrange .and. fstrsolid%n_contacts > 0 ) &
303 infoctchange%contactNode_current = infoctchange%contactNode_previous &
304 + sum(infoctchange%n_statechange(:,
kcatcont)) - sum(infoctchange%n_statechange(
kcatcont,:))
305 infoctchange%contactNode_previous = infoctchange%contactNode_current
309 s_chg = infoctchange%n_statechange
311 s_emov = infoctchange%contact2neighbor
312 s_ebey = infoctchange%contact2beyond
313 s_islid = infoctchange%contact2diffLpos
314 s_act = infoctchange%contactNode_current
317 allocate( in_contact(hecmesh%n_node) )
319 do i = 1, fstrsolid%n_contacts
320 if( fstrsolid%contacts(i)%method /=
contacts2s ) cycle
321 do j = 1,
size(fstrsolid%contacts(i)%slave_surf)
322 if( fstrsolid%contacts(i)%slave_surf(j)%state <= 0 ) cycle
323 do k = 1,
size(fstrsolid%contacts(i)%slave_surf(j)%nodes)
324 in_contact(fstrsolid%contacts(i)%slave_surf(j)%nodes(k)) = 1
328 call hecmw_assemble_i(hecmesh, in_contact, hecmesh%n_node, 1)
329 do i = 1, hecmesh%nn_internal
330 if( in_contact(i) /= 0 ) s_act = s_act + 1
332 deallocate( in_contact )
333 call hecmw_allreduce_i(hecmesh, s_chg, 9, hecmw_sum)
334 call hecmw_allreduce_i1(hecmesh, s_emov, hecmw_sum)
335 call hecmw_allreduce_i1(hecmesh, s_ebey, hecmw_sum)
336 call hecmw_allreduce_i1(hecmesh, s_islid, hecmw_sum)
337 call hecmw_allreduce_i1(hecmesh, s_act, hecmw_sum)
338 if (hecmw_comm_get_rank() == 0)
then
339 write(*,
'(A,i7,A,i7,A,i7,A,i7,A,i7,A,i7)')
' Contact change: Free2Cont=', s_chg(
kcatfree,
kcatcont), &
341 ' InnerSlid=', s_islid,
' MoveNeibr=', s_emov,
' MoveBynd=', s_ebey,
' ActiveNodes=', s_act
343 write(*,
'(A,i7,A,i7,A,i7,A,i7)')
' near state change: Free2Near=', s_chg(
kcatfree,
kcatnear), &
348 if( .not. active )
then
349 if(
associated( fstrsolid%CONT_NFORCE ) ) fstrsolid%CONT_NFORCE(:) = 0.d0
350 if(
associated( fstrsolid%CONT_FRIC ) ) fstrsolid%CONT_FRIC(:) = 0.d0
357 integer(kind=kint),
intent(in) :: cstep
358 logical,
intent(in) :: is_init
359 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
363 integer(kind=kint) :: i, grpid
364 integer(kind=kint) :: s_chg(3,3), s_emov, s_ebey, s_islid, s_act
370 do i = 1,
size(fstrsolid%unode)
371 fstrsolid%ddunode(i) = hecmesh%node(i) + fstrsolid%unode(i) + fstrsolid%dunode(i)
373 infoctchange%active = .false.
375 infoctchange%n_statechange = 0
376 infoctchange%contact2neighbor = 0
377 infoctchange%contact2beyond = 0
378 infoctchange%contact2diffLpos = 0
379 infoctchange%free2contact_new = 0
380 infoctchange%contactNode_current = 0
382 do i=1,fstrsolid%n_contacts
383 grpid = fstrsolid%contacts(i)%group
388 call scan_contact_state( fstrsolid%contacts(i), fstrsolid%ddunode(:), fstrsolid%dunode(:), &
389 & infoctchange, hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), is_init, iactive, hecmesh )
391 infoctchange%active = infoctchange%active .or. iactive
393 call hecmw_allreduce_l1(hecmesh, infoctchange%active, hecmw_lor)
395 infoctchange%contactNode_current = infoctchange%contactNode_previous &
396 + sum(infoctchange%n_statechange(:,
kcatcont)) - sum(infoctchange%n_statechange(
kcatcont,:))
397 infoctchange%contactNode_previous = infoctchange%contactNode_current
401 s_chg = infoctchange%n_statechange
403 s_emov = infoctchange%contact2neighbor
404 s_ebey = infoctchange%contact2beyond
405 s_islid = infoctchange%contact2diffLpos
406 s_act = infoctchange%contactNode_current
407 call hecmw_allreduce_i(hecmesh, s_chg, 9, hecmw_sum)
408 call hecmw_allreduce_i1(hecmesh, s_emov, hecmw_sum)
409 call hecmw_allreduce_i1(hecmesh, s_ebey, hecmw_sum)
410 call hecmw_allreduce_i1(hecmesh, s_islid, hecmw_sum)
411 call hecmw_allreduce_i1(hecmesh, s_act, hecmw_sum)
412 if (hecmw_comm_get_rank() == 0)
then
413 write(*,
'(A,i7,A,i7,A,i7,A,i7,A,i7,A,i7)')
' Contact change: Free2Cont=', s_chg(
kcatfree,
kcatcont), &
415 ' InnerSlid=', s_islid,
' MoveNeibr=', s_emov,
' MoveBynd=', s_ebey,
' ActiveNodes=', s_act
417 write(*,
'(A,i7,A,i7,A,i7,A,i7)')
' near state change: Free2Near=', s_chg(
kcatfree,
kcatnear), &
422 fstrsolid%ddunode = 0.d0
432 logical,
intent(in) :: a
439 integer(kind=kint),
intent(in) :: cstep
442 integer(kind=kint) :: i, grpid
444 active = infoctchange%contactNode_previous > 0
445 do i = 1, fstrsolid%n_contacts
447 if( fstrsolid%contacts(i)%method /=
contactn2s ) cycle
449 grpid = fstrsolid%contacts(i)%group
451 active = any( fstrsolid%contacts(i)%states(:)%state ==
contactnear )
453 infoctchange%active = active
458 type (hecmwst_local_mesh),
intent(in) :: hecmesh
463 if( sum(infoctchange%n_statechange) + infoctchange%contact2neighbor + infoctchange%contact2beyond + &
464 infoctchange%free2contact_new + infoctchange%contact2diffLpos == 0 ) &
477 if( sum(infoctchange%n_statechange) + infoctchange%contact2neighbor + infoctchange%contact2beyond + &
478 infoctchange%free2contact_new > 0 ) &
483 integer(kind=kint),
intent(in) :: cstep
484 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
485 type(hecmwst_matrix_lagrange),
intent(in) :: hecLagMAT
487 logical,
intent(out) :: ctchanged
489 integer(kind=kint) :: i, nc, algtype, grpid
491 gnt = 0.d0; ctchanged = .false.
492 nc = fstrsolid%n_contacts+fstrsolid%n_embeds
493 do i=1, fstrsolid%n_contacts
494 grpid = fstrsolid%contacts(i)%group
497 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
499 fstrsolid%dunode(:), fstrsolid%contacts(i)%fcoeff )
501 algtype = fstrsolid%contacts(i)%algtype
504 fstrsolid%dunode(:), fstrsolid%contacts(i)%fcoeff, &
505 hecmesh, heclagmat,
gnt, ctchanged )
513 do i=1, fstrsolid%n_embeds
518 call hecmw_allreduce_l1(hecmesh, ctchanged, hecmw_lor)
527 integer(kind=kint),
intent(in) :: cstep
528 integer(kind=kint) :: i, s, grpid
530 do i = 1, fstrsolid%n_contacts
531 if( fstrsolid%contacts(i)%method /=
contacts2s ) cycle
532 grpid = fstrsolid%contacts(i)%group
534 if( .not.
associated(fstrsolid%contacts(i)%slave_surf) ) cycle
535 do s = 1,
size(fstrsolid%contacts(i)%slave_surf)
536 fstrsolid%contacts(i)%slave_surf(s)%lam_work_n = 0
537 fstrsolid%contacts(i)%slave_surf(s)%lam_work_id(:) = 0
538 fstrsolid%contacts(i)%slave_surf(s)%lam_work_val(:,:) = 0.d0
541 fstrsolid%contacts(i)%slave_surf(s)%lam_work_t(:,:,:) = 0.d0
542 fstrsolid%contacts(i)%slave_surf(s)%lam_work_fstate(:,:) =
contactstick
553 integer(kind=kint),
intent(in) :: cstep
554 integer(kind=kint) :: i, s, grpid, r, m
557 do i = 1, fstrsolid%n_contacts
558 if( fstrsolid%contacts(i)%method /=
contacts2s ) cycle
559 grpid = fstrsolid%contacts(i)%group
561 if( .not.
associated(fstrsolid%contacts(i)%slave_surf) ) cycle
562 do s = 1,
size(fstrsolid%contacts(i)%slave_surf)
563 surf => fstrsolid%contacts(i)%slave_surf(s)
566 do r = 1, surf%lam_work_n
567 if( maxval(surf%lam_work_val(1:
size(surf%nodes),r)) > 0.d0 )
then
569 surf%lam_begin_id(m) = surf%lam_work_id(r)
570 surf%lam_begin_val(1:
size(surf%nodes),m) = surf%lam_work_val(1:
size(surf%nodes),r)
572 surf%lam_begin_t(:,1:
size(surf%nodes),m) = surf%lam_work_t(:,1:
size(surf%nodes),r)
573 surf%lam_begin_fstate(1:
size(surf%nodes),m) = surf%lam_work_fstate(1:
size(surf%nodes),r)
583 integer(kind=kint),
intent(in) :: cstep
586 integer(kind=kint) :: i, grpid
588 do i=1, fstrsolid%n_contacts
590 grpid = fstrsolid%contacts(i)%group
600 real(kind=kreal),
intent(in) :: dt
602 integer(kind=kint) :: i
604 if(
associated( fstrsolid%CONT_RELVEL ) ) fstrsolid%CONT_RELVEL(:) = 0.d0
605 if(
associated( fstrsolid%CONT_STATE ) ) fstrsolid%CONT_STATE(:) = 0.d0
607 do i=1, fstrsolid%n_contacts
real(kind=kreal) function, dimension(:), pointer, public hecmw_mat_diag(hecMAT)
Extract diagonal components from matrix D into a 1D vector Returns: diag(i) = D(ndof*ndof*(node-1) + ...
This module defines common data and basic structures for analysis.
logical function fstr_isembedactive(fstrSOLID, nbc, cstep)
logical function fstr_iscontactactive(fstrSOLID, nbc, cstep)
integer(kind=kint), parameter kcaslagrange
contact analysis algorithm
integer(kind=kint), parameter kcaalagrange