18 public :: hecmwst_matrix_lagrange
25 integer(kind=kint),
save :: NPL_org, NPU_org
26 type(nodeRelated),
pointer,
save :: list_nodeRelated_org(:) => null()
28 type(nodeRelated),
pointer :: list_nodeRelated(:) => null()
30 logical :: permission = .false.
35 integer(kind=kint) :: algtype
36 if( algtype == contactsslid .or. algtype == contactfslid )
then
38 else if( algtype == contacttied )
then
46 type(hecmwst_matrix) :: hecmat
48 if(
associated(list_noderelated_org) )
return
49 call hecmw_construct_noderelated_from_hecmat(hecmat, npl_org, npu_org, list_noderelated_org)
55 subroutine fstr_mat_con_contact(cstep,contact_algo,hecMAT,fstrSOLID,hecLagMAT,infoCTChange,conMAT,is_contact_active_flag)
57 integer(kind=kint) :: cstep
58 integer(kind=kint) :: contact_algo
59 type(hecmwst_matrix) :: hecmat
61 type(hecmwst_matrix_lagrange) :: heclagmat
62 type(fstr_info_contactchange) :: infoctchange
64 integer(kind=kint) :: num_lagrange
65 integer(kind=kint) :: countnon0lu_node, countnon0lu_lagrange
66 integer(kind=kint) :: numnon0_node, numnon0_lagrange
68 type (hecmwst_matrix) :: conmat
69 logical,
intent(in) :: is_contact_active_flag
71 integer(kind=kint) :: i, j, grpid
72 integer(kind=kint) :: nlag
76 do i = 1, fstrsolid%n_contacts
77 grpid = fstrsolid%contacts(i)%group
80 do j = 1,
size(fstrsolid%contacts(i)%slave)
81 if( .not. is_contact_active(fstrsolid%contacts(i)%states(j)%state) ) cycle
82 num_lagrange = num_lagrange + nlag
86 do i = 1, fstrsolid%n_embeds
87 grpid = fstrsolid%embeds(i)%group
90 do j = 1,
size(fstrsolid%embeds(i)%slave)
91 if( .not. is_contact_active(fstrsolid%embeds(i)%states(j)%state) ) cycle
92 num_lagrange = num_lagrange + nlag
98 call hecmw_init_noderelated_from_org(hecmat%NP,num_lagrange,is_contact_active_flag,list_noderelated_org,list_noderelated)
101 countnon0lu_node = npl_org + npu_org
102 countnon0lu_lagrange = 0
103 if( is_contact_active_flag )
call getnewlistofrelatednodesandlagrangemultipliers(cstep,contact_algo, &
104 & hecmat%NP,fstrsolid,countnon0lu_node,countnon0lu_lagrange,list_noderelated)
107 numnon0_node = countnon0lu_node/2
108 numnon0_lagrange = countnon0lu_lagrange/2
109 call hecmw_construct_hecmat_from_noderelated(hecmat%N, hecmat%NP, hecmat%NDOF, &
110 & numnon0_node, num_lagrange, list_noderelated, hecmat)
111 call hecmw_construct_hecmat_from_noderelated(hecmat%N, hecmat%NP, hecmat%NDOF, &
112 & numnon0_node, num_lagrange, list_noderelated, conmat)
113 if( contact_algo ==
kcaslagrange )
call hecmw_construct_heclagmat_from_noderelated(hecmat%NP, &
114 & hecmat%NDOF, num_lagrange, numnon0_lagrange, is_contact_active_flag, list_noderelated, heclagmat)
115 call hecmw_finalize_noderelated(list_noderelated)
118 if( is_contact_active_flag .and. contact_algo ==
kcaslagrange ) &
119 call fstr_copy_lagrange_contact(fstrsolid,heclagmat)
124 subroutine getnewlistofrelatednodesandlagrangemultipliers( &
125 & cstep, contact_algo, np, fstrSOLID, countNon0LU_node, countNon0LU_lagrange, list_nodeRelated )
126 integer(kind=kint),
intent(in) :: cstep
127 integer(kind=kint),
intent(in) :: contact_algo
128 integer(kind=kint),
intent(in) :: np
130 integer(kind=kint),
intent(inout) :: countnon0lu_node, countnon0lu_lagrange
131 type(noderelated),
pointer,
intent(inout) :: list_noderelated(:)
133 integer(kind=kint) :: grpid
134 integer(kind=kint) :: count_lagrange
135 integer(kind=kint) :: ctsurf, etype, nnode, ndlocal(l_max_surface_node + 1)
136 integer(kind=kint) :: i, j, k, nlag, algtype
137 real(kind=kreal) :: fcoeff
138 logical :: necessary_to_insert_node, necessary_to_insert_node_pair
139 logical :: is_contact_active_flag, is_damping_active_flag
142 do i = 1, fstrsolid%n_contacts
144 grpid = fstrsolid%contacts(i)%group
147 fcoeff = fstrsolid%contacts(i)%fcoeff
148 necessary_to_insert_node = ( fcoeff /= 0.0d0 .or. contact_algo ==
kcaalagrange )
150 algtype = fstrsolid%contacts(i)%algtype
153 if( algtype == contacttied ) permission = .true.
155 do j = 1,
size(fstrsolid%contacts(i)%slave)
157 is_contact_active_flag = is_contact_active(fstrsolid%contacts(i)%states(j)%state)
159 is_damping_active_flag = fstrsolid%contacts(i)%states(j)%state == contactnear .and. &
162 if( is_contact_active_flag .or. is_damping_active_flag )
then
164 ctsurf = fstrsolid%contacts(i)%states(j)%surface
165 etype = fstrsolid%contacts(i)%master(ctsurf)%etype
167 stop
" ##Error: This element type is not supported in contact analysis !!! "
168 nnode =
size(fstrsolid%contacts(i)%master(ctsurf)%nodes)
169 ndlocal(1) = fstrsolid%contacts(i)%slave(j)
170 ndlocal(2:nnode+1) = fstrsolid%contacts(i)%master(ctsurf)%nodes(1:nnode)
174 necessary_to_insert_node_pair = necessary_to_insert_node .or. is_damping_active_flag
176 if( is_contact_active_flag )
then
178 if( contact_algo ==
kcaslagrange ) count_lagrange = count_lagrange + 1
179 call hecmw_ass_noderelated_from_contact_pair(np, nnode, ndlocal, count_lagrange, permission, &
180 & necessary_to_insert_node_pair, list_noderelated_org, list_noderelated, countnon0lu_node, countnon0lu_lagrange )
184 call hecmw_ass_noderelated_from_contact_pair(np, nnode, ndlocal, 0, permission, &
185 & necessary_to_insert_node_pair, list_noderelated_org, list_noderelated, countnon0lu_node, countnon0lu_lagrange )
194 do i = 1, fstrsolid%n_embeds
196 grpid = fstrsolid%embeds(i)%group
199 necessary_to_insert_node = ( contact_algo ==
kcaalagrange )
205 do j = 1,
size(fstrsolid%embeds(i)%slave)
207 if( .not. is_contact_active(fstrsolid%embeds(i)%states(j)%state) ) cycle
208 ctsurf = fstrsolid%embeds(i)%states(j)%surface
209 etype = fstrsolid%embeds(i)%master(ctsurf)%etype
210 nnode =
size(fstrsolid%embeds(i)%master(ctsurf)%nodes)
211 ndlocal(1) = fstrsolid%embeds(i)%slave(j)
212 ndlocal(2:nnode+1) = fstrsolid%embeds(i)%master(ctsurf)%nodes(1:nnode)
215 if( contact_algo ==
kcaslagrange ) count_lagrange = count_lagrange + 1
216 call hecmw_ass_noderelated_from_contact_pair(np, nnode, ndlocal, count_lagrange, permission, &
217 & necessary_to_insert_node, list_noderelated_org, list_noderelated, countnon0lu_node, countnon0lu_lagrange )
223 end subroutine getnewlistofrelatednodesandlagrangemultipliers
226 subroutine fstr_copy_lagrange_contact(fstrSOLID,hecLagMAT)
229 type(hecmwst_matrix_lagrange) :: heclagmat
230 integer (kind=kint) :: id_lagrange, algtype, i, j, k, nlag, slave_node
234 do i = 1, fstrsolid%n_contacts
236 algtype = fstrsolid%contacts(i)%algtype
239 do j = 1,
size(fstrsolid%contacts(i)%slave)
240 if( .not. is_contact_active(fstrsolid%contacts(i)%states(j)%state) ) cycle
241 slave_node = fstrsolid%contacts(i)%slave(j)
242 heclagmat%lag_node_table(slave_node) = id_lagrange + 1
244 id_lagrange = id_lagrange + 1
245 heclagmat%Lagrange(id_lagrange)=fstrsolid%contacts(i)%states(j)%multiplier(k)
250 do i = 1, fstrsolid%n_embeds
252 do j = 1,
size(fstrsolid%embeds(i)%slave)
253 if( .not. is_contact_active(fstrsolid%embeds(i)%states(j)%state) ) cycle
254 slave_node = fstrsolid%embeds(i)%slave(j)
255 heclagmat%lag_node_table(slave_node) = id_lagrange + 1
257 id_lagrange = id_lagrange + 1
258 heclagmat%Lagrange(id_lagrange)=fstrsolid%embeds(i)%states(j)%multiplier(k)
263 end subroutine fstr_copy_lagrange_contact
269 type(hecmwst_local_mesh) :: hecmesh
270 integer (kind=kint) :: is_in_contact
273 if( fstrsolid%n_contacts>0 )
then
274 if( any(fstrsolid%contacts(:)%fcoeff /= 0.0d0) ) is_in_contact = 1
276 call hecmw_allreduce_i1(hecmesh, is_in_contact, hecmw_max)
277 if( is_in_contact == 0 .and. hecmesh%n_dof /= 4 )
then
287 type(hecmwst_matrix_lagrange),
intent(inout) :: heclagmat
288 integer(kind=kint),
intent(in) :: ilag
289 real(kind=kreal),
intent(in) ::
value
291 if (ilag < 1 .or. ilag > heclagmat%num_lagrange)
then
292 write(*,*)
'Error in fstr_set_lagrange_diagonal: invalid Lagrange multiplier index', ilag
296 if (.not.
associated(heclagmat%D_lagrange))
then
297 write(*,*)
'Error in fstr_set_lagrange_diagonal: D_lagrange not allocated'
301 heclagmat%D_lagrange(ilag) =
value
307 type(hecmwst_matrix_lagrange),
intent(in) :: heclagmat
308 integer(kind=kint),
intent(in) :: ilag
310 if (ilag < 1 .or. ilag > heclagmat%num_lagrange)
then
311 write(*,*)
'Error in fstr_get_lagrange_diagonal: invalid Lagrange multiplier index', ilag
316 if (.not.
associated(heclagmat%D_lagrange))
then
317 write(*,*)
'Error in fstr_get_lagrange_diagonal: D_lagrange not allocated'
This module encapsulate the basic functions of all elements provide by this software.
integer, parameter fe_tri3n
integer, parameter fe_quad4n
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