27 real(kind=kreal),
intent(in) :: ele(:,:)
28 real(kind=kreal),
intent(in) :: mu, mut
29 real(kind=kreal),
intent(in) :: fcoeff
30 logical,
intent(in) :: symm
31 real(kind=kreal),
intent(out) :: stiff(:,:)
32 real(kind=kreal),
intent(out) :: force(:)
34 integer :: i, j, nnode
35 real(kind=kreal) :: bn(
size(tsurf%nodes)*3+3), ht(2,
size(tsurf%nodes)*3+3), gt(2,
size(tsurf%nodes)*3+3)
36 real(kind=kreal) :: metric(2,2)
37 real(kind=kreal) :: a(2,2)
38 real(kind=kreal) :: norm_trial, alpha_proj, that(2)
39 real(kind=kreal) :: k_fric(
size(tsurf%nodes)*3+3,
size(tsurf%nodes)*3+3)
40 real(kind=kreal) :: hta(2,
size(tsurf%nodes)*3+3), tmp_vec(2)
41 real(kind=kreal) :: dummy_force(
size(tsurf%nodes)*3+3)
42 real(kind=kreal) :: zero_disp(
size(tsurf%nodes)*3+3)
44 nnode =
size(tsurf%nodes)
52 stiff(i,j) = mu * bn(i) * bn(j)
55 force(1:nnode*3+3) = bn(:)
58 if( fcoeff /= 0.d0 )
then
63 ht, gt, zero_disp, nnode*3+3, dummy_force, &
64 mut, norm_trial=norm_trial, alpha=alpha_proj, that=that)
67 if( cstate%multiplier(1) <= 0.0d0 .or. alpha_proj <= 1.0d-20 )
then
70 else if( alpha_proj >= 0.999d0 .or. norm_trial < 1.0d-20 )
then
78 a(1,1) = alpha_proj * mut * (1.0d0 - that(1)*that(1))
79 a(1,2) = alpha_proj * mut * (-that(1)*that(2))
80 a(2,1) = alpha_proj * mut * (-that(2)*that(1))
81 a(2,2) = alpha_proj * mut * (1.0d0 - that(2)*that(2))
86 hta(1:2,1:nnode*3+3) = matmul(transpose(a), ht(1:2,1:nnode*3+3))
90 tmp_vec = matmul(a, gt(1:2,j))
92 k_fric(i,j) = dot_product(ht(1:2,i), tmp_vec)
96 stiff(1:nnode*3+3,1:nnode*3+3) = stiff(1:nnode*3+3,1:nnode*3+3) + k_fric(1:nnode*3+3,1:nnode*3+3)
101 subroutine getcontactnodalforce_alag(ctState,tSurf,ndCoord,ndDu,mu,mut,fcoeff,lagrange,ctNForce,ctTForce,cflag)
106 integer(kind=kint) :: nnode
107 integer(kind=kint) :: j
108 real(kind=kreal),
intent(in) :: mu, mut
109 real(kind=kreal) :: fcoeff
110 real(kind=kreal) :: lagrange
111 real(kind=kreal) :: ndcoord(:), nddu(:)
112 real(kind=kreal) :: ctnforce(:)
113 real(kind=kreal) :: cttforce(:)
116 real(kind=kreal) :: normal(3)
121 real(kind=kreal) :: dgn, nrlforce
122 real(kind=kreal) :: metric(2,2)
123 integer(kind=kint) :: edof
125 nnode =
size(tsurf%nodes)
131 normal(1:3) = ctstate%direction(1:3)
135 elemcrd(1:3, j) = ndcoord(j*3+1:j*3+3) - nddu(j*3+1:j*3+3)
143 dgn = dot_product( bn(1:edof), ndcoord(1:edof) )
146 nrlforce = ctstate%multiplier(1) + mu*dgn
149 ctnforce(1:edof) = -nrlforce * bn(1:edof)
152 ctnforce((nnode+1)*3+1) = 0.d0
154 if( fcoeff == 0.d0 )
return
159 edisp(1:3) = nddu(1:3)
161 edisp(j*3+1:j*3+3) = nddu(j*3+1:j*3+3)
166 ht, gt, edisp, edof, cttforce, &
170 cttforce((nnode+1)*3+1) = 0.d0
175 & mu,mut,fcoeff,etype,lgnt,ctchanged,ctNForce,ctTForce,jump_ratio)
178 integer(kind=kint),
intent(in) :: ndlocal(:)
179 real(kind=kreal),
intent(in) :: coord(:)
180 real(kind=kreal),
intent(in) :: disp(:)
181 real(kind=kreal),
intent(in) :: ddisp(:)
182 real(kind=kreal),
intent(in) :: mu, mut
183 real(kind=kreal),
intent(in) :: fcoeff
184 integer(kind=kint),
intent(in) :: etype
185 real(kind=kreal),
intent(inout) :: lgnt(2)
186 logical,
intent(inout) :: ctchanged
187 real(kind=kreal),
intent(out) :: ctnforce(:)
188 real(kind=kreal),
intent(out) :: cttforce(:)
189 real(kind=kreal),
intent(out) :: jump_ratio
191 integer(kind=kint) :: nnode
192 integer(kind=kint) :: slave, j
198 real(kind=kreal) :: dgn, nrlforce
199 real(kind=kreal) :: metric(2,2)
200 real(kind=kreal) :: dxy(2)
201 integer(kind=kint) :: edof
204 nnode =
size(ndlocal) - 1
212 curpos(1:3) = coord(3*slave-2:3*slave) + disp(3*slave-2:3*slave) + ddisp(3*slave-2:3*slave)
213 edisp(1:3) = ddisp(3*slave-2:3*slave)
215 elemcrd(1:3,j) = coord(3*ndlocal(j+1)-2:3*ndlocal(j+1)) + disp(3*ndlocal(j+1)-2:3*ndlocal(j+1))
216 curpos(j*3+1:j*3+3) = elemcrd(1:3,j) + ddisp(3*ndlocal(j+1)-2:3*ndlocal(j+1))
217 edisp(j*3+1:j*3+3) = ddisp(3*ndlocal(j+1)-2:3*ndlocal(j+1))
221 allocate(tsurf_tmp%nodes(nnode))
222 tsurf_tmp%etype = etype
223 tsurf_tmp%nodes = ndlocal(2:nnode+1)
230 dgn = dot_product( bn(1:edof), curpos(1:edof) )
233 ctstate%wkdist = -dgn
234 ctstate%multiplier(1) = ctstate%multiplier(1) - mu*ctstate%wkdist
235 ctstate%distance = ctstate%wkdist
236 lgnt(1) = lgnt(1) - ctstate%wkdist
239 nrlforce = ctstate%multiplier(1)
242 ctnforce(1:edof) = -nrlforce * bn(1:edof)
244 if( fcoeff == 0.d0 )
return
250 ht, gt, edisp, edof, cttforce, &
252 update_multiplier=.true., slave_id=slave, ctchanged=ctchanged, &
253 jump_ratio=jump_ratio)
256 dxy = matmul( gt(:,1:edof), curpos(1:edof) )
257 lgnt(2) = lgnt(2) + dsqrt( dxy(1)*dxy(1) + dxy(2)*dxy(2) )
260 deallocate(tsurf_tmp%nodes)
268 real(kind=kreal),
intent(in) :: mu
269 real(kind=kreal),
intent(out) :: stiff(:,:)
270 real(kind=kreal),
intent(out) :: force(:)
272 integer :: i, j, nnode, edof
276 nnode =
size(tsurf%nodes)
287 stiff(i,j) = mu * dot_product(tm(1:3,i), tm(1:3,j))
299 integer(kind=kint) :: nnode
300 real(kind=kreal) :: ndu(:)
301 real(kind=kreal),
intent(in) :: mu
302 real(kind=kreal) :: ctnforce(:)
303 real(kind=kreal) :: cttforce(:)
305 integer(kind=kint) :: edof
308 real(kind=kreal) :: dg(3)
309 real(kind=kreal) :: nrlforce(3)
311 nnode =
size(tsurf%nodes)
321 dg(1:3) = matmul(tm(1:3, 1:edof), ndu(1:edof))
324 nrlforce(1:3) = ctstate%multiplier(1:3) + mu*dg(1:3)
327 ctnforce(1:edof) = -matmul(transpose(tm(1:3, 1:edof)), nrlforce(1:3))
330 ctnforce((nnode+1)*3+1) = 0.d0
331 cttforce((nnode+1)*3+1) = 0.d0
This module encapsulate the basic functions of all elements provide by this software.
This module manages surface elements in 3D It provides basic definition of surface elements (triangla...
integer(kind=kint), parameter l_max_elem_node
integer(kind=kint), parameter l_max_surface_node
Structure to define surface group.