24 subroutine getcontactstiffness_alag(cstate, tSurf, ele, mu, mut, fcoeff, symm, stiff, force, smoothing_type, edisp, iter)
28 real(kind=kreal),
intent(in) :: ele(:,:)
29 real(kind=kreal),
intent(in) :: mu, mut
30 real(kind=kreal),
intent(in) :: fcoeff
31 logical,
intent(in) :: symm
32 real(kind=kreal),
intent(out) :: stiff(:,:)
33 real(kind=kreal),
intent(out) :: force(:)
34 integer(kind=kint),
optional,
intent(in) :: smoothing_type
35 real(kind=kreal),
optional,
intent(in) :: edisp(:)
36 integer(kind=kint),
intent(in) :: iter
38 integer :: i, j, nnode
39 real(kind=kreal) :: bn(
size(tsurf%nodes)*3+3), ht(2,
size(tsurf%nodes)*3+3), gt(2,
size(tsurf%nodes)*3+3)
40 real(kind=kreal) :: metric(2,2)
41 real(kind=kreal) :: a(2,2)
42 real(kind=kreal) :: alpha_proj, that_dir(2)
43 real(kind=kreal) :: k_fric(
size(tsurf%nodes)*3+3,
size(tsurf%nodes)*3+3)
44 real(kind=kreal) :: tmp_vec(2)
45 real(kind=kreal) :: dummy_force(
size(tsurf%nodes)*3+3)
46 real(kind=kreal) :: eval_disp(
size(tsurf%nodes)*3+3)
48 nnode =
size(tsurf%nodes)
56 stiff(i,j) = mu * bn(i) * bn(j)
59 force(1:nnode*3+3) = bn(:)
62 if( fcoeff /= 0.d0 )
then
64 if(
present(edisp) )
then
65 eval_disp(1:nnode*3+3) = edisp(1:nnode*3+3)
70 ht, gt, eval_disp, nnode*3+3, dummy_force, &
71 mut, alpha=alpha_proj, that=that_dir)
74 if( cstate%multiplier(1) <= 0.0d0 .or. alpha_proj <= 1.0d-20 )
then
77 else if( alpha_proj >= 0.999d0 )
then
79 a(1,1) = mut * metric(1,1)
80 a(1,2) = mut * metric(1,2)
81 a(2,1) = mut * metric(2,1)
82 a(2,2) = mut * metric(2,2)
89 a(1,1) = alpha_proj * mut * metric(1,1)
90 a(1,2) = alpha_proj * mut * metric(1,2)
91 a(2,1) = alpha_proj * mut * metric(2,1)
92 a(2,2) = alpha_proj * mut * metric(2,2)
94 a(1,1) = alpha_proj * mut * (metric(1,1) - that_dir(1)*that_dir(1))
95 a(1,2) = alpha_proj * mut * (metric(1,2) - that_dir(1)*that_dir(2))
96 a(2,1) = alpha_proj * mut * (metric(2,1) - that_dir(2)*that_dir(1))
97 a(2,2) = alpha_proj * mut * (metric(2,2) - that_dir(2)*that_dir(2))
103 tmp_vec = matmul(a, ht(1:2,j))
105 k_fric(i,j) = dot_product(ht(1:2,i), tmp_vec)
109 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)
114 subroutine getcontactnodalforce_alag(ctState,tSurf,ndCoord,ndDu,mu,mut,fcoeff,lagrange,ctNForce,ctTForce,cflag,smoothing_type)
119 integer(kind=kint) :: nnode
120 integer(kind=kint) :: j
121 real(kind=kreal),
intent(in) :: mu, mut
122 real(kind=kreal) :: fcoeff
123 real(kind=kreal) :: lagrange
124 real(kind=kreal) :: ndcoord(:), nddu(:)
125 real(kind=kreal) :: ctnforce(:)
126 real(kind=kreal) :: cttforce(:)
128 integer(kind=kint),
optional,
intent(in) :: smoothing_type
130 real(kind=kreal) :: normal(3)
135 real(kind=kreal) :: dgn, nrlforce
136 real(kind=kreal) :: metric(2,2)
137 integer(kind=kint) :: edof
139 nnode =
size(tsurf%nodes)
145 normal(1:3) = ctstate%direction(1:3)
149 elemcrd(1:3, j) = ndcoord(j*3+1:j*3+3) - nddu(j*3+1:j*3+3)
154 bn, metric, ht, gt, smoothing_type)
157 dgn = dot_product( bn(1:edof), ndcoord(1:edof) )
160 nrlforce = ctstate%multiplier(1) + mu*dgn
163 ctnforce(1:edof) = -nrlforce * bn(1:edof)
166 ctnforce((nnode+1)*3+1) = 0.d0
168 if( fcoeff == 0.d0 )
return
173 edisp(1:3) = nddu(1:3)
175 edisp(j*3+1:j*3+3) = nddu(j*3+1:j*3+3)
180 ht, gt, edisp, edof, cttforce, &
184 cttforce((nnode+1)*3+1) = 0.d0
189 & mu,mut,fcoeff,tSurf,lgnt,ctchanged,ctNForce,ctTForce,jump_ratio,smoothing_type)
192 integer(kind=kint),
intent(in) :: ndlocal(:)
193 real(kind=kreal),
intent(in) :: coord(:)
194 real(kind=kreal),
intent(in) :: disp(:)
195 real(kind=kreal),
intent(in) :: ddisp(:)
196 real(kind=kreal),
intent(in) :: mu, mut
197 real(kind=kreal),
intent(in) :: fcoeff
199 real(kind=kreal),
intent(inout) :: lgnt(2)
200 logical,
intent(inout) :: ctchanged
201 real(kind=kreal),
intent(out) :: ctnforce(:)
202 real(kind=kreal),
intent(out) :: cttforce(:)
203 real(kind=kreal),
intent(out) :: jump_ratio
204 integer(kind=kint),
optional,
intent(in) :: smoothing_type
206 integer(kind=kint) :: nnode
207 integer(kind=kint) :: slave, j
213 real(kind=kreal) :: dgn, nrlforce
214 real(kind=kreal) :: metric(2,2)
215 real(kind=kreal) :: dxy(2)
216 integer(kind=kint) :: edof
218 nnode =
size(ndlocal) - 1
226 curpos(1:3) = coord(3*slave-2:3*slave) + disp(3*slave-2:3*slave) + ddisp(3*slave-2:3*slave)
227 edisp(1:3) = ddisp(3*slave-2:3*slave)
229 elemcrd(1:3,j) = coord(3*ndlocal(j+1)-2:3*ndlocal(j+1)) + disp(3*ndlocal(j+1)-2:3*ndlocal(j+1))
230 curpos(j*3+1:j*3+3) = elemcrd(1:3,j) + ddisp(3*ndlocal(j+1)-2:3*ndlocal(j+1))
231 edisp(j*3+1:j*3+3) = ddisp(3*ndlocal(j+1)-2:3*ndlocal(j+1))
236 bn, metric, ht, gt, smoothing_type)
239 dgn = dot_product( bn(1:edof), curpos(1:edof) )
242 ctstate%wkdist = -dgn
243 ctstate%multiplier(1) = ctstate%multiplier(1) - mu*ctstate%wkdist
244 ctstate%distance = ctstate%wkdist
245 lgnt(1) = lgnt(1) - ctstate%wkdist
248 nrlforce = ctstate%multiplier(1)
251 ctnforce(1:edof) = -nrlforce * bn(1:edof)
253 if( fcoeff == 0.d0 )
return
259 ht, gt, edisp, edof, cttforce, &
261 update_multiplier=.true., slave_id=slave, ctchanged=ctchanged, &
262 jump_ratio=jump_ratio)
265 dxy = matmul( gt(:,1:edof), curpos(1:edof) )
266 lgnt(2) = lgnt(2) + dsqrt( dxy(1)*dxy(1) + dxy(2)*dxy(2) )
274 real(kind=kreal),
intent(in) :: mu
275 real(kind=kreal),
intent(out) :: stiff(:,:)
276 real(kind=kreal),
intent(out) :: force(:)
278 integer :: i, j, nnode, edof
282 nnode =
size(tsurf%nodes)
293 stiff(i,j) = mu * dot_product(tm(1:3,i), tm(1:3,j))
305 integer(kind=kint) :: nnode
306 real(kind=kreal) :: ndu(:)
307 real(kind=kreal),
intent(in) :: mu
308 real(kind=kreal) :: ctnforce(:)
309 real(kind=kreal) :: cttforce(:)
311 integer(kind=kint) :: edof
314 real(kind=kreal) :: dg(3)
315 real(kind=kreal) :: nrlforce(3)
317 nnode =
size(tsurf%nodes)
327 dg(1:3) = matmul(tm(1:3, 1:edof), ndu(1:edof))
330 nrlforce(1:3) = ctstate%multiplier(1:3) + mu*dg(1:3)
333 ctnforce(1:edof) = -matmul(transpose(tm(1:3, 1:edof)), nrlforce(1:3))
336 ctnforce((nnode+1)*3+1) = 0.d0
337 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.