46 logical,
private :: active
62 integer(kind=kint) :: cstep
63 integer(kind=kint) :: ctAlgo
64 integer(kind=kint) :: iter
65 type(hecmwst_local_mesh) :: hecMESH
66 type(hecmwst_matrix) :: conMAT
68 type(hecmwst_matrix_lagrange) :: hecLagMAT
69 integer(kind=kint) :: i, grpid
71 if(
associated(heclagmat%AL_lagrange) ) heclagmat%AL_lagrange = 0.0d0
72 if(
associated(heclagmat%AU_lagrange) ) heclagmat%AU_lagrange = 0.0d0
74 do i = 1, fstrsolid%n_contacts
76 grpid = fstrsolid%contacts(i)%group
79 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
81 fstrsolid%dunode(:), conmat )
84 fstrsolid%dunode(:), iter, heclagmat%Lagrange(:), conmat, heclagmat)
88 do i = 1, fstrsolid%n_embeds
90 grpid = fstrsolid%embeds(i)%group
94 fstrsolid%dunode(:), iter, heclagmat%Lagrange(:), conmat, heclagmat)
102 integer(kind=kint),
intent(in) :: cstep
103 integer(kind=kint),
intent(in) :: ctAlgo
104 type(hecmwst_local_mesh) :: hecMESH
106 type(hecmwst_matrix_lagrange) :: hecLagMAT
107 type(hecmwst_matrix) :: conMAT
115 integer(kind=kint),
intent(in) :: cstep
116 integer(kind=kint),
intent(in) :: ctAlgo
117 type(hecmwst_local_mesh) :: hecMESH
119 type(hecmwst_matrix_lagrange) :: hecLagMAT
120 type(hecmwst_matrix) :: conMAT
136 type(hecmwst_local_mesh),
intent(in) :: hecmesh
139 integer(kind=kint) :: i
141 if( .not.
associated(fstrsolid%CONT_NFORCE) )
return
142 fstrsolid%CONT_NFORCE(:) = 0.d0
143 if(
associated(fstrsolid%CONT_FRIC) ) fstrsolid%CONT_FRIC(:) = 0.d0
145 do i = 1, fstrsolid%n_contacts
147 fstrsolid%unode(:), fstrsolid%dunode(:), fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC )
156 integer(kind=kint),
intent(in) :: purpose
157 integer(kind=kint),
intent(in) :: cstep
158 integer(kind=kint),
intent(in) :: ctAlgo
159 type(hecmwst_local_mesh) :: hecMESH
161 type(hecmwst_matrix_lagrange) :: hecLagMAT
162 type(hecmwst_matrix) :: conMAT
163 integer(kind=kint) :: i, grpid
167 if(
associated(fstrsolid%CONT_NFORCE) ) fstrsolid%CONT_NFORCE(:) = 0.d0
168 if(
associated(fstrsolid%CONT_FRIC) ) fstrsolid%CONT_FRIC(:) = 0.d0
169 if(
associated(fstrsolid%EMBED_NFORCE) ) fstrsolid%EMBED_NFORCE(:) = 0.d0
172 do i = 1, fstrsolid%n_contacts
173 grpid = fstrsolid%contacts(i)%group
175 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
177 fstrsolid%dunode(:), conmat, fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC )
180 fstrsolid%dunode(:), heclagmat%Lagrange(:), conmat, &
181 fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC, heclagmat )
185 do i = 1, fstrsolid%n_embeds
186 grpid = fstrsolid%embeds(i)%group
189 fstrsolid%dunode(:), heclagmat%Lagrange(:), conmat, &
190 fstrsolid%EMBED_NFORCE, fstrsolid%EMBED_NFORCE, heclagmat )
198 integer(kind=kint),
intent(in) :: cstep
199 type(hecmwst_local_mesh) :: hecMESH
200 type(hecmwst_matrix) :: hecMAT
203 integer(kind=kint) :: i, grpid, ndof
204 real(kind=kreal),
pointer :: diag(:)
212 do i = 1, fstrsolid%n_contacts
213 grpid = fstrsolid%contacts(i)%group
220 do i = 1, fstrsolid%n_embeds
221 grpid = fstrsolid%embeds(i)%group
232 integer(kind=kint),
intent(in) :: cstep
233 integer(kind=kint),
intent(in) :: sub_step
234 integer(kind=kint),
intent(in) :: cont_step
235 real(kind=kreal),
intent(in) ::
dt
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
293 call scan_embed_state( flag_ctalgo, fstrsolid%embeds(i), fstrsolid%ddunode(:), fstrsolid%dunode(:), &
294 & fstrsolid%QFORCE(:), infoctchange, hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), is_init, iactive )
295 if( .not. active ) active = iactive
298 if( is_init .and. ctalgo ==
kcaslagrange .and. fstrsolid%n_contacts > 0 ) &
301 infoctchange%contactNode_current = infoctchange%contactNode_previous &
302 + sum(infoctchange%n_statechange(:,
kcatcont)) - sum(infoctchange%n_statechange(
kcatcont,:))
303 infoctchange%contactNode_previous = infoctchange%contactNode_current
307 s_chg = infoctchange%n_statechange
309 s_emov = infoctchange%contact2neighbor
310 s_ebey = infoctchange%contact2beyond
311 s_islid = infoctchange%contact2diffLpos
312 s_act = infoctchange%contactNode_current
315 allocate( in_contact(hecmesh%n_node) )
317 do i = 1, fstrsolid%n_contacts
318 if( fstrsolid%contacts(i)%method /=
contacts2s ) cycle
319 do j = 1,
size(fstrsolid%contacts(i)%slave_surf)
320 if( fstrsolid%contacts(i)%slave_surf(j)%state <= 0 ) cycle
321 do k = 1,
size(fstrsolid%contacts(i)%slave_surf(j)%nodes)
322 in_contact(fstrsolid%contacts(i)%slave_surf(j)%nodes(k)) = 1
326 call hecmw_assemble_i(hecmesh, in_contact, hecmesh%n_node, 1)
327 do i = 1, hecmesh%nn_internal
328 if( in_contact(i) /= 0 ) s_act = s_act + 1
330 deallocate( in_contact )
331 call hecmw_allreduce_i(hecmesh, s_chg, 9, hecmw_sum)
332 call hecmw_allreduce_i1(hecmesh, s_emov, hecmw_sum)
333 call hecmw_allreduce_i1(hecmesh, s_ebey, hecmw_sum)
334 call hecmw_allreduce_i1(hecmesh, s_islid, hecmw_sum)
335 call hecmw_allreduce_i1(hecmesh, s_act, hecmw_sum)
336 if (hecmw_comm_get_rank() == 0)
then
337 write(*,
'(A,i7,A,i7,A,i7,A,i7,A,i7,A,i7)')
' Contact change: Free2Cont=', s_chg(
kcatfree,
kcatcont), &
339 ' InnerSlid=', s_islid,
' MoveNeibr=', s_emov,
' MoveBynd=', s_ebey,
' ActiveNodes=', s_act
341 write(*,
'(A,i7,A,i7,A,i7,A,i7)')
' near state change: Free2Near=', s_chg(
kcatfree,
kcatnear), &
346 if( .not. active )
then
347 if(
associated( fstrsolid%CONT_NFORCE ) ) fstrsolid%CONT_NFORCE(:) = 0.d0
348 if(
associated( fstrsolid%CONT_FRIC ) ) fstrsolid%CONT_FRIC(:) = 0.d0
355 integer(kind=kint),
intent(in) :: cstep
356 logical,
intent(in) :: is_init
357 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
361 integer(kind=kint) :: i, grpid
362 integer(kind=kint) :: s_chg(3,3), s_emov, s_ebey, s_islid, s_act
368 do i = 1,
size(fstrsolid%unode)
369 fstrsolid%ddunode(i) = hecmesh%node(i) + fstrsolid%unode(i) + fstrsolid%dunode(i)
371 infoctchange%active = .false.
373 infoctchange%n_statechange = 0
374 infoctchange%contact2neighbor = 0
375 infoctchange%contact2beyond = 0
376 infoctchange%contact2diffLpos = 0
377 infoctchange%free2contact_new = 0
378 infoctchange%contactNode_current = 0
380 do i=1,fstrsolid%n_contacts
381 grpid = fstrsolid%contacts(i)%group
386 call scan_contact_state( fstrsolid%contacts(i), fstrsolid%ddunode(:), fstrsolid%dunode(:), &
387 & infoctchange, hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), is_init, iactive, hecmesh )
389 infoctchange%active = infoctchange%active .or. iactive
391 call hecmw_allreduce_l1(hecmesh, infoctchange%active, hecmw_lor)
393 infoctchange%contactNode_current = infoctchange%contactNode_previous &
394 + sum(infoctchange%n_statechange(:,
kcatcont)) - sum(infoctchange%n_statechange(
kcatcont,:))
395 infoctchange%contactNode_previous = infoctchange%contactNode_current
399 s_chg = infoctchange%n_statechange
401 s_emov = infoctchange%contact2neighbor
402 s_ebey = infoctchange%contact2beyond
403 s_islid = infoctchange%contact2diffLpos
404 s_act = infoctchange%contactNode_current
405 call hecmw_allreduce_i(hecmesh, s_chg, 9, hecmw_sum)
406 call hecmw_allreduce_i1(hecmesh, s_emov, hecmw_sum)
407 call hecmw_allreduce_i1(hecmesh, s_ebey, hecmw_sum)
408 call hecmw_allreduce_i1(hecmesh, s_islid, hecmw_sum)
409 call hecmw_allreduce_i1(hecmesh, s_act, hecmw_sum)
410 if (hecmw_comm_get_rank() == 0)
then
411 write(*,
'(A,i7,A,i7,A,i7,A,i7,A,i7,A,i7)')
' Contact change: Free2Cont=', s_chg(
kcatfree,
kcatcont), &
413 ' InnerSlid=', s_islid,
' MoveNeibr=', s_emov,
' MoveBynd=', s_ebey,
' ActiveNodes=', s_act
415 write(*,
'(A,i7,A,i7,A,i7,A,i7)')
' near state change: Free2Near=', s_chg(
kcatfree,
kcatnear), &
420 fstrsolid%ddunode = 0.d0
430 logical,
intent(in) :: a
435 integer(kind=kint),
intent(in) :: ctalgo
437 type (hecmwst_local_mesh),
intent(in) :: hecmesh
442 if( sum(infoctchange%n_statechange) + infoctchange%contact2neighbor + infoctchange%contact2beyond + &
443 infoctchange%free2contact_new + infoctchange%contact2diffLpos == 0 ) &
456 if( sum(infoctchange%n_statechange) + infoctchange%contact2neighbor + infoctchange%contact2beyond + &
457 infoctchange%free2contact_new > 0 ) &
462 integer(kind=kint),
intent(in) :: cstep
463 integer(kind=kint),
intent(in) :: ctAlgo
464 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
465 type(hecmwst_matrix_lagrange),
intent(in) :: hecLagMAT
467 logical,
intent(out) :: ctchanged
469 integer(kind=kint) :: i, nc, algtype, grpid
471 gnt = 0.d0; ctchanged = .false.
472 nc = fstrsolid%n_contacts+fstrsolid%n_embeds
473 do i=1, fstrsolid%n_contacts
474 grpid = fstrsolid%contacts(i)%group
477 if( fstrsolid%contacts(i)%method ==
contacts2s )
then
479 fstrsolid%dunode(:), fstrsolid%contacts(i)%fcoeff )
481 algtype = fstrsolid%contacts(i)%algtype
484 fstrsolid%dunode(:), fstrsolid%contacts(i)%fcoeff, &
485 hecmesh, heclagmat,
gnt, ctchanged )
493 do i=1, fstrsolid%n_embeds
498 call hecmw_allreduce_l1(hecmesh, ctchanged, hecmw_lor)
509 integer(kind=kint),
intent(in) :: cstep
510 integer(kind=kint) :: i, s, grpid
512 do i = 1, fstrsolid%n_contacts
513 if( fstrsolid%contacts(i)%method /=
contacts2s ) cycle
514 grpid = fstrsolid%contacts(i)%group
516 if( .not.
associated(fstrsolid%contacts(i)%slave_surf) ) cycle
517 do s = 1,
size(fstrsolid%contacts(i)%slave_surf)
518 fstrsolid%contacts(i)%slave_surf(s)%lam_work_n = 0
519 fstrsolid%contacts(i)%slave_surf(s)%lam_work_id(:) = 0
520 fstrsolid%contacts(i)%slave_surf(s)%lam_work_val(:,:) = 0.d0
523 fstrsolid%contacts(i)%slave_surf(s)%lam_work_t(:,:,:) = 0.d0
524 fstrsolid%contacts(i)%slave_surf(s)%lam_work_fstate(:,:) =
contactstick
525 fstrsolid%contacts(i)%slave_surf(s)%state = fstrsolid%contacts(i)%slave_surf(s)%state_begin
526 fstrsolid%contacts(i)%slave_surf(s)%state_prev = fstrsolid%contacts(i)%slave_surf(s)%state_prev_begin
537 integer(kind=kint),
intent(in) :: cstep
538 integer(kind=kint) :: i, s, grpid, r, m
541 do i = 1, fstrsolid%n_contacts
542 if( fstrsolid%contacts(i)%method /=
contacts2s ) cycle
543 grpid = fstrsolid%contacts(i)%group
545 if( .not.
associated(fstrsolid%contacts(i)%slave_surf) ) cycle
546 do s = 1,
size(fstrsolid%contacts(i)%slave_surf)
547 surf => fstrsolid%contacts(i)%slave_surf(s)
550 do r = 1, surf%lam_work_n
551 if( maxval(surf%lam_work_val(1:
size(surf%nodes),r)) > 0.d0 )
then
553 surf%lam_begin_id(m) = surf%lam_work_id(r)
554 surf%lam_begin_val(1:
size(surf%nodes),m) = surf%lam_work_val(1:
size(surf%nodes),r)
556 surf%lam_begin_t(:,1:
size(surf%nodes),m) = surf%lam_work_t(:,1:
size(surf%nodes),r)
557 surf%lam_begin_fstate(1:
size(surf%nodes),m) = surf%lam_work_fstate(1:
size(surf%nodes),r)
561 surf%state_begin = surf%state
562 surf%state_prev_begin = surf%state_prev
569 integer(kind=kint),
intent(in) :: cstep
572 integer(kind=kint) :: i, grpid
574 do i=1, fstrsolid%n_contacts
576 grpid = fstrsolid%contacts(i)%group
586 real(kind=kreal),
intent(in) ::
dt
588 integer(kind=kint) :: i
590 if(
associated( fstrsolid%CONT_RELVEL ) ) fstrsolid%CONT_RELVEL(:) = 0.d0
591 if(
associated( fstrsolid%CONT_STATE ) ) fstrsolid%CONT_STATE(:) = 0.d0
593 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
real(kind=kreal) dt
ANALYSIS CONTROL for NLGEOM and HEAT.
integer(kind=kint), parameter kcaalagrange