46 logical,
private :: active
61 integer(kind=kint) :: cstep
62 integer(kind=kint) :: ctAlgo
63 integer(kind=kint) :: iter
64 type(hecmwst_local_mesh) :: hecMESH
65 type(hecmwst_matrix) :: conMAT
67 type(hecmwst_matrix_lagrange) :: hecLagMAT
68 integer(kind=kint) :: i, grpid
70 if(
associated(heclagmat%AL_lagrange) ) heclagmat%AL_lagrange = 0.0d0
71 if(
associated(heclagmat%AU_lagrange) ) heclagmat%AU_lagrange = 0.0d0
73 do i = 1, fstrsolid%n_contacts
75 grpid = fstrsolid%contacts(i)%group
79 fstrsolid%dunode(:), iter, heclagmat%Lagrange(:), conmat, heclagmat)
83 do i = 1, fstrsolid%n_embeds
85 grpid = fstrsolid%embeds(i)%group
89 fstrsolid%dunode(:), iter, heclagmat%Lagrange(:), conmat, heclagmat)
97 integer(kind=kint),
intent(in) :: cstep
98 integer(kind=kint),
intent(in) :: ctAlgo
99 type(hecmwst_local_mesh) :: hecMESH
101 type(hecmwst_matrix_lagrange) :: hecLagMAT
102 type(hecmwst_matrix) :: conMAT
110 integer(kind=kint),
intent(in) :: cstep
111 integer(kind=kint),
intent(in) :: ctAlgo
112 type(hecmwst_local_mesh) :: hecMESH
114 type(hecmwst_matrix_lagrange) :: hecLagMAT
115 type(hecmwst_matrix) :: conMAT
125 integer(kind=kint),
intent(in) :: purpose
126 integer(kind=kint),
intent(in) :: cstep
127 integer(kind=kint),
intent(in) :: ctAlgo
128 type(hecmwst_local_mesh) :: hecMESH
130 type(hecmwst_matrix_lagrange) :: hecLagMAT
131 type(hecmwst_matrix) :: conMAT
132 integer(kind=kint) :: i, grpid
136 if(
associated(fstrsolid%CONT_NFORCE) ) fstrsolid%CONT_NFORCE(:) = 0.d0
137 if(
associated(fstrsolid%CONT_FRIC) ) fstrsolid%CONT_FRIC(:) = 0.d0
138 if(
associated(fstrsolid%EMBED_NFORCE) ) fstrsolid%EMBED_NFORCE(:) = 0.d0
141 do i = 1, fstrsolid%n_contacts
142 grpid = fstrsolid%contacts(i)%group
145 fstrsolid%dunode(:), heclagmat%Lagrange(:), conmat, &
146 fstrsolid%CONT_NFORCE, fstrsolid%CONT_FRIC, heclagmat )
149 do i = 1, fstrsolid%n_embeds
150 grpid = fstrsolid%embeds(i)%group
153 fstrsolid%dunode(:), heclagmat%Lagrange(:), conmat, &
154 fstrsolid%EMBED_NFORCE, fstrsolid%EMBED_NFORCE, heclagmat )
162 integer(kind=kint),
intent(in) :: cstep
163 type(hecmwst_local_mesh) :: hecMESH
164 type(hecmwst_matrix) :: hecMAT
167 integer(kind=kint) :: i, grpid, ndof
168 real(kind=kreal),
pointer :: diag(:)
176 do i = 1, fstrsolid%n_contacts
177 grpid = fstrsolid%contacts(i)%group
184 do i = 1, fstrsolid%n_embeds
185 grpid = fstrsolid%embeds(i)%group
196 integer(kind=kint),
intent(in) :: cstep
197 integer(kind=kint),
intent(in) :: sub_step
198 integer(kind=kint),
intent(in) :: cont_step
199 real(kind=kreal),
intent(in) ::
dt
200 integer(kind=kint),
intent(in) :: ctAlgo
201 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
204 character(len=9) :: flag_ctAlgo
205 integer(kind=kint) :: i, grpid
206 integer(kind=kint) :: s_f2c, s_c2f, s_emov, s_islid, s_act
207 logical :: iactive, is_init
209 if(
associated( fstrsolid%CONT_RELVEL ) ) fstrsolid%CONT_RELVEL(:) = 0.d0
210 if(
associated( fstrsolid%CONT_STATE ) ) fstrsolid%CONT_STATE(:) = 0.d0
213 flag_ctalgo =
'SLagrange'
215 flag_ctalgo =
'ALagrange'
220 do i = 1,
size(fstrsolid%unode)
221 fstrsolid%ddunode(i) = hecmesh%node(i) + fstrsolid%unode(i) + fstrsolid%dunode(i)
225 infoctchange%contact2free = 0
226 infoctchange%contact2neighbor = 0
227 infoctchange%contact2diffLpos = 0
228 infoctchange%free2contact = 0
229 infoctchange%contactNode_current = 0
231 is_init = ( cstep == 1 .and. sub_step == 1 .and. cont_step == 0 )
233 do i=1,fstrsolid%n_contacts
234 grpid = fstrsolid%contacts(i)%group
239 & fstrsolid%ddunode(:), fstrsolid%dunode(:), infoctchange, &
240 & hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), &
241 & is_init, iactive, hecmesh=hecmesh, &
242 & flag_ctalgo=flag_ctalgo, ndforce=fstrsolid%QFORCE(:) )
243 if( .not. active ) active = iactive
246 do i=1,fstrsolid%n_embeds
247 grpid = fstrsolid%embeds(i)%group
251 call scan_embed_state( flag_ctalgo, fstrsolid%embeds(i), fstrsolid%ddunode(:), fstrsolid%dunode(:), &
252 & fstrsolid%QFORCE(:), infoctchange, hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), is_init, iactive )
253 if( .not. active ) active = iactive
256 if( is_init .and. ctalgo ==
kcaslagrange .and. fstrsolid%n_contacts > 0 ) &
259 infoctchange%contactNode_current = infoctchange%contactNode_previous+infoctchange%free2contact-infoctchange%contact2free
260 infoctchange%contactNode_previous = infoctchange%contactNode_current
264 s_f2c = infoctchange%free2contact
265 s_c2f = infoctchange%contact2free
266 s_emov = infoctchange%contact2neighbor
267 s_islid = infoctchange%contact2diffLpos
268 s_act = infoctchange%contactNode_current
269 call hecmw_allreduce_i1(hecmesh, s_f2c, hecmw_sum)
270 call hecmw_allreduce_i1(hecmesh, s_c2f, hecmw_sum)
271 call hecmw_allreduce_i1(hecmesh, s_emov, hecmw_sum)
272 call hecmw_allreduce_i1(hecmesh, s_islid, hecmw_sum)
273 call hecmw_allreduce_i1(hecmesh, s_act, hecmw_sum)
274 if (hecmw_comm_get_rank() == 0)
then
275 write(*,
'(A,i0,A,i0,A,i0,A,i0,A,i0)')
' Contact change: Free2Cont=', s_f2c,
', Cont2Free=', s_c2f, &
276 ', ElemMoved=', s_emov,
', InElemSlid=', s_islid,
', ActiveNodes=', s_act
279 if( .not. active )
then
280 if(
associated( fstrsolid%CONT_NFORCE ) ) fstrsolid%CONT_NFORCE(:) = 0.d0
281 if(
associated( fstrsolid%CONT_FRIC ) ) fstrsolid%CONT_FRIC(:) = 0.d0
288 integer(kind=kint),
intent(in) :: cstep
289 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
293 integer(kind=kint) :: i
294 integer(kind=kint) :: s_f2c, s_c2f, s_emov, s_islid, s_act
295 logical :: iactive, is_init
300 do i = 1,
size(fstrsolid%unode)
301 fstrsolid%ddunode(i) = hecmesh%node(i) + fstrsolid%unode(i) + fstrsolid%dunode(i)
303 infoctchange%active = .false.
305 infoctchange%contact2free = 0
306 infoctchange%contact2neighbor = 0
307 infoctchange%contact2diffLpos = 0
308 infoctchange%free2contact = 0
309 infoctchange%contactNode_current = 0
311 is_init = ( cstep == 1 )
313 do i=1,fstrsolid%n_contacts
319 call scan_contact_state( fstrsolid%contacts(i), fstrsolid%ddunode(:), fstrsolid%dunode(:), &
320 & infoctchange, hecmesh%global_node_ID(:), hecmesh%global_elem_ID(:), is_init, iactive, hecmesh )
322 infoctchange%active = infoctchange%active .or. iactive
325 infoctchange%contactNode_current = infoctchange%contactNode_previous+infoctchange%free2contact-infoctchange%contact2free
326 infoctchange%contactNode_previous = infoctchange%contactNode_current
330 s_f2c = infoctchange%free2contact
331 s_c2f = infoctchange%contact2free
332 s_emov = infoctchange%contact2neighbor
333 s_islid = infoctchange%contact2diffLpos
334 s_act = infoctchange%contactNode_current
335 call hecmw_allreduce_i1(hecmesh, s_f2c, hecmw_sum)
336 call hecmw_allreduce_i1(hecmesh, s_c2f, hecmw_sum)
337 call hecmw_allreduce_i1(hecmesh, s_emov, hecmw_sum)
338 call hecmw_allreduce_i1(hecmesh, s_islid, hecmw_sum)
339 call hecmw_allreduce_i1(hecmesh, s_act, hecmw_sum)
340 if (hecmw_comm_get_rank() == 0)
then
341 write(*,
'(A,i0,A,i0,A,i0,A,i0,A,i0)')
' Contact change: Free2Cont=', s_f2c,
', Cont2Free=', s_c2f, &
342 ', ElemMoved=', s_emov,
', InElemSlid=', s_islid,
', ActiveNodes=', s_act
345 fstrsolid%ddunode = 0.d0
353 logical,
intent(in) :: a
358 integer(kind=kint),
intent(in) :: ctalgo
360 type (hecmwst_local_mesh),
intent(in) :: hecmesh
363 if( infoctchange%contact2free+infoctchange%contact2neighbor+ &
364 infoctchange%contact2difflpos+infoctchange%free2contact == 0 ) &
373 if( infoctchange%contact2free+infoctchange%contact2neighbor+infoctchange%free2contact > 0 ) &
378 integer(kind=kint),
intent(in) :: cstep
379 integer(kind=kint),
intent(in) :: ctAlgo
380 type( hecmwst_local_mesh ),
intent(in) :: hecMESH
381 type(hecmwst_matrix_lagrange),
intent(in) :: hecLagMAT
383 logical,
intent(out) :: ctchanged
385 integer(kind=kint) :: i, nc, algtype, grpid
387 gnt = 0.d0; ctchanged = .false.
388 nc = fstrsolid%n_contacts+fstrsolid%n_embeds
389 do i=1, fstrsolid%n_contacts
390 grpid = fstrsolid%contacts(i)%group
393 algtype = fstrsolid%contacts(i)%algtype
396 fstrsolid%dunode(:), fstrsolid%contacts(i)%fcoeff, &
397 hecmesh, heclagmat,
gnt, ctchanged )
404 do i=1, fstrsolid%n_embeds
409 call hecmw_allreduce_l1(hecmesh, ctchanged, hecmw_lor)
416 integer(kind=kint),
intent(in) :: cstep
419 integer(kind=kint) :: i, grpid
421 do i=1, fstrsolid%n_contacts
423 grpid = fstrsolid%contacts(i)%group
433 real(kind=kreal),
intent(in) ::
dt
435 integer(kind=kint) :: i
437 if(
associated( fstrsolid%CONT_RELVEL ) ) fstrsolid%CONT_RELVEL(:) = 0.d0
438 if(
associated( fstrsolid%CONT_STATE ) ) fstrsolid%CONT_STATE(:) = 0.d0
440 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