30 type(tsurfelement),
intent(in) :: tsurf
31 real(kind=kreal),
intent(in) :: fcoeff
34 real(kind=kreal),
intent(out) :: tm(3, 3*(l_max_surface_node+1))
35 real(kind=kreal),
intent(out) :: tt(3, 3*(l_max_surface_node+1))
38 integer(kind=kint) :: i, j
39 integer(kind=kint) :: nnode
40 real(kind=kreal) :: shapefunc(l_max_surface_node)
41 real(kind=kreal) :: normal(3)
42 real(kind=kreal) :: pt(3,3)
47 nnode =
size(tsurf%nodes)
49 call getshapefunc(tsurf%etype, ctstate%lpos(:), shapefunc)
52 normal(1:3) = ctstate%direction(1:3)
62 tm(1, i*3+1) = -shapefunc(i)
63 tm(2, i*3+2) = -shapefunc(i)
64 tm(3, i*3+3) = -shapefunc(i)
68 if (fcoeff /= 0.0d0)
then
73 pt(i,j) = 1.0d0 - normal(i)*normal(j)
75 pt(i,j) = -normal(i)*normal(j)
81 tt(1:3, 1:3*(l_max_surface_node+1)) = matmul(pt(1:3,1:3), tm(1:3, 1:3*(l_max_surface_node+1)))
101 type(tsurfelement),
intent(in) :: tsurf
102 real(kind=kreal),
intent(in) :: ele(:,:)
105 real(kind=kreal),
intent(out) :: bn(:)
106 real(kind=kreal),
intent(out) :: metric(2,2)
107 real(kind=kreal),
intent(out) :: ht(:,:)
108 real(kind=kreal),
intent(out) :: gt(:,:)
111 integer(kind=kint) :: nnode, ndof
112 real(kind=kreal) :: normal(3)
113 real(kind=kreal) :: tangent(3,2)
114 real(kind=kreal) :: tm(3, 3*(l_max_surface_node+1))
115 real(kind=kreal) :: tt(3, 3*(l_max_surface_node+1))
125 nnode =
size(tsurf%nodes)
132 normal(1:3) = ctstate%direction(1:3)
136 bn(1:ndof) = matmul(transpose(tm(1:3, 1:ndof)), normal(1:3))
140 call dispincrematrix(ctstate%lpos(1:2), tsurf%etype, nnode, ele(1:3,1:nnode), &
141 tangent, metric, ht(1:2,1:ndof))
145 gt(1:2,1:ndof) = matmul(metric(1:2,1:2), ht(1:2,1:ndof))
176 mut, update_multiplier, slave_id, ctchanged, &
177 norm_trial, alpha, that, jump_ratio)
181 real(kind=kreal),
intent(in) :: fcoeff
182 real(kind=kreal),
intent(in) :: lambda_n
183 real(kind=kreal),
intent(in) :: metric(2,2)
184 real(kind=kreal),
intent(in) :: ht(:,:)
185 real(kind=kreal),
intent(in) :: gt(:,:)
186 real(kind=kreal),
intent(in) :: edisp(:)
187 integer(kind=kint),
intent(in) :: edof
188 real(kind=kreal),
intent(out) :: cttforce(:)
189 real(kind=kreal),
intent(in) :: mut
190 logical,
optional,
intent(in) :: update_multiplier
191 integer(kind=kint),
optional,
intent(in) :: slave_id
192 logical,
optional,
intent(inout) :: ctchanged
193 real(kind=kreal),
optional,
intent(out) :: norm_trial
194 real(kind=kreal),
optional,
intent(out) :: alpha
195 real(kind=kreal),
optional,
intent(out) :: that(2)
196 real(kind=kreal),
optional,
intent(out) :: jump_ratio
198 real(kind=kreal) :: dxy(2)
199 real(kind=kreal) :: fric(2)
200 real(kind=kreal) :: f3(edof)
201 real(kind=kreal) :: invmetric(2,2)
202 real(kind=kreal) :: det
203 real(kind=kreal) :: norm_fric
204 real(kind=kreal) :: tmp(2)
205 real(kind=kreal) :: alpha_local
210 if(
present(jump_ratio)) jump_ratio = 0.0d0
211 if(
present(update_multiplier)) do_update = update_multiplier
214 det = metric(1,1)*metric(2,2) - metric(1,2)*metric(2,1)
215 if( abs(det) < 1.0d-20 )
then
220 invmetric(1,1) = metric(2,2) / det
221 invmetric(2,2) = metric(1,1) / det
222 invmetric(1,2) = -metric(1,2) / det
223 invmetric(2,1) = -metric(2,1) / det
226 dxy(1:2) = matmul( gt(1:2,1:edof), edisp(1:edof) )
229 fric(1:2) = ctstate%multiplier(2:3) + mut*dxy(1:2)
232 tmp(1:2) = matmul(invmetric(1:2,1:2), fric(1:2))
233 norm_fric = dsqrt( dot_product(fric(1:2), tmp(1:2)) )
236 if(
present(norm_trial)) norm_trial = norm_fric
237 if(
present(that) .and. norm_fric > 1.0d-20)
then
238 that(1:2) = fric(1:2) / norm_fric
239 else if(
present(that))
then
244 if( lambda_n > 0.0d0 .and. norm_fric > 1.0d-20 )
then
245 alpha_local = min(1.0d0, fcoeff*lambda_n / norm_fric)
249 if(
present(alpha)) alpha = alpha_local
252 if( do_update .and. lambda_n > 0.0d0 )
then
254 if( alpha_local < 1.0d0 )
then
257 if(
present(ctchanged)) ctchanged = .true.
258 if(
present(slave_id)) print *,
"Node", slave_id,
"to slip state", norm_fric, fcoeff*lambda_n
259 if(
present(jump_ratio) .and. lambda_n > 1.0e-20 .and. norm_fric > 1.0e-20) &
260 & jump_ratio = norm_fric / (fcoeff*lambda_n)
263 fric(1:2) = fric(1:2) * alpha_local
267 if(
present(ctchanged)) ctchanged = .true.
268 if(
present(slave_id)) print *,
"Node", slave_id,
"to stick state", norm_fric, fcoeff*lambda_n
273 ctstate%multiplier(2:3) = fric(1:2)
274 else if( lambda_n <= 0.0d0 )
then
279 if( alpha_local < 1.0d0 )
then
280 fric(1:2) = fric(1:2) * alpha_local
285 f3(1:edof) = matmul( transpose(ht(1:2,1:edof)), fric(1:2) )
288 cttforce(1:edof) = -f3(1:edof)
296 real(kind=kreal) :: fcoeff, tpenalty
297 real(kind=kreal) :: lagrange
299 integer(kind=kint) :: i
300 real(kind=kreal) :: tf_yield
303 ctstate%tangentForce_trial(i) = ctstate%tangentForce1(i) + tpenalty*ctstate%reldisp(i)
306 tf_yield = fcoeff*dabs(lagrange)
307 if(ctstate%state ==
contactslip) tf_yield =0.99d0*tf_yield
308 if( dsqrt(dot_product(ctstate%tangentForce_trial,ctstate%tangentForce_trial)) <= tf_yield )
then
318 integer,
intent(in) :: etype
319 integer,
intent(in) :: nn
320 real(kind=kreal),
intent(in) :: elemt0(3,nn)
321 real(kind=kreal),
intent(in) :: elemt(3,nn)
325 real(kind=kreal) :: tangent0(3,2), tangent(3,2)
326 real(kind=kreal) :: coeff(2), norm, norm_tmp
327 real(kind=kreal) :: tangentforce_tmp(3)
329 call tangentbase( etype, nn, cstate%lpos(1:2), elemt0, tangent0 )
330 call tangentbase( etype, nn, cstate%lpos(1:2), elemt, tangent )
334 coeff(i) = dot_product(cstate%tangentForce(1:3),tangent0(1:3,i))
335 coeff(i) = coeff(i)/dot_product(tangent0(1:3,i),tangent0(1:3,i))
337 tangentforce_tmp(1:3) = coeff(1)*tangent0(1:3,1) + coeff(2)*tangent0(1:3,2)
338 norm_tmp = dsqrt(dot_product(tangentforce_tmp,tangentforce_tmp))
340 if( norm_tmp > 1.d-6 )
then
341 norm = dsqrt(dot_product(cstate%tangentForce,cstate%tangentForce))
342 coeff(1:2) = (norm/norm_tmp)*coeff(1:2)
346 cstate%tangentForce1(1:3) = coeff(1)*tangent(1:3,1) + coeff(2)*tangent(1:3,2)
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.
subroutine tangentbase(fetype, nn, localcoord, elecoord, tangent)
Calculate base vector of tangent space of 3d surface.