22 type(
tcontact ),
intent(inout) :: contact
23 real(kind=kreal),
intent(in) :: currpos(:)
24 integer,
intent(in) :: lslave
25 integer,
intent(in) :: omaster
26 real(kind=kreal),
intent(in) :: opos(2)
27 real(kind=kreal),
intent(in) :: odirec(3)
28 real(kind=kreal),
intent(inout) :: b(:)
30 integer(kind=kint) :: slave, etype, master
31 integer(kind=kint) :: nn, j, iSS
32 real(kind=kreal) :: nrlforce, fcoeff, tangent(3,2)
33 real(kind=kreal) :: elemcrd(3, l_max_elem_node )
34 real(kind=kreal) :: shapefunc(l_max_surface_node)
35 real(kind=kreal) :: metric(2,2), dispmat(2,l_max_elem_node*3+3)
36 real(kind=kreal) :: fric(2), f3(l_max_elem_node*3+3)
37 integer(kind=kint) :: i, idx0
39 slave = contact%slave(lslave)
40 fcoeff = contact%fcoeff
42 nrlforce = contact%states(lslave)%multiplier(1)
43 b(3*slave-2:3*slave) = b(3*slave-2:3*slave)+nrlforce*odirec
44 nn =
size( contact%master(omaster)%nodes )
45 etype = contact%master(omaster)%etype
48 iss = contact%master(omaster)%nodes(j)
53 b(idx0+i) = b(idx0+i)-nrlforce*shapefunc(j)*odirec(i)
56 if( fcoeff/=0.d0 )
then
58 iss = contact%master(omaster)%nodes(j)
59 elemcrd(:,j) = currpos(3*iss-2:3*iss)
63 fric(1:2) = contact%states(lslave)%multiplier(2:3)
64 f3(:) = fric(1)*dispmat(1,:)+fric(2)*dispmat(2,:)
65 b(3*slave-2:3*slave) = b(3*slave-2:3*slave)+f3(1:3)
67 iss = contact%master(omaster)%nodes(j)
72 b(idx0+i) = b(idx0+i)+f3(3*j+i)
78 master = contact%states(lslave)%surface
79 nn =
size( contact%master(master)%nodes )
80 etype = contact%master(master)%etype
81 call getshapefunc( etype, contact%states(lslave)%lpos(1:2), shapefunc )
82 b(3*slave-2:3*slave) = b(3*slave-2:3*slave)-nrlforce*contact%states(lslave)%direction
84 iss = contact%master(master)%nodes(j)
90 b(idx0+i) = b(idx0+i)+nrlforce* &
91 shapefunc(j)*contact%states(lslave)%direction(i)
94 if( fcoeff/=0.d0 )
then
96 iss = contact%master(master)%nodes(j)
97 elemcrd(:,j) = currpos(3*iss-2:3*iss)
99 call dispincrematrix( contact%states(lslave)%lpos(1:2), etype, nn, elemcrd, tangent, &
101 fric(1:2) = contact%states(lslave)%multiplier(2:3)
102 f3(:) = fric(1)*dispmat(1,:)+fric(2)*dispmat(2,:)
103 b(3*slave-2:3*slave) = b(3*slave-2:3*slave)-f3(1:3)
105 iss = contact%master(master)%nodes(j)
110 b(idx0+i) = b(idx0+i)-f3(3*j+i)
119 character(len=9),
intent(in) :: flag_ctAlgo
120 integer,
intent(in) :: nslave
121 type(
tcontact ),
intent(inout) :: contact
123 real(kind=kreal),
intent(in) :: currpos(:)
124 real(kind=kreal),
intent(in) :: currdisp(:)
125 integer(kind=kint),
intent(in) :: nodeID(:)
126 integer(kind=kint),
intent(in) :: elemID(:)
127 real(kind=kreal),
intent(inout) :: b(:)
129 integer(kind=kint) :: slave, sid0, sid, etype
130 integer(kind=kint) :: nn, i, j, iSS
131 real(kind=kreal) :: coord(3), elem(3, l_max_elem_node), elem0(3, l_max_elem_node)
133 real(kind=kreal) :: opos(2), odirec(3)
134 integer(kind=kint) :: bktID, nCand, idm
135 integer(kind=kint),
allocatable :: indexCand(:)
139 slave = contact%slave(nslave)
140 coord(:) = currpos(3*slave-2:3*slave)
142 sid0 = contact%states(nslave)%surface
143 opos = contact%states(nslave)%lpos(1:2)
144 odirec = contact%states(nslave)%direction
145 etype = contact%master(sid0)%etype
148 iss = contact%master(sid0)%nodes(j)
149 elem0(1:3,j)=currpos(3*iss-2:3*iss)-currdisp(3*iss-2:3*iss)
152 contact%states(nslave), isin, contact%cparam%DISTCLR_NOCHECK, &
153 contact%states(nslave)%lpos(1:2), contact%cparam%CLR_SAME_ELEM )
154 if( .not. isin )
then
155 do i=1, contact%master(sid0)%n_neighbor
156 sid = contact%master(sid0)%neighbor(i)
158 contact%states(nslave), isin, contact%cparam%DISTCLR_NOCHECK, &
159 localclr=contact%cparam%CLEARANCE )
161 contact%states(nslave)%surface = sid
167 if( .not. isin )
then
168 write(*,*)
'Warning: contact moved beyond neighbor elements'
170 bktid = bucketdb_getbucketid(contact%master_bktDB, coord)
171 ncand = bucketdb_getnumcand(contact%master_bktDB, bktid)
173 allocate(indexcand(ncand))
174 call bucketdb_getcand(contact%master_bktDB, bktid, ncand, indexcand)
177 if( sid==sid0 ) cycle
178 if(
associated(contact%master(sid0)%neighbor) )
then
179 if( any(sid==contact%master(sid0)%neighbor(:)) ) cycle
181 if (.not. is_in_surface_box( contact%master(sid), coord(1:3), contact%cparam%BOX_EXP_RATE )) cycle
183 contact%states(nslave), isin, contact%cparam%DISTCLR_NOCHECK, &
184 localclr=contact%cparam%CLEARANCE )
186 contact%states(nslave)%surface = sid
190 deallocate(indexcand)
195 if( contact%states(nslave)%surface==sid0 )
then
196 if(any(dabs(contact%states(nslave)%lpos(1:2)-opos(:)) >= contact%cparam%CLR_DIFFLPOS))
then
198 infoctchange%contact2difflpos = infoctchange%contact2difflpos + 1
201 write(*,
'(A,i10,A,i10,A,f7.3,A,2f7.3)')
"Node",nodeid(slave),
" move to contact with", &
202 elemid(contact%master(sid)%eid),
" with distance ", &
203 contact%states(nslave)%distance,
" at ",contact%states(nslave)%lpos(1:2)
205 infoctchange%contact2neighbor = infoctchange%contact2neighbor + 1
206 if( flag_ctalgo==
'ALagrange' ) &
209 if( flag_ctalgo==
'SLagrange' )
then
211 etype = contact%master(contact%states(nslave)%surface)%etype
212 nn =
size(contact%master(contact%states(nslave)%surface)%nodes)
214 iss = contact%master(contact%states(nslave)%surface)%nodes(j)
215 elem(1:3,j)=currpos(3*iss-2:3*iss)
217 call update_tangentforce(etype,nn,elem0,elem,contact%states(nslave))
219 iss =
isinsideelement( etype, contact%states(nslave)%lpos(1:2), contact%cparam%CLR_CAL_NORM )
221 call cal_node_normal( contact%states(nslave)%surface, iss, contact%master, currpos, &
222 contact%states(nslave)%lpos(1:2), contact%states(nslave)%direction(:) )
223 else if( .not. isin )
then
224 write(*,
'(A,i10,A)')
"Node",nodeid(slave),
" move out of contact"
226 contact%states(nslave)%multiplier(:) = 0.d0
233 integer,
intent(in) :: nslave
234 type(
tcontact ),
intent(inout) :: contact
236 real(kind=kreal),
intent(in) :: currpos(:)
237 real(kind=kreal),
intent(in) :: currdisp(:)
238 integer(kind=kint),
intent(in) :: nodeID(:)
239 integer(kind=kint),
intent(in) :: elemID(:)
241 integer(kind=kint) :: slave, sid0, sid, etype
242 integer(kind=kint) :: nn, i, j, iSS
243 real(kind=kreal) :: coord(3), elem0(3, l_max_elem_node )
245 real(kind=kreal) :: opos(2), odirec(3)
246 integer(kind=kint) :: bktID, nCand, idm
247 integer(kind=kint),
allocatable :: indexCand(:)
251 slave = contact%slave(nslave)
252 coord(:) = currpos(3*slave-2:3*slave)
254 sid0 = contact%states(nslave)%surface
255 opos = contact%states(nslave)%lpos(1:2)
256 odirec = contact%states(nslave)%direction
257 etype = contact%master(sid0)%etype
260 iss = contact%master(sid0)%nodes(j)
261 elem0(1:3,j)=currpos(3*iss-2:3*iss)-currdisp(3*iss-2:3*iss)
264 contact%states(nslave), isin, contact%cparam%DISTCLR_NOCHECK, &
265 contact%states(nslave)%lpos(1:2), contact%cparam%CLR_SAME_ELEM )
266 if( .not. isin )
then
267 do i=1, contact%master(sid0)%n_neighbor
268 sid = contact%master(sid0)%neighbor(i)
270 contact%states(nslave), isin, contact%cparam%DISTCLR_NOCHECK, &
271 localclr=contact%cparam%CLEARANCE )
273 contact%states(nslave)%surface = sid
279 if( .not. isin )
then
280 write(*,*)
'Warning: contact moved beyond neighbor elements'
282 bktid = bucketdb_getbucketid(contact%master_bktDB, coord)
283 ncand = bucketdb_getnumcand(contact%master_bktDB, bktid)
285 allocate(indexcand(ncand))
286 call bucketdb_getcand(contact%master_bktDB, bktid, ncand, indexcand)
289 if( sid==sid0 ) cycle
290 if( any(sid==contact%master(sid0)%neighbor(:)) ) cycle
291 if (.not. is_in_surface_box( contact%master(sid), coord(1:3), contact%cparam%BOX_EXP_RATE )) cycle
293 contact%states(nslave), isin, contact%cparam%DISTCLR_NOCHECK, &
294 localclr=contact%cparam%CLEARANCE )
296 contact%states(nslave)%surface = sid
300 deallocate(indexcand)
305 if( contact%states(nslave)%surface==sid0 )
then
306 if(any(dabs(contact%states(nslave)%lpos(1:2)-opos(:)) >= contact%cparam%CLR_DIFFLPOS))
then
308 infoctchange%contact2difflpos = infoctchange%contact2difflpos + 1
311 write(*,
'(A,i10,A,i10,A,f7.3,A,2f7.3)')
"Node",nodeid(slave),
" move to contact with", &
312 elemid(contact%master(sid)%eid),
" with distance ", &
313 contact%states(nslave)%distance,
" at ",contact%states(nslave)%lpos(1:2)
315 infoctchange%contact2neighbor = infoctchange%contact2neighbor + 1
317 iss =
isinsideelement( etype, contact%states(nslave)%lpos(1:2), contact%cparam%CLR_CAL_NORM )
319 call cal_node_normal( contact%states(nslave)%surface, iss, contact%master, currpos, &
320 contact%states(nslave)%lpos(1:2), contact%states(nslave)%direction(:) )
322 else if( .not. isin )
then
323 write(*,
'(A,i10,A)')
"Node",nodeid(slave),
" move out of contact"
325 contact%states(nslave)%multiplier(:) = 0.d0
334 nodeID, elemID, is_init, active, B )
335 character(len=9),
intent(in) :: flag_ctAlgo
336 type(
tcontact ),
intent(inout) :: contact
338 real(kind=kreal),
intent(in) :: currpos(:)
339 real(kind=kreal),
intent(in) :: currdisp(:)
340 real(kind=kreal),
intent(in) :: ndforce(:)
341 integer(kind=kint),
intent(in) :: nodeID(:)
342 integer(kind=kint),
intent(in) :: elemID(:)
343 logical,
intent(in) :: is_init
344 logical,
intent(out) :: active
345 real(kind=kreal),
optional,
target :: b(:)
347 real(kind=kreal) :: distclr
348 integer(kind=kint) :: slave, id, etype
349 integer(kind=kint) :: i, iSS, nactive
350 real(kind=kreal) :: coord(3)
351 real(kind=kreal) :: nlforce, slforce(3)
353 integer(kind=kint),
allocatable :: contact_surf(:), states_prev(:)
355 integer,
pointer :: indexMaster(:),indexCand(:)
356 integer :: nMaster,idm,nMasterMax,bktID,nCand
357 logical :: is_present_B
358 real(kind=kreal),
pointer :: bp(:)
361 distclr = contact%cparam%DISTCLR_INIT
363 distclr = contact%cparam%DISTCLR_FREE
366 do i= 1,
size(contact%slave)
375 allocate(contact_surf(
size(nodeid)))
376 allocate(states_prev(
size(contact%slave)))
377 contact_surf(:) = huge(0)
378 do i = 1,
size(contact%slave)
379 states_prev(i) = contact%states(i)%state
382 call update_surface_box_info( contact%master, currpos )
383 call update_surface_bucket_info( contact%master, contact%master_bktDB )
386 is_present_b =
present(b)
387 if( is_present_b ) bp => b
397 do i= 1,
size(contact%slave)
398 if(contact%if_type /= 0)
call set_shrink_factor(contact%ctime, contact%states(i), contact%if_etime, contact%if_type)
399 slave = contact%slave(i)
401 slforce(1:3)=ndforce(3*slave-2:3*slave)
402 id = contact%states(i)%surface
403 nlforce = contact%states(i)%multiplier(1)
408 if (.not.is_init) cycle
411 if( nlforce < contact%cparam%TENSILE_FORCE )
then
413 contact%states(i)%multiplier(:) = 0.d0
414 write(*,
'(A,i10,A,i10,A,e12.3)')
"Node",nodeid(slave),
" free from contact with element", &
415 elemid(contact%master(id)%eid),
" with tensile force ", nlforce
418 if( contact%algtype /=
contactfslid .or. (.not. is_present_b) )
then
419 contact_surf(contact%slave(i)) = -elemid(contact%master(id)%eid)
421 call track_contact_position( flag_ctalgo, i, contact, currpos, currdisp, infoctchange, nodeid, elemid, bp )
423 id = contact%states(i)%surface
424 contact_surf(contact%slave(i)) = -elemid(contact%master(id)%eid)
428 else if( contact%states(i)%state==
contactfree )
then
429 if( contact%algtype ==
contacttied .and. .not. is_init ) cycle
430 coord(:) = currpos(3*slave-2:3*slave)
433 bktid = bucketdb_getbucketid(contact%master_bktDB, coord)
434 ncand = bucketdb_getnumcand(contact%master_bktDB, bktid)
435 if (ncand == 0) cycle
436 allocate(indexcand(ncand))
437 call bucketdb_getcand(contact%master_bktDB, bktid, ncand, indexcand)
440 allocate(indexmaster(nmastermax))
446 if (.not. is_in_surface_box( contact%master(id), coord(1:3), contact%cparam%BOX_EXP_RATE )) cycle
447 nmaster = nmaster + 1
448 indexmaster(nmaster) = id
450 deallocate(indexcand)
452 if(nmaster == 0)
then
453 deallocate(indexmaster)
458 id = indexmaster(idm)
460 contact%states(i), isin, distclr, localclr=contact%cparam%CLEARANCE )
461 if( .not. isin ) cycle
462 contact%states(i)%surface = id
463 contact%states(i)%multiplier(:) = 0.d0
464 etype = contact%master(id)%etype
465 iss =
isinsideelement( etype, contact%states(i)%lpos(1:2), contact%cparam%CLR_CAL_NORM )
467 call cal_node_normal( id, iss, contact%master, currpos, contact%states(i)%lpos(1:2), &
468 contact%states(i)%direction(:) )
469 contact_surf(contact%slave(i)) = elemid(contact%master(id)%eid)
470 write(*,
'(A,i10,A,i10,A,f7.3,A,2f7.3,A,3f7.3,A,i6)')
"Node",nodeid(slave),
" contact with element", &
471 elemid(contact%master(id)%eid), &
472 " with distance ", contact%states(i)%distance,
" at ",contact%states(i)%lpos(1:2), &
473 " along direction ", contact%states(i)%direction,
" rank=",hecmw_comm_get_rank()
476 deallocate(indexmaster)
481 if( contact%algtype ==
contacttied .and. .not. is_init )
then
482 deallocate(contact_surf)
483 deallocate(states_prev)
487 call hecmw_contact_comm_allreduce_i(contact%comm, contact_surf, hecmw_min)
489 do i = 1,
size(contact%slave)
491 id = contact%states(i)%surface
492 if (abs(contact_surf(contact%slave(i))) /= elemid(contact%master(id)%eid))
then
494 write(*,
'(A,i10,A,i10,A,i6,A,i6,A)')
"Node",nodeid(contact%slave(i)),
" contact with element", &
495 & elemid(contact%master(id)%eid),
" in rank",hecmw_comm_get_rank(),
" freed due to duplication"
497 nactive = nactive + 1
501 infoctchange%free2contact = infoctchange%free2contact + 1
503 infoctchange%contact2free = infoctchange%contact2free + 1
506 active = (nactive > 0)
507 deallocate(contact_surf)
508 deallocate(states_prev)
515 nodeID, elemID, is_init, active )
516 type(
tcontact ),
intent(inout) :: contact
518 real(kind=kreal),
intent(in) :: currpos(:)
519 real(kind=kreal),
intent(in) :: currdisp(:)
520 integer(kind=kint),
intent(in) :: nodeID(:)
521 integer(kind=kint),
intent(in) :: elemID(:)
522 logical,
intent(in) :: is_init
523 logical,
intent(out) :: active
525 real(kind=kreal) :: distclr
526 integer(kind=kint) :: slave, id, etype
527 integer(kind=kint) :: i, iSS, nactive
528 real(kind=kreal) :: coord(3)
530 integer(kind=kint),
allocatable :: contact_surf(:), states_prev(:)
532 integer,
pointer :: indexMaster(:),indexCand(:)
533 integer :: nMaster,idm,nMasterMax,bktID,nCand
536 distclr = contact%cparam%DISTCLR_INIT
538 distclr = contact%cparam%DISTCLR_FREE
541 do i= 1,
size(contact%slave)
551 allocate(contact_surf(
size(nodeid)))
552 allocate(states_prev(
size(contact%slave)))
553 contact_surf(:) =
size(elemid)+1
554 do i = 1,
size(contact%slave)
555 states_prev(i) = contact%states(i)%state
558 call update_surface_box_info( contact%master, currpos )
559 call update_surface_bucket_info( contact%master, contact%master_bktDB )
569 do i= 1,
size(contact%slave)
570 slave = contact%slave(i)
574 contact_surf(contact%slave(i)) = -contact%states(i)%surface
576 else if( contact%states(i)%state==
contactfree )
then
577 coord(:) = currpos(3*slave-2:3*slave)
580 bktid = bucketdb_getbucketid(contact%master_bktDB, coord)
581 ncand = bucketdb_getnumcand(contact%master_bktDB, bktid)
582 if (ncand == 0) cycle
583 allocate(indexcand(ncand))
584 call bucketdb_getcand(contact%master_bktDB, bktid, ncand, indexcand)
587 allocate(indexmaster(nmastermax))
593 if (.not. is_in_surface_box( contact%master(id), coord(1:3), contact%cparam%BOX_EXP_RATE )) cycle
594 nmaster = nmaster + 1
595 indexmaster(nmaster) = id
597 deallocate(indexcand)
599 if(nmaster == 0)
then
600 deallocate(indexmaster)
605 id = indexmaster(idm)
607 contact%states(i), isin, distclr, localclr=contact%cparam%CLEARANCE )
608 if( .not. isin ) cycle
609 contact%states(i)%surface = id
610 contact%states(i)%multiplier(:) = 0.d0
611 etype = contact%master(id)%etype
612 iss =
isinsideelement( etype, contact%states(i)%lpos(1:2), contact%cparam%CLR_CAL_NORM )
614 call cal_node_normal( id, iss, contact%master, currpos, contact%states(i)%lpos(1:2), &
615 contact%states(i)%direction(:) )
616 contact_surf(contact%slave(i)) = id
617 write(*,
'(A,i10,A,i10,A,f7.3,A,2f7.3,A,3f7.3)')
"Node",nodeid(slave),
" contact with element", &
618 elemid(contact%master(id)%eid), &
619 " with distance ", contact%states(i)%distance,
" at ",contact%states(i)%lpos(1:2), &
620 " along direction ", contact%states(i)%direction
623 deallocate(indexmaster)
628 call hecmw_contact_comm_allreduce_i(contact%comm, contact_surf, hecmw_min)
630 do i = 1,
size(contact%slave)
632 if (abs(contact_surf(contact%slave(i))) /= contact%states(i)%surface)
then
634 write(*,
'(A,i10,A,i6,A,i6,A)')
"Node",nodeid(contact%slave(i)), &
635 " in rank",hecmw_comm_get_rank(),
" freed due to duplication"
637 nactive = nactive + 1
641 infoctchange%free2contact = infoctchange%free2contact + 1
643 infoctchange%contact2free = infoctchange%contact2free + 1
646 active = (nactive > 0)
647 deallocate(contact_surf)
648 deallocate(states_prev)
654 subroutine scan_embed_state( flag_ctAlgo, embed, currpos, currdisp, ndforce, infoCTChange, &
655 nodeID, elemID, is_init, active, B )
656 character(len=9),
intent(in) :: flag_ctAlgo
657 type(
tcontact ),
intent(inout) :: embed
659 real(kind=kreal),
intent(in) :: currpos(:)
660 real(kind=kreal),
intent(in) :: currdisp(:)
661 real(kind=kreal),
intent(in) :: ndforce(:)
662 integer(kind=kint),
intent(in) :: nodeID(:)
663 integer(kind=kint),
intent(in) :: elemID(:)
664 logical,
intent(in) :: is_init
665 logical,
intent(out) :: active
666 real(kind=kreal),
optional,
target :: b(:)
668 real(kind=kreal) :: distclr
669 integer(kind=kint) :: slave, id, etype
670 integer(kind=kint) :: nn, i, j, iSS, nactive
671 real(kind=kreal) :: coord(3), elem(3, l_max_elem_node )
673 integer(kind=kint),
allocatable :: contact_surf(:), states_prev(:)
675 integer,
pointer :: indexMaster(:),indexCand(:)
676 integer :: nMaster,idm,nMasterMax,bktID,nCand
677 logical :: is_present_B
678 real(kind=kreal),
pointer :: bp(:)
681 distclr = embed%cparam%DISTCLR_INIT
683 distclr = embed%cparam%DISTCLR_FREE
685 do i= 1,
size(embed%slave)
694 allocate(contact_surf(
size(nodeid)))
695 allocate(states_prev(
size(embed%slave)))
696 contact_surf(:) = huge(0)
697 do i = 1,
size(embed%slave)
698 states_prev(i) = embed%states(i)%state
701 call update_surface_box_info( embed%master, currpos )
702 call update_surface_bucket_info( embed%master, embed%master_bktDB )
705 is_present_b =
present(b)
706 if( is_present_b ) bp => b
716 do i= 1,
size(embed%slave)
717 slave = embed%slave(i)
719 coord(:) = currpos(3*slave-2:3*slave)
722 bktid = bucketdb_getbucketid(embed%master_bktDB, coord)
723 ncand = bucketdb_getnumcand(embed%master_bktDB, bktid)
724 if (ncand == 0) cycle
725 allocate(indexcand(ncand))
726 call bucketdb_getcand(embed%master_bktDB, bktid, ncand, indexcand)
729 allocate(indexmaster(nmastermax))
735 if (.not. is_in_surface_box( embed%master(id), coord(1:3), embed%cparam%BOX_EXP_RATE )) cycle
736 nmaster = nmaster + 1
737 indexmaster(nmaster) = id
739 deallocate(indexcand)
741 if(nmaster == 0)
then
742 deallocate(indexmaster)
747 id = indexmaster(idm)
748 etype = embed%master(id)%etype
749 if( mod(etype,10) == 2 ) etype = etype - 1
752 iss = embed%master(id)%nodes(j)
753 elem(1:3,j)=currpos(3*iss-2:3*iss)
756 isin,distclr,localclr=embed%cparam%CLEARANCE )
757 if( .not. isin ) cycle
758 embed%states(i)%surface = id
759 embed%states(i)%multiplier(:) = 0.d0
760 contact_surf(embed%slave(i)) = elemid(embed%master(id)%eid)
761 write(*,
'(A,i10,A,i10,A,3f7.3,A,i6)')
"Node",nodeid(slave),
" embeded to element", &
762 elemid(embed%master(id)%eid),
" at ",embed%states(i)%lpos(:),
" rank=",hecmw_comm_get_rank()
765 deallocate(indexmaster)
770 call hecmw_contact_comm_allreduce_i(embed%comm, contact_surf, hecmw_min)
772 do i = 1,
size(embed%slave)
774 id = embed%states(i)%surface
775 if (abs(contact_surf(embed%slave(i))) /= elemid(embed%master(id)%eid))
then
777 write(*,
'(A,i10,A,i10,A,i6,A,i6,A)')
"Node",nodeid(embed%slave(i)),
" contact with element", &
778 & elemid(embed%master(id)%eid),
" in rank",hecmw_comm_get_rank(),
" freed due to duplication"
780 nactive = nactive + 1
784 infoctchange%free2contact = infoctchange%free2contact + 1
786 infoctchange%contact2free = infoctchange%contact2free + 1
789 active = (nactive > 0)
790 deallocate(contact_surf)
791 deallocate(states_prev)
796 integer(kind=kint),
intent(in) :: cstep
797 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
801 integer(kind=kint) :: i, j, grpid, slave
802 integer(kind=kint) :: k, id, iSS
803 integer(kind=kint) :: ig0, ig, iS0, iE0
804 integer(kind=kint),
allocatable :: states(:)
806 allocate(states(hecmesh%n_node))
810 do ig0= 1, fstrsolid%BOUNDARY_ngrp_tot
811 grpid = fstrsolid%BOUNDARY_ngrp_GRPID(ig0)
813 ig= fstrsolid%BOUNDARY_ngrp_ID(ig0)
814 is0= hecmesh%node_group%grp_index(ig-1) + 1
815 ie0= hecmesh%node_group%grp_index(ig )
817 iss = hecmesh%node_group%grp_item(k)
822 do i=1,fstrsolid%n_contacts
823 if( fstrsolid%contacts(i)%algtype /=
contacttied ) cycle
824 grpid = fstrsolid%contacts(i)%group
827 do j=1,
size(fstrsolid%contacts(i)%slave)
828 if( fstrsolid%contacts(i)%states(j)%state==
contactfree ) cycle
829 slave = fstrsolid%contacts(i)%slave(j)
831 states(slave) = fstrsolid%contacts(i)%states(j)%state
832 id = fstrsolid%contacts(i)%states(j)%surface
833 do k=1,
size( fstrsolid%contacts(i)%master(id)%nodes )
834 iss = fstrsolid%contacts(i)%master(id)%nodes(k)
835 states(iss) = fstrsolid%contacts(i)%states(j)%state
838 fstrsolid%contacts(i)%states(j)%state =
contactfree
839 infoctchange%free2contact = infoctchange%free2contact - 1
840 write(*,
'(A,i10,A,i6,A,i6,A)')
"Node",hecmesh%global_node_ID(slave), &
841 " in rank",hecmw_comm_get_rank(),
" freed due to duplication"
This module encapsulate the basic functions of all elements provide by this software.
subroutine getshapefunc(fetype, localcoord, func)
Calculate the shape function in natural coordinate system.
integer(kind=kind(2)) function getnumberofnodes(etype)
Obtain number of nodes of the element.
integer function isinsideelement(fetype, localcoord, clearance)
if a point is inside a surface element -1: No; 0: Yes; >0: Node's (vertex) number
This module defines common data and basic structures for analysis.
logical function fstr_iscontactactive(fstrSOLID, nbc, cstep)
logical function fstr_isboundaryactive(fstrSOLID, nbc, cstep)