24 type(
tcontact),
intent(inout) :: contact
25 real(kind=kreal),
intent(in) :: diag(:)
26 integer(kind=kint),
intent(in) :: ndof
27 type(hecmwst_local_mesh),
intent(in) :: hecmesh
29 integer(kind=kint) :: i, j, k, slave_node, master_node, nnode, ctsurf
30 integer(kind=kint) :: idx_start, idx_end, n_slave
31 integer(kind=kint) :: cgrp, ic, iss, outtype, fnodes(100)
32 real(kind=kreal) :: maxv
33 real(kind=kreal) :: a_rep, slave_reflen_sum
34 real(kind=kreal) :: elem(3, l_max_surface_node), r0(2)
39 do j = 1,
size(contact%slave)
40 slave_node = contact%slave(j)
44 if( contact%method ==
contacts2s .and. slave_node > hecmesh%nn_internal ) cycle
45 idx_start = ndof * (slave_node - 1) + 1
46 idx_end = ndof * slave_node
47 maxv = max(maxv, maxval(diag(idx_start:idx_end)))
58 cgrp = contact%surf_id2
60 do i = hecmesh%surf_group%grp_index(cgrp-1)+1, hecmesh%surf_group%grp_index(cgrp)
61 ic = hecmesh%surf_group%grp_item(2*i-1)
62 call getsubface( hecmesh%elem_type(ic), hecmesh%surf_group%grp_item(2*i), outtype, fnodes )
63 nnode = getnumberofnodes( outtype )
64 iss = hecmesh%elem_node_index(ic-1)
66 master_node = hecmesh%elem_node_item( iss + fnodes(j) )
67 if( master_node > hecmesh%nn_internal ) cycle
68 idx_start = ndof * (master_node - 1) + 1
69 idx_end = ndof * master_node
70 maxv = max(maxv, maxval(diag(idx_start:idx_end)))
75 do ctsurf = 1,
size(contact%master)
76 nnode =
size(contact%master(ctsurf)%nodes)
78 master_node = contact%master(ctsurf)%nodes(j)
79 idx_start = ndof * (master_node - 1) + 1
80 idx_end = ndof * master_node
81 maxv = max(maxv, maxval(diag(idx_start:idx_end)))
87 call hecmw_allreduce_r1(hecmesh, maxv, hecmw_max)
90 contact%refStiff = maxv
99 slave_reflen_sum = 0.0d0
101 if(
associated(contact%slave_surf) ) n_slave =
size(contact%slave_surf)
103 nnode =
size(contact%slave_surf(j)%nodes)
105 ctsurf = contact%slave_surf(j)%nodes(k)
106 elem(1:3,k) = hecmesh%node(3*ctsurf-2:3*ctsurf)
108 call getelementcenter( contact%slave_surf(j)%etype, r0 )
109 slave_reflen_sum = slave_reflen_sum + &
110 getreferencelength( contact%slave_surf(j)%etype, nnode, r0, elem )
115 call hecmw_allreduce_r1(hecmesh, slave_reflen_sum, hecmw_sum)
116 call hecmw_allreduce_i1(hecmesh, n_slave, hecmw_sum)
118 if( n_slave > 0 )
then
119 a_rep = ( slave_reflen_sum / dble(n_slave) ) ** 2
120 if( a_rep > 0.0d0 ) contact%refStiff = contact%refStiff / a_rep
125 if (hecmw_comm_get_rank() == 0)
then
126 write(*,
'(A,A,A,1pE12.3,A,1pE12.3,A,1pE12.3)')
" Contact [", &
127 trim(contact%pair_name),
"] set penalty: normal & tied ", &
128 contact%nPenalty * contact%refStiff,
", tangential ", &
129 contact%tPenalty * contact%refStiff,
", refStiff ", contact%refStiff
136 integer(kind=kint),
intent(in) :: nnode
137 integer(kind=kint),
intent(in) :: ndLocal(nnode + 1)
138 integer(kind=kint),
intent(in) :: id_lagrange
139 real(kind=kreal),
intent(in) :: ctnforce((nnode+1)*3+1)
140 real(kind=kreal),
intent(in) :: cttforce((nnode+1)*3+1)
141 type(hecmwst_matrix),
intent(inout) :: conmat
143 integer(kind=kint) :: i, inod, idx
148 conmat%B(idx:idx+2) = conmat%B(idx:idx+2) + ctnforce((i-1)*3+1:(i-1)*3+3) + cttforce((i-1)*3+1:(i-1)*3+3)
153 if( id_lagrange > 0 )
then
154 conmat%B(conmat%NP*conmat%NDOF+id_lagrange) = &
155 conmat%B(conmat%NP*conmat%NDOF+id_lagrange) + ctnforce((nnode+1)*3+1) + cttforce((nnode+1)*3+1)
162 integer(kind=kint),
intent(in) :: nnode
163 integer(kind=kint),
intent(in) :: ndlocal(nnode + 1)
164 real(kind=kreal),
intent(in) :: ctnforce((nnode+1)*3+1)
165 real(kind=kreal),
intent(in) :: cttforce((nnode+1)*3+1)
166 real(kind=kreal),
pointer,
intent(inout) :: cont_nforce(:)
167 real(kind=kreal),
pointer,
optional,
intent(inout) :: cont_fric(:)
169 integer(kind=kint) :: i, inod, idx
174 cont_nforce(idx:idx+2) = cont_nforce(idx:idx+2) + ctnforce((i-1)*3+1:(i-1)*3+3)
175 if(
present(cont_fric) ) cont_fric(idx:idx+2) = cont_fric(idx:idx+2) + cttforce((i-1)*3+1:(i-1)*3+3)
183 hecMESH, hecLagMAT, gnt, ctchanged )
184 integer(kind=kint),
intent(in) :: ctAlgo
185 type(
tcontact ),
intent(inout) :: contact
186 real(kind=kreal),
intent(in) :: coord(:)
187 real(kind=kreal),
intent(in) :: disp(:)
188 real(kind=kreal),
intent(in) :: ddisp(:)
189 real(kind=kreal),
intent(in) :: fcoeff
190 type(hecmwst_local_mesh),
intent(in) :: hecmesh
191 type(hecmwst_matrix_lagrange),
intent(in) :: hecLagMAT
192 real(kind=kreal),
intent(out) ::
gnt(2)
193 logical,
intent(inout) :: ctchanged
195 integer(kind=kint) :: slave, etype, master
196 integer(kind=kint) :: nn, i, cnt
197 real(kind=kreal) :: lgnt(2)
198 integer(kind=kint) :: ndLocal(l_max_elem_node+1)
199 real(kind=kreal) :: ctnforce(l_max_elem_node*3+3)
200 real(kind=kreal) :: cttforce(l_max_elem_node*3+3)
201 real(kind=kreal) :: max_jump_ratio, jump_ratio_local
202 real(kind=kreal) :: mut_old, mut_new, threthold
206 max_jump_ratio = 0.0d0
208 do i = 1,
size(contact%slave)
211 slave = contact%slave(i)
212 master = contact%states(i)%surface
213 nn =
size(contact%master(master)%nodes)
214 etype = contact%master(master)%etype
217 ndlocal(2:nn+1) = contact%master(master)%nodes(1:nn)
221 contact%nPenalty * contact%refStiff, contact%tPenalty * contact%refStiff, &
222 fcoeff, contact%master(master), lgnt, ctchanged, ctnforce, cttforce, jump_ratio_local, contact%smoothing)
225 max_jump_ratio = max(max_jump_ratio, jump_ratio_local)
230 if(cnt > 0) lgnt(:) = lgnt(:) / cnt
233 call hecmw_allreduce_r1(hecmesh, max_jump_ratio, hecmw_max)
237 if (max_jump_ratio > threthold)
then
238 mut_old = contact%tPenalty * contact%refStiff
239 contact%tPenalty = contact%tPenalty * max(1.d0/dsqrt(threthold), 1.0d0/dsqrt(max_jump_ratio))
240 mut_new = contact%tPenalty * contact%refStiff
241 if (hecmw_comm_get_rank() == 0)
then
242 write(*,
'(A,A,A,1pE12.3,A,1pE12.3,A)')
" Contact [", trim(contact%pair_name), &
243 "] tangential penalty adjusted: ", mut_old,
" -> ", mut_new,
" (friction jump)"
256 type(
tcontact ),
intent(inout) :: contact
257 real(kind=kreal),
intent(in) :: coord(:)
258 real(kind=kreal),
intent(in) :: disp(:)
259 real(kind=kreal),
intent(in) :: ddisp(:)
260 real(kind=kreal),
intent(in) :: fcoeff
262 integer(kind=kint) :: i, g, r, a, nnode_s, unique_count
263 integer(kind=kint) :: maplist(
max_n_intp), master_idxs(MAX_N_INTP)
264 integer(kind=kint),
allocatable :: sorted_idx(:)
266 real(kind=kreal),
allocatable :: snode(:,:), nsnode(:,:,:), gapwnode(:,:), lambda_node(:,:)
267 real(kind=kreal) :: mu, lambda_new
269 real(kind=kreal),
allocatable :: sigma_node(:,:,:), nacc_node(:,:,:)
270 real(kind=kreal),
allocatable :: lam_t_cur(:,:,:)
271 integer(kind=kint),
allocatable :: fric_state_cur(:,:)
272 real(kind=kreal) :: nhat(3), t1(3), t2(3), nrm, dxi(2)
273 real(kind=kreal) :: rho_t, alpha, that(2), lam_t_new(2)
274 integer(kind=kint) :: fstate
277 mu = contact%nPenalty * contact%refStiff
278 rho_t = contact%tPenalty * contact%refStiff
279 do i = 1,
size(contact%slave_surf)
280 if( contact%slave_surf(i)%state ==
contactfree ) cycle
282 call get_unique_map(contact%slave_surf(i), maplist, master_idxs, unique_count)
283 nnode_s =
size(contact%slave_surf(i)%nodes)
284 allocate(snode(unique_count,nnode_s), nsnode(unique_count,nnode_s,24), gapwnode(unique_count,nnode_s))
285 call getintgap(contact%slave_surf(i), contact%master, coord, disp, ddisp, &
286 unique_count, maplist, master_idxs, &
287 snode, nsnode, gapwnode)
289 allocate(sorted_idx(unique_count), lambda_node(nnode_s,unique_count))
290 if( fcoeff /= 0.d0 )
then
293 allocate(lam_t_cur(2,nnode_s,unique_count), fric_state_cur(nnode_s,unique_count))
294 call resolve_lambda_cur(contact%slave_surf(i), master_idxs, unique_count, nnode_s, sorted_idx, &
295 lambda_node, lam_t_cur, fric_state_cur)
297 call resolve_lambda_cur(contact%slave_surf(i), master_idxs, unique_count, nnode_s, sorted_idx, &
302 do g = 1, unique_count
304 lambda_new = lambda_node(a,g) + (mu * gapwnode(g,a))
305 if( lambda_new < 0.d0 ) lambda_new = 0.d0
306 lambda_node(a,g) = lambda_new
311 contact%slave_surf(i)%lam_work_n = unique_count
312 do r = 1, unique_count
313 contact%slave_surf(i)%lam_work_id(r) = master_idxs(sorted_idx(r))
314 contact%slave_surf(i)%lam_work_val(1:nnode_s,r) = lambda_node(1:nnode_s,sorted_idx(r))
320 if( fcoeff /= 0.d0 )
then
321 allocate(sigma_node(unique_count,nnode_s,3), nacc_node(unique_count,nnode_s,3))
322 call gettangentslip(contact%slave_surf(i), contact%master, coord, disp, ddisp, &
323 unique_count, maplist, master_idxs, sigma_node, nacc_node)
324 do g = 1, unique_count
326 nrm = sqrt( nacc_node(g,a,1)**2 + nacc_node(g,a,2)**2 + nacc_node(g,a,3)**2 )
330 if( nrm < 1.d-30 )
then
334 nhat(1:3) = nacc_node(g,a,1:3) / nrm
336 dxi(1) = dot_product(t1(1:3), sigma_node(g,a,1:3))
337 dxi(2) = dot_product(t2(1:3), sigma_node(g,a,1:3))
339 fstate = fric_state_cur(a,g)
341 contact%eps_fric_band, lam_t_new, fstate, alpha, that, &
343 lam_t_cur(1:2,a,g) = lam_t_new(1:2)
344 fric_state_cur(a,g) = fstate
348 do r = 1, unique_count
349 contact%slave_surf(i)%lam_work_t(1:2,1:nnode_s,r) = lam_t_cur(1:2,1:nnode_s,sorted_idx(r))
350 contact%slave_surf(i)%lam_work_fstate(1:nnode_s,r) = fric_state_cur(1:nnode_s,sorted_idx(r))
352 deallocate(sigma_node, nacc_node, lam_t_cur, fric_state_cur)
355 deallocate(sorted_idx)
356 deallocate(snode, nsnode, gapwnode, lambda_node)
364 type(
tcontact ),
intent(inout) :: contact
365 real(kind=kreal),
intent(in) :: disp(:)
366 real(kind=kreal),
intent(in) :: ddisp(:)
367 logical,
intent(inout) :: ctchanged
369 integer(kind=kint) :: slave, etype, master
370 integer(kind=kint) :: nn, i, j, iSS
371 real(kind=kreal) :: dg(3), dgmax
372 real(kind=kreal) :: shapefunc(l_max_surface_node)
373 real(kind=kreal) :: edisp(3*l_max_elem_node+3)
374 real(kind=kreal) :: mu
377 mu = contact%nPenalty * contact%refStiff
379 do i= 1,
size(contact%slave)
381 slave = contact%slave(i)
382 edisp(1:3) = disp(3*slave-2:3*slave)+ddisp(3*slave-2:3*slave)
383 master = contact%states(i)%surface
385 nn =
size( contact%master(master)%nodes )
386 etype = contact%master(master)%etype
388 iss = contact%master(master)%nodes(j)
389 edisp(3*j+1:3*j+3) = disp(3*iss-2:3*iss)+ddisp(3*iss-2:3*iss)
391 call getshapefunc( etype, contact%states(i)%lpos(1:2), shapefunc )
396 dg(1:3) = dg(1:3)-shapefunc(j)*edisp(3*j+1:3*j+3)
399 contact%states(i)%multiplier(1:3) = contact%states(i)%multiplier(1:3) + mu*dg(1:3)
404 dgmax = dgmax + dabs(edisp(j))
406 dgmax = dgmax/dble((nn+1)*3)
408 if( dabs(dg(j))/dmax1(1.d0,dgmax) > 1.d-3 ) ctchanged = .true.
415 type(
tcontact ),
intent(inout) :: contact
417 integer(kind=kint) :: i
419 do i= 1,
size(contact%slave)
421 contact%states(i)%tangentForce(1:3) = 0.d0
422 contact%states(i)%tangentForce_trial(1:3) = 0.d0
423 contact%states(i)%tangentForce_final(1:3) = 0.d0
425 contact%states(i)%tangentForce(1:3) = contact%states(i)%tangentForce_final(1:3)
427 contact%states(i)%tangentForce1(1:3) = contact%states(i)%tangentForce(1:3)
435 integer(kind=kint),
intent(in) :: ctalgo
436 type(
tcontact),
intent(inout) :: contact
437 real(kind=kreal),
intent(in) :: coord(:)
438 real(kind=kreal),
intent(in) :: disp(:)
439 real(kind=kreal),
intent(in) :: ddisp(:)
440 integer(kind=kint),
intent(in) :: iter
441 real(kind=kreal),
intent(in) :: lagrange_array(:)
442 type(hecmwst_matrix),
intent(inout) :: conmat
443 type(hecmwst_matrix_lagrange),
intent(inout) :: hecLagMAT
445 integer(kind=kint) :: ctsurf, nnode, ndLocal(21), etype
446 integer(kind=kint) :: j, k, algtype, id_lagrange
447 real(kind=kreal) :: lagrange
448 real(kind=kreal) :: stiffness((l_max_surface_node+1)*3+1, (l_max_surface_node+1)*3+1)
449 real(kind=kreal) :: elecoord(3, l_max_surface_node)
450 real(kind=kreal) :: eledisp(l_max_surface_node*3+3)
451 real(kind=kreal) :: force(l_max_surface_node*3+3)
452 logical :: is_contact_active_flag, is_damping_active_flag
454 algtype = contact%algtype
456 do j = 1,
size(contact%slave)
461 is_damping_active_flag = contact%states(j)%state ==
contactnear .and. &
464 if( .not. is_contact_active_flag .and. .not. is_damping_active_flag ) cycle
466 ctsurf = contact%states(j)%surface
467 etype = contact%master(ctsurf)%etype
468 nnode =
size(contact%master(ctsurf)%nodes)
469 ndlocal(1) = contact%slave(j)
470 ndlocal(2:nnode+1) = contact%master(ctsurf)%nodes(1:nnode)
474 elecoord(1:3, k) = coord(3*ndlocal(k+1)-2:3*ndlocal(k+1)) + disp(3*ndlocal(k+1)-2:3*ndlocal(k+1))
477 if( is_contact_active_flag )
then
482 id_lagrange = heclagmat%lag_node_table(ndlocal(1)) - 1
483 id_lagrange = id_lagrange + 1
484 lagrange = lagrange_array(id_lagrange)
485 call getcontactstiffness_slag(contact%states(j), contact%master(ctsurf), iter, &
486 contact%tPenalty, contact%fcoeff, lagrange, stiffness, smoothing_type=contact%smoothing)
489 call hecmw_mat_ass_contactlag(nnode, ndlocal, id_lagrange, contact%fcoeff, stiffness, conmat, heclagmat)
493 eledisp(1:3) = ddisp(3*ndlocal(1)-2:3*ndlocal(1))
495 eledisp(k*3+1:k*3+3) = ddisp(3*ndlocal(k+1)-2:3*ndlocal(k+1))
498 contact%nPenalty * contact%refStiff, contact%tPenalty * contact%refStiff, &
499 contact%fcoeff, contact%symmetric, stiffness, force, &
500 smoothing_type=contact%smoothing, edisp=eledisp(1:nnode*3+3), iter=iter, &
501 slvpos=coord(3*ndlocal(1)-2:3*ndlocal(1)) + disp(3*ndlocal(1)-2:3*ndlocal(1)))
504 call hecmw_mat_ass_elem(conmat, nnode+1, ndlocal, stiffness)
511 id_lagrange = heclagmat%lag_node_table(ndlocal(1)) - 1
513 id_lagrange = id_lagrange + 1
514 lagrange = lagrange_array(id_lagrange)
516 call gettiedstiffness_slag(contact%states(j), contact%master(ctsurf), k, stiffness, &
519 call hecmw_mat_ass_contactlag(nnode, ndlocal, id_lagrange, 0.d0, stiffness, conmat, heclagmat)
524 contact%nPenalty * contact%refStiff, stiffness, force)
527 call hecmw_mat_ass_elem(conmat, nnode+1, ndlocal, stiffness)
533 else if( is_damping_active_flag )
then
535 contact%damp_alpha * contact%refStiff, contact%damp_gact, &
536 stiffness, smoothing_type=contact%smoothing)
539 call hecmw_mat_ass_elem(conmat, nnode+1, ndlocal, stiffness)
548 integer(kind=kint),
intent(in) :: ctAlgo
549 type(
tcontact),
intent(inout) :: contact
550 real(kind=kreal),
intent(in) :: coord(:)
551 real(kind=kreal),
intent(in) :: disp(:)
552 real(kind=kreal),
intent(in) :: ddisp(:)
553 type(hecmwst_matrix),
intent(inout) :: hecmat
555 integer(kind=kint) :: i, g, a, nnode_m, nnode_s, unique_count, ctsurf
556 integer(kind=kint) :: ndlocal(l_max_surface_node+1)
557 integer(kind=kint) :: maplist(MAX_N_INTP), master_idxs(MAX_N_INTP)
558 real(kind=kreal),
allocatable :: stiff_n(:,:,:,:), stiff_t(:,:,:,:)
559 logical,
allocatable :: active_n(:,:), active_t(:,:)
561 do i = 1,
size(contact%slave_surf)
562 if( contact%slave_surf(i)%state ==
contactfree ) cycle
565 call get_unique_map( contact%slave_surf(i), maplist, master_idxs, unique_count )
566 nnode_s =
size(contact%slave_surf(i)%nodes)
567 allocate(stiff_n(24,24,nnode_s,unique_count), active_n(nnode_s,unique_count))
570 if( contact%fcoeff /= 0.d0 )
then
571 allocate(stiff_t(24,24,nnode_s,unique_count), active_t(nnode_s,unique_count))
573 contact%nPenalty * contact%refStiff, contact%tPenalty * contact%refStiff, contact%fcoeff, &
574 contact%symmetric, contact%eps_fric_band, unique_count, maplist, master_idxs, &
575 stiff_n, active_n, stiff_t, active_t )
578 contact%nPenalty * contact%refStiff, contact%tPenalty * contact%refStiff, contact%fcoeff, &
579 contact%symmetric, contact%eps_fric_band, unique_count, maplist, master_idxs, &
584 do g = 1, unique_count
585 ctsurf = master_idxs(g)
586 nnode_m =
size(contact%master(ctsurf)%nodes)
587 ndlocal(1:nnode_s) = contact%slave_surf(i)%nodes(1:nnode_s)
588 ndlocal(nnode_s+1:nnode_s+nnode_m) = contact%master(ctsurf)%nodes(1:nnode_m)
590 if( .not. active_n(a,g) ) cycle
591 call hecmw_mat_ass_elem(hecmat, nnode_s+nnode_m, ndlocal, stiff_n(:,:,a,g))
596 if( contact%fcoeff /= 0.d0 )
then
597 do g = 1, unique_count
598 ctsurf = master_idxs(g)
599 nnode_m =
size(contact%master(ctsurf)%nodes)
600 ndlocal(1:nnode_s) = contact%slave_surf(i)%nodes(1:nnode_s)
601 ndlocal(nnode_s+1:nnode_s+nnode_m) = contact%master(ctsurf)%nodes(1:nnode_m)
603 if( .not. active_t(a,g) ) cycle
604 call hecmw_mat_ass_elem(hecmat, nnode_s+nnode_m, ndlocal, stiff_t(:,:,a,g))
607 deallocate(stiff_t, active_t)
610 deallocate(stiff_n, active_n)
620 conMAT, CONT_NFORCE, CONT_FRIC, hecLagMAT )
621 integer(kind=kint),
intent(in) :: purpose
622 integer(kind=kint),
intent(in) :: ctAlgo
623 type(
tcontact ),
intent(inout) :: contact
624 real(kind=kreal),
intent(in) :: coord(:)
625 real(kind=kreal),
intent(in) :: disp(:)
626 real(kind=kreal),
intent(in) :: ddisp(:)
627 real(kind=kreal),
intent(in) :: lagrange_array(:)
628 type(hecmwst_matrix),
intent(inout) :: conmat
629 real(kind=kreal),
pointer :: cont_nforce(:)
630 real(kind=kreal),
pointer :: cont_fric(:)
631 type(hecmwst_matrix_lagrange),
intent(in) :: heclagmat
633 integer(kind=kint) :: ctsurf, nnode, ndlocal(21)
634 integer(kind=kint) :: j, k, algtype, id_lagrange
635 real(kind=kreal) :: ndcoord(21*3)
636 real(kind=kreal) :: ndu(21*3), nddu(21*3)
637 real(kind=kreal) :: lagrange
638 real(kind=kreal) :: ctnforce(21*3+1)
639 real(kind=kreal) :: cttforce(21*3+1)
640 real(kind=kreal) :: mu_n, mu_t
642 logical :: is_contact_active_flag, is_damping_active_flag
643 real(kind=kreal) :: ctime,
etime
644 integer(kind=kint) :: if_type
646 algtype = contact%algtype
647 if_flag = (contact%if_type /= 0)
649 ctime = contact%ctime
650 etime = contact%if_etime
651 if_type = contact%if_type
654 do j = 1,
size(contact%slave)
662 if( .not. is_contact_active_flag .and. .not. is_damping_active_flag ) cycle
664 ctsurf = contact%states(j)%surface
665 nnode =
size(contact%master(ctsurf)%nodes)
666 ndlocal(1) = contact%slave(j)
667 ndlocal(2:nnode+1) = contact%master(ctsurf)%nodes(1:nnode)
669 nddu((k-1)*3+1:(k-1)*3+3) = ddisp((ndlocal(k)-1)*3+1:(ndlocal(k)-1)*3+3)
670 ndu((k-1)*3+1:(k-1)*3+3) = disp((ndlocal(k)-1)*3+1:(ndlocal(k)-1)*3+3) + nddu((k-1)*3+1:(k-1)*3+3)
671 ndcoord((k-1)*3+1:(k-1)*3+3) = coord((ndlocal(k)-1)*3+1:(ndlocal(k)-1)*3+3) + ndu((k-1)*3+1:(k-1)*3+3)
674 if( is_contact_active_flag )
then
683 mu_n = contact%nPenalty * contact%refStiff
684 mu_t = contact%tPenalty * contact%refStiff
692 id_lagrange = heclagmat%lag_node_table(ndlocal(1)) - 1
693 id_lagrange = id_lagrange + 1
694 lagrange = lagrange_array(id_lagrange)
695 call getcontactnodalforce_slag(contact%states(j),contact%master(ctsurf),ndcoord,nddu, &
696 contact%tPenalty,contact%fcoeff,lagrange,ctnforce,cttforce,.true.,contact%smoothing)
702 mu_n, mu_t, contact%fcoeff,contact%symmetric,lagrange,ctnforce,cttforce,.true.,contact%smoothing)
716 id_lagrange = heclagmat%lag_node_table(ndlocal(1)) - 1
718 id_lagrange = id_lagrange + 1
719 lagrange = lagrange_array(id_lagrange)
720 contact%states(j)%multiplier(k) = lagrange
722 call gettiednodalforce_slag(contact%states(j),contact%master(ctsurf),k,ndu, &
723 & lagrange,ctnforce,cttforce,contact%smoothing)
734 mu_n, ctnforce,cttforce)
745 else if( is_damping_active_flag )
then
748 contact%damp_alpha * contact%refStiff, contact%damp_gact, &
749 ctnforce, cttforce, smoothing_type=contact%smoothing)
773 type(
tcontact ),
intent(inout) :: contact
774 real(kind=kreal),
intent(in) :: coord(:)
775 real(kind=kreal),
intent(in) :: disp(:)
776 real(kind=kreal),
intent(in) :: ddisp(:)
777 real(kind=kreal),
pointer :: cont_nforce(:)
778 real(kind=kreal),
pointer :: cont_fric(:)
780 integer(kind=kint) :: ctsurf, nnode, ndLocal(21), j, k
781 real(kind=kreal) :: ndcoord(21*3), ndu(21*3), nddu(21*3)
782 real(kind=kreal) :: ctnforce(21*3+1), cttforce(21*3+1)
783 real(kind=kreal) :: tm(3,3*(l_max_surface_node+1)), tt(3,3*(l_max_surface_node+1))
785 do j = 1,
size(contact%slave)
788 ctsurf = contact%states(j)%surface
789 nnode =
size(contact%master(ctsurf)%nodes)
790 ndlocal(1) = contact%slave(j)
791 ndlocal(2:nnode+1) = contact%master(ctsurf)%nodes(1:nnode)
793 nddu((k-1)*3+1:(k-1)*3+3) = ddisp((ndlocal(k)-1)*3+1:(ndlocal(k)-1)*3+3)
794 ndu((k-1)*3+1:(k-1)*3+3) = disp((ndlocal(k)-1)*3+1:(ndlocal(k)-1)*3+3) + nddu((k-1)*3+1:(k-1)*3+3)
795 ndcoord((k-1)*3+1:(k-1)*3+3) = coord((ndlocal(k)-1)*3+1:(ndlocal(k)-1)*3+3) + ndu((k-1)*3+1:(k-1)*3+3)
798 call getcontactnodalforce_slag( contact%states(j), contact%master(ctsurf), ndcoord, nddu, &
799 0.d0, 0.d0, contact%states(j)%multiplier(1), ctnforce, cttforce, .false., contact%smoothing )
801 call computetm_tt( contact%states(j), contact%master(ctsurf), contact%fcoeff, &
802 tm, tt, contact%smoothing )
804 cttforce(1:3*(nnode+1)) = -matmul(transpose(tm(1:3,1:3*(nnode+1))), &
805 contact%states(j)%tangentForce_final)
813 conMAT, CONT_NFORCE, CONT_FRIC )
814 integer(kind=kint),
intent(in) :: purpose
815 integer(kind=kint),
intent(in) :: ctAlgo
816 type(
tcontact ),
intent(inout) :: contact
817 real(kind=kreal),
intent(in) :: coord(:)
818 real(kind=kreal),
intent(in) :: disp(:)
819 real(kind=kreal),
intent(in) :: ddisp(:)
820 type(hecmwst_matrix),
intent(inout) :: conmat
821 real(kind=kreal),
pointer :: cont_nforce(:)
822 real(kind=kreal),
pointer :: cont_fric(:)
824 integer(kind=kint) :: i, g, a, j, nd, nnode_m, nnode_s, unique_count, ctsurf
825 integer(kind=kint) :: ndlocal(l_max_surface_node+1)
826 integer(kind=kint) :: maplist(MAX_N_INTP), master_idxs(MAX_N_INTP)
827 real(kind=kreal),
allocatable :: ctnforce(:,:,:), cttforce(:,:,:)
828 logical,
allocatable :: active_n(:,:), active_t(:,:)
830 do i = 1,
size(contact%slave_surf)
831 if( contact%slave_surf(i)%state ==
contactfree ) cycle
834 call get_unique_map( contact%slave_surf(i), maplist, master_idxs, unique_count )
835 nnode_s =
size(contact%slave_surf(i)%nodes)
836 allocate(ctnforce(24,nnode_s,unique_count), active_n(nnode_s,unique_count))
840 if( contact%fcoeff /= 0.d0 )
then
841 allocate(cttforce(24,nnode_s,unique_count), active_t(nnode_s,unique_count))
843 contact%nPenalty * contact%refStiff, contact%tPenalty * contact%refStiff, contact%fcoeff, &
844 contact%symmetric, contact%eps_fric_band, unique_count, maplist, master_idxs, &
845 ctnforce, active_n, cttforce, active_t )
848 contact%nPenalty * contact%refStiff, contact%tPenalty * contact%refStiff, contact%fcoeff, &
849 contact%symmetric, contact%eps_fric_band, unique_count, maplist, master_idxs, &
854 do g = 1, unique_count
855 ctsurf = master_idxs(g)
856 nnode_m =
size(contact%master(ctsurf)%nodes)
857 ndlocal(1:nnode_s) = contact%slave_surf(i)%nodes(1:nnode_s)
858 ndlocal(nnode_s+1:nnode_s+nnode_m) = contact%master(ctsurf)%nodes(1:nnode_m)
860 if( .not. active_n(a,g) ) cycle
861 do j = 1, nnode_s + nnode_m
864 conmat%B(3*nd-2:3*nd) = conmat%B(3*nd-2:3*nd) + ctnforce(3*j-2:3*j,a,g)
866 cont_nforce(3*nd-2:3*nd) = cont_nforce(3*nd-2:3*nd) + ctnforce(3*j-2:3*j,a,g)
873 if( contact%fcoeff /= 0.d0 )
then
874 do g = 1, unique_count
875 ctsurf = master_idxs(g)
876 nnode_m =
size(contact%master(ctsurf)%nodes)
877 ndlocal(1:nnode_s) = contact%slave_surf(i)%nodes(1:nnode_s)
878 ndlocal(nnode_s+1:nnode_s+nnode_m) = contact%master(ctsurf)%nodes(1:nnode_m)
880 if( .not. active_t(a,g) ) cycle
881 do j = 1, nnode_s + nnode_m
884 conmat%B(3*nd-2:3*nd) = conmat%B(3*nd-2:3*nd) + cttforce(3*j-2:3*j,a,g)
886 cont_fric(3*nd-2:3*nd) = cont_fric(3*nd-2:3*nd) + cttforce(3*j-2:3*j,a,g)
891 deallocate(cttforce, active_t)
894 deallocate(ctnforce, active_n)
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter kcaslagrange
contact analysis algorithm
integer(kind=kint), parameter kcaalagrange