34 integer(kind=kint) :: nn
35 integer(kind=kint) :: nodlocal(:)
36 real(kind=
kreal) :: stiffness(:, :)
38 integer(kind=kint) :: ndof, inod_e, jnod_e, inod, jnod
39 real(kind=
kreal) :: a(6,6)
44 inod = nodlocal(inod_e)
46 jnod = nodlocal(jnod_e)
56 real(kind=
kreal) :: stiffness(:, :), a(:, :)
57 integer(kind=kint) :: ndof, inod, jnod
59 integer(kind=kint) :: row_offset, col_offset, i, j
61 row_offset = ndof*(inod-1)
64 col_offset = ndof*(jnod-1)
67 a(i, j) = stiffness(i + row_offset, j + col_offset)
75 integer(kind=kint) :: inod, jnod
76 real(kind=
kreal) :: a(:, :)
78 integer(kind=kint) :: ndof, is, ie, k, idx_base, idx, idof, jdof
83 is = hecmat%indexU(inod-1)+1
84 ie = hecmat%indexU(inod)
87 if (k < is .or. ie < k)
then
88 write(*,*)
'###ERROR### : cannot find connectivity (1)'
93 idx_base = ndof**2 * (k-1)
98 hecmat%AU(idx) = hecmat%AU(idx) + a(idof, jdof)
100 idx_base = idx_base + ndof
103 else if (inod > jnod)
then
104 is = hecmat%indexL(inod-1)+1
105 ie = hecmat%indexL(inod)
108 if (k < is .or. ie < k)
then
109 write(*,*)
'###ERROR### : cannot find connectivity (2)'
114 idx_base = ndof**2 * (k-1)
117 idx = idx_base + jdof
119 hecmat%AL(idx) = hecmat%AL(idx) + a(idof, jdof)
121 idx_base = idx_base + ndof
125 idx_base = ndof**2 * (inod - 1)
128 idx = idx_base + jdof
130 hecmat%D(idx) = hecmat%D(idx) + a(idof, jdof)
132 idx_base = idx_base + ndof
140 integer(kind=kint) :: array(:)
141 integer(kind=kint) :: is, ie, ival
143 integer(kind=kint) :: left, right, center, cval
148 if (left > right)
then
153 center = (left + right) / 2
156 if (ival < cval)
then
158 else if (cval < ival)
then
179 real(kind=
kreal),
pointer :: penalty
180 real(kind=
kreal) :: alpha, a1_2inv, ai, aj, factor
181 integer(kind=kint) :: impc, is, ie, i, j, inod, idof, jnod, jdof
182 logical :: is_internal_i
188 penalty => hecmat%Rarray(11)
190 if (penalty < 0.0) stop
"ERROR: negative penalty"
191 if (penalty < 1.0)
write(*,*)
"WARNING: penalty ", penalty,
" smaller than 1"
196 outer:
do impc = 1, hecmesh%mpc%n_mpc
197 is = hecmesh%mpc%mpc_index(impc-1) + 1
198 ie = hecmesh%mpc%mpc_index(impc)
201 if (hecmesh%mpc%mpc_dof(i) > hecmat%NDOF) cycle outer
204 a1_2inv = 1.0 / hecmesh%mpc%mpc_val(is)**2
208 inod = hecmesh%mpc%mpc_item(i)
211 if (.not. is_internal_i) cycle
213 idof = hecmesh%mpc%mpc_dof(i)
214 ai = hecmesh%mpc%mpc_val(i)
215 factor = ai * a1_2inv
218 jnod = hecmesh%mpc%mpc_item(j)
219 jdof = hecmesh%mpc%mpc_dof(j)
220 aj = hecmesh%mpc%mpc_val(j)
237 real(kind=
kreal) :: alpha, a1_2inv, ai, factor, ci
238 integer(kind=kint) :: ndof, impc, is, ie, i, inod, idof
243 if (alpha <= 0.0) stop
"ERROR: penalty applied on vector before matrix"
247 outer:
do impc = 1, hecmesh%mpc%n_mpc
248 is = hecmesh%mpc%mpc_index(impc-1) + 1
249 ie = hecmesh%mpc%mpc_index(impc)
252 if (hecmesh%mpc%mpc_dof(i) > ndof) cycle outer
255 a1_2inv = 1.0 / hecmesh%mpc%mpc_val(is)**2
258 inod = hecmesh%mpc%mpc_item(i)
260 idof = hecmesh%mpc%mpc_dof(i)
261 ai = hecmesh%mpc%mpc_val(i)
262 factor = ai * a1_2inv
264 ci = hecmesh%mpc%mpc_const(impc)
266 hecmat%B(ndof*(inod-1)+idof) = hecmat%B(ndof*(inod-1)+idof) + ci*factor*alpha
277 integer(kind=kint) :: inod, idof, jnod, jdof
278 real(kind=
kreal) :: val
280 integer(kind=kint) :: ndof, is, ie, k, idx
283 if (inod < jnod)
then
284 is = hecmat%indexU(inod-1)+1
285 ie = hecmat%indexU(inod)
288 if (k < is .or. ie < k)
then
289 write(*,*)
'###ERROR### : cannot find connectivity (3)'
295 idx = ndof**2 * (k-1) + ndof * (idof-1) + jdof
297 hecmat%AU(idx) = hecmat%AU(idx) + val
299 else if (inod > jnod)
then
300 is = hecmat%indexL(inod-1)+1
301 ie = hecmat%indexL(inod)
304 if (k < is .or. ie < k)
then
305 write(*,*)
'###ERROR### : cannot find connectivity (4)'
311 idx = ndof**2 * (k-1) + ndof * (idof-1) + jdof
313 hecmat%AL(idx) = hecmat%AL(idx) + val
316 idx = ndof**2 * (inod - 1) + ndof * (idof - 1) + jdof
318 hecmat%D(idx) = hecmat%D(idx) + val
330 integer(kind=kint) :: inode, idof
331 real(kind=
kreal) :: rhs, val
333 integer(kind=kint) :: ndof, in, i, ii, iii, ndof2, k, is, ie, iis, iie, ik, idx
336 if( ndof < idof )
return
340 hecmat%B(ndof*inode-(ndof-idof)) = rhs
341 if(
present(conmat)) conmat%B(ndof*inode-(ndof-idof)) = 0.0d0
346 if( i .NE. ndof-idof )
then
348 val = hecmat%D(ndof2*inode-ii)*rhs
350 hecmat%B(idx) = hecmat%B(idx) - val
351 if(
present(conmat))
then
352 val = conmat%D(ndof2*inode-ii)*rhs
354 conmat%B(idx) = conmat%B(idx) - val
361 ii = ndof2-1 - (idof-1)*ndof
364 hecmat%D(ndof2*inode-ii+i)=0.d0
365 if(
present(conmat)) conmat%D(ndof2*inode-ii+i)=0.d0
372 hecmat%D(ndof2*inode-ii) = 0.d0
373 if(
present(conmat)) conmat%D(ndof2*inode-ii) = 0.d0
375 hecmat%D(ndof2*inode-ii) = 1.d0
376 if(
present(conmat)) conmat%D(ndof2*inode-ii) = 0.d0
383 ii = ndof2-1 - (idof-1)*ndof
384 is = hecmat%indexL(inode-1) + 1
385 ie = hecmat%indexL(inode )
391 hecmat%AL(ndof2*k-ii+i) = 0.d0
392 if(
present(conmat)) conmat%AL(ndof2*k-ii+i) = 0.d0
397 iis = hecmat%indexU(in-1) + 1
398 iie = hecmat%indexU(in )
400 if (hecmat%itemU(ik) .eq. inode)
then
404 val = hecmat%AU(ndof2*ik-iii)*rhs
406 hecmat%B(idx) = hecmat%B(idx) - val
407 hecmat%AU(ndof2*ik-iii)= 0.d0
408 if(
present(conmat))
then
409 val = conmat%AU(ndof2*ik-iii)*rhs
411 conmat%B(idx) = conmat%B(idx) - val
412 conmat%AU(ndof2*ik-iii)= 0.d0
422 ii = ndof2-1 - (idof-1)*ndof
423 is = hecmat%indexU(inode-1) + 1
424 ie = hecmat%indexU(inode )
430 hecmat%AU(ndof2*k-ii+i) = 0.d0
431 if(
present(conmat)) conmat%AU(ndof2*k-ii+i) = 0.d0
436 iis = hecmat%indexL(in-1) + 1
437 iie = hecmat%indexL(in )
439 if (hecmat%itemL(ik) .eq. inode)
then
444 val = hecmat%AL(ndof2*ik-iii)*rhs
446 hecmat%B(idx) = hecmat%B(idx) - val
447 hecmat%AL(ndof2*ik-iii) = 0.d0
448 if(
present(conmat))
then
449 val = conmat%AL(ndof2*ik-iii)*rhs
451 conmat%B(idx) = conmat%B(idx) - val
452 conmat%AL(ndof2*ik-iii) = 0.d0
472 integer(kind=kint) :: inode, idof
473 integer(kind=kint) :: isu, ieu, isl, iel, i, l, k
474 real(kind=
kreal) :: rhs
476 isu = heclagmat%indexU_lagrange(inode-1)+1
477 ieu = heclagmat%indexU_lagrange(inode)
479 heclagmat%AU_lagrange((i-1)*3+idof) = 0.0d0
480 l = heclagmat%itemU_lagrange(i)
481 isl = heclagmat%indexL_lagrange(l-1)+1
482 iel = heclagmat%indexL_lagrange(l)
484 if(k < isl .or. k > iel) cycle
485 hecmat%B(hecmat%NP*hecmat%NDOF+l) = hecmat%B(hecmat%NP*hecmat%NDOF+l) - heclagmat%AL_lagrange((k-1)*3+idof)*rhs
486 heclagmat%AL_lagrange((k-1)*3+idof) = 0.0d0
496 integer(kind=kint) :: nnode, ndlocal(nnode + 1), id_lagrange
499 integer(kind=kint) :: i, j, inod, jnod, l
500 integer(kind=kint) :: isl, iel, idxl_base, kl, idxl, isu, ieu, idxu_base, ku, idxu
501 real(kind=
kreal) :: fcoeff
502 real(kind=
kreal) :: stiffness(:,:)
503 real(kind=
kreal) :: a(3, 3)
507 isl = heclagmat%indexL_lagrange(inod-1)+1
508 iel = heclagmat%indexL_lagrange(inod)
512 isu = heclagmat%indexU_lagrange(jnod-1)+1
513 ieu = heclagmat%indexU_lagrange(jnod)
516 if( kl<isl .or. kl>iel )
then
517 write(*,*)
'###ERROR### : cannot find connectivity (Lagrange1)'
521 if( ku<isu .or. ku>ieu )
then
522 write(*,*)
'###ERROR### : cannot find connectivity (Lagrange2)'
531 heclagmat%AL_lagrange(idxl) = heclagmat%AL_lagrange(idxl) + stiffness((i-1)*3+1,(j-1)*3+l)
533 heclagmat%AU_lagrange(idxu) = heclagmat%AU_lagrange(idxu) + stiffness((j-1)*3+l,(i-1)*3+1)
538 if(fcoeff /= 0.0d0)
then
544 call stf_get_block(stiffness(1:(nnode+1)*3,1:(nnode+1)*3), 3, i, j, a)