7 use hecmw,
only : kint, kreal
19 subroutine stf_c1( etype,nn,ecoord,area,gausses,stiff, u ,temperature )
20 integer(kind=kint),
intent(in) :: etype
21 integer(kind=kint),
intent(in) :: nn
22 real(kind=kreal),
intent(in) :: ecoord(3,nn)
23 real(kind=kreal),
intent(in) :: area
25 real(kind=kreal),
intent(out) :: stiff(:,:)
26 real(kind=kreal),
intent(in),
optional :: u(:,:)
27 real(kind=kreal),
intent(in),
optional :: temperature(nn)
29 real(kind=kreal) llen, llen0, elem(3,nn)
31 real(kind=kreal) ina(1), outa(1), direc(3), direc0(3), coeff, strain
32 integer(kind=kint) :: i,j
36 elem(:,:) = ecoord(:,:) + u(:,:)
38 elem(:,:) = ecoord(:,:)
41 direc = elem(:,2)-elem(:,1)
42 llen = dsqrt( dot_product(direc, direc) )
44 direc0 = ecoord(:,2)-ecoord(:,1)
45 llen0 = dsqrt( dot_product(direc0, direc0) )
47 if(
present(temperature) )
then
48 ina(1) = 0.5d0*(temperature(1)+temperature(2))
49 call fetch_tabledata( mc_isoelastic, gausses(1)%pMaterial%dict, outa, ierr, ina )
51 call fetch_tabledata( mc_isoelastic, gausses(1)%pMaterial%dict, outa, ierr )
53 if( ierr ) outa(1) = gausses(1)%pMaterial%variables(m_youngs)
54 coeff = outa(1)*area*llen0/(llen*llen)
55 strain = gausses(1)%strain(1)
59 stiff(i,i) = coeff*strain
61 stiff(i,j) = stiff(i,j) + coeff*(1.d0-2.d0*strain)*direc(i)*direc(j)
65 stiff(4:6,1:3) = -stiff(1:3,1:3)
66 stiff(1:3,4:6) = transpose(stiff(4:6,1:3))
67 stiff(4:6,4:6) = stiff(1:3,1:3)
74 subroutine update_c1( etype, nn, ecoord, area, u, du, qf ,gausses, TT, T0 )
78 integer(kind=kint),
intent(in) :: etype
79 integer(kind=kint),
intent(in) :: nn
80 real(kind=kreal),
intent(in) :: ecoord(3,nn)
81 real(kind=kreal),
intent(in) :: area
82 real(kind=kreal),
intent(in) :: u(3,nn)
83 real(kind=kreal),
intent(in) :: du(3,nn)
84 real(kind=kreal),
intent(out) :: qf(nn*3)
86 real(kind=kreal),
intent(in),
optional :: tt(nn)
87 real(kind=kreal),
intent(in),
optional :: t0(nn)
90 real(kind=kreal) :: direc(3), direc0(3)
91 real(kind=kreal) :: llen, llen0, ina(1), outa(1)
92 real(kind=kreal) :: elem(3,nn)
93 real(kind=kreal) :: young
94 real(kind=kreal) :: ttc, tt0, alp, alp0, epsth
99 elem(:,:) = ecoord(:,:) + u(:,:) + du(:,:)
101 direc = elem(:,2)-elem(:,1)
102 llen = dsqrt( dot_product(direc, direc) )
104 direc0 = ecoord(:,2)-ecoord(:,1)
105 llen0 = dsqrt( dot_product(direc0, direc0) )
108 if(
present(tt) .and.
present(t0) )
then
109 ttc = 0.5d0*(tt(1)+tt(2))
110 tt0 = 0.5d0*(t0(1)+t0(2))
113 call fetch_tabledata( mc_isoelastic, gausses(1)%pMaterial%dict, outa, ierr, ina )
114 if( ierr ) outa(1) = gausses(1)%pMaterial%variables(m_youngs)
117 call fetch_tabledata( mc_themoexp, gausses(1)%pMaterial%dict, outa(:), ierr, ina )
118 if( ierr ) outa(1) = gausses(1)%pMaterial%variables(m_exapnsion)
122 call fetch_tabledata( mc_themoexp, gausses(1)%pMaterial%dict, outa(:), ierr, ina )
123 if( ierr ) outa(1) = gausses(1)%pMaterial%variables(m_exapnsion)
128 call fetch_tabledata( mc_isoelastic, gausses(1)%pMaterial%dict, outa, ierr )
129 if( ierr ) outa(1) = gausses(1)%pMaterial%variables(m_youngs)
133 gausses(1)%strain(1) = dlog(llen/llen0)
134 gausses(1)%stress(1) = young*(gausses(1)%strain(1)-epsth)
137 gausses(1)%strain_out(1) = gausses(1)%strain(1)
138 gausses(1)%stress_out(1) = gausses(1)%stress(1)
140 qf(1) = gausses(1)%stress(1)*area*llen0/llen
141 qf(1:3) = -qf(1)*direc
152 integer(kind=kint),
intent(in) :: etype,nn
154 real(kind=kreal),
intent(out) :: ndstrain(nn,6)
155 real(kind=kreal),
intent(out) :: ndstress(nn,6)
157 ndstrain(1,1:6) = gausses(1)%strain(1:6)
158 ndstress(1,1:6) = gausses(1)%stress(1:6)
159 ndstrain(2,1:6) = gausses(1)%strain(1:6)
160 ndstress(2,1:6) = gausses(1)%stress(1:6)
172 integer(kind=kint),
intent(in) :: ETYPE
174 real(kind=kreal),
intent(out) :: strain(6)
175 real(kind=kreal),
intent(out) :: stress(6)
178 strain(:) = gausses(1)%strain(1:6)
179 stress(:) = gausses(1)%stress(1:6)
185 subroutine dl_c1(etype, nn, xx, yy, zz, rho, thick, ltype, params, &
191 integer(kind = kint),
intent(in) :: etype, nn
192 real(kind = kreal),
intent(in) :: xx(:), yy(:), zz(:)
193 real(kind = kreal),
intent(in) :: params(0:6)
194 real(kind = kreal),
intent(inout) :: vect(:)
195 real(kind = kreal) :: rho, thick
196 integer(kind = kint) :: ltype, nsize
198 integer(kind = kint) :: ndof = 3
199 integer(kind = kint) :: ivol, isuf, i
200 real(kind = kreal) :: vx, vy, vz, val, a, aa
207 if( ltype .LT. 10 )
then
209 else if( ltype .GE. 10 )
then
216 vect(1:nsize) = 0.0d0
219 if( ivol .EQ. 1 )
then
220 if( ltype .EQ. 4 )
then
221 aa = dsqrt( ( xx(2)-xx(1) )*( xx(2)-xx(1) ) &
222 +( yy(2)-yy(1) )*( yy(2)-yy(1) ) &
223 +( zz(2)-zz(1) )*( zz(2)-zz(1) ) )
229 vx = vx/dsqrt( params(1)**2+params(2)**2+params(3)**2 )
230 vy = vy/dsqrt( params(1)**2+params(2)**2+params(3)**2 )
231 vz = vz/dsqrt( params(1)**2+params(2)**2+params(3)**2 )
234 vect(3*i-2) = val*rho*a*0.5d0*aa*vx
235 vect(3*i-1) = val*rho*a*0.5d0*aa*vy
236 vect(3*i ) = val*rho*a*0.5d0*aa*vz
253 type (hecmwST_matrix) :: hecMAT
254 type (hecmwST_local_mesh) :: hecMESH
255 integer(kind=kint) :: itype, is, iE, ic_type, icel, jS, j, n
257 do itype = 1, hecmesh%n_elem_type
258 ic_type = hecmesh%elem_type_item(itype)
259 if(ic_type == 301)
then
260 is = hecmesh%elem_type_index(itype-1) + 1
261 ie = hecmesh%elem_type_index(itype )
263 js = hecmesh%elem_node_index(icel-1)
265 n = hecmesh%elem_node_item(js+j)
266 if( hecmat%D(9*n-8) == 0.0d0)
then
267 hecmat%D(9*n-8) = 1.0d0
270 if( hecmat%D(9*n-4) == 0.0d0)
then
271 hecmat%D(9*n-4) = 1.0d0
274 if( hecmat%D(9*n ) == 0.0d0)
then
275 hecmat%D(9*n ) = 1.0d0
292 type (hecmwST_matrix) :: hecMAT
293 type (hecmwST_local_mesh) :: hecMESH
294 integer :: n, nn, is, iE, i, a
298 is = hecmat%IndexL(n-1)+1
299 ie = hecmat%IndexL(n )
301 if(hecmat%AL(9*i-8) /= 0.0d0) a = 1
302 if(hecmat%AL(9*i-7) /= 0.0d0) a = 1
303 if(hecmat%AL(9*i-6) /= 0.0d0) a = 1
305 is = hecmat%IndexU(n-1)+1
306 ie = hecmat%IndexU(n )
308 if(hecmat%AU(9*i-8) /= 0.0d0) a = 1
309 if(hecmat%AU(9*i-7) /= 0.0d0) a = 1
310 if(hecmat%AU(9*i-6) /= 0.0d0) a = 1
312 if(hecmat%D(9*n-7) /= 0.0d0) a = 1
313 if(hecmat%D(9*n-6) /= 0.0d0) a = 1
315 hecmat%D(9*n-8) = 1.0d0
321 is = hecmat%IndexL(n-1)+1
322 ie = hecmat%IndexL(n )
324 if(hecmat%AL(9*i-5) /= 0.0d0) a = 1
325 if(hecmat%AL(9*i-4) /= 0.0d0) a = 1
326 if(hecmat%AL(9*i-3) /= 0.0d0) a = 1
328 is = hecmat%IndexU(n-1)+1
329 ie = hecmat%IndexU(n )
331 if(hecmat%AU(9*i-5) /= 0.0d0) a = 1
332 if(hecmat%AU(9*i-4) /= 0.0d0) a = 1
333 if(hecmat%AU(9*i-3) /= 0.0d0) a = 1
335 if(hecmat%D(9*n-5) /= 0.0d0) a = 1
336 if(hecmat%D(9*n-3) /= 0.0d0) a = 1
338 hecmat%D(9*n-4) = 1.0d0
344 is = hecmat%IndexL(n-1)+1
345 ie = hecmat%IndexL(n )
347 if(hecmat%AL(9*i-2) /= 0.0d0) a = 1
348 if(hecmat%AL(9*i-1) /= 0.0d0) a = 1
349 if(hecmat%AL(9*i ) /= 0.0d0) a = 1
351 is = hecmat%IndexU(n-1)+1
352 ie = hecmat%IndexU(n )
354 if(hecmat%AU(9*i-2) /= 0.0d0) a = 1
355 if(hecmat%AU(9*i-1) /= 0.0d0) a = 1
356 if(hecmat%AU(9*i ) /= 0.0d0) a = 1
358 if(hecmat%D(9*n-2) /= 0.0d0) a = 1
359 if(hecmat%D(9*n-1) /= 0.0d0) a = 1
361 hecmat%D(9*n ) = 1.0d0
369 subroutine stf_connector( etype, nn, ecoord, gausses, stiff, u, tincr, temperature )
370 integer(kind=kint),
intent(in) :: etype
371 integer(kind=kint),
intent(in) :: nn
372 real(kind=kreal),
intent(in) :: ecoord(3,nn)
374 real(kind=kreal),
intent(out) :: stiff(:,:)
375 real(kind=kreal),
intent(in) :: u(:,:)
376 real(kind=kreal),
intent(in) :: tincr
377 real(kind=kreal),
intent(in) :: temperature(nn)
379 integer(kind=kint) :: mtype, ctype
380 integer(kind=kint) :: i, j, n_ndof, dof1, dof2, id1, id2
385 if( getnumofspring_dparam( gausses(1)%pMaterial ) > 0 )
then
390 if( getnumofspring_aparam( gausses(1)%pMaterial ) > 0 )
then
395 if( getnumofdashpot_dparam( gausses(1)%pMaterial ) > 0 )
then
400 if( getnumofdashpot_aparam( gausses(1)%pMaterial ) > 0 )
then
409 subroutine update_connector( etype, nn, ecoord, u, du, qf ,gausses, tincr, TT )
413 integer(kind=kint),
intent(in) :: etype
414 integer(kind=kint),
intent(in) :: nn
415 real(kind=kreal),
intent(in) :: ecoord(3,nn)
416 real(kind=kreal),
intent(in) :: u(3,nn)
417 real(kind=kreal),
intent(in) :: du(3,nn)
418 real(kind=kreal),
intent(out) :: qf(nn*3)
420 real(kind=kreal),
intent(in) :: tincr
421 real(kind=kreal),
intent(in),
optional :: tt(nn)
424 integer(kind=kint) :: mtype, ctype
425 real(kind=kreal) llen, llen0, elem(3,nn)
426 real(kind=kreal) direc(3), direc0(3), ratio
427 real(kind=kreal) :: params(4)
428 integer(kind=kint) :: i, j, n_ndof, dof1, dof2, id1, id2
432 gausses(1)%strain(:) = 0.d0
433 gausses(1)%stress(:) = 0.d0
436 if( getnumofspring_dparam( gausses(1)%pMaterial ) > 0 )
then
441 if( getnumofspring_aparam( gausses(1)%pMaterial ) > 0 )
then
446 if( getnumofdashpot_dparam( gausses(1)%pMaterial ) > 0 )
then
451 if( getnumofdashpot_aparam( gausses(1)%pMaterial ) > 0 )
then
456 gausses(1)%strain_out(:) = gausses(1)%strain(:)
457 gausses(1)%stress_out(:) = gausses(1)%stress(:)
463 real(kind=kreal),
intent(out) :: stiff(:,:)
465 real(kind=kreal) :: params(1)
466 integer(kind=kint) :: iparams(2)
467 integer(kind=kint) :: i, j, n_ndof, id1, id2
469 n_ndof = getnumofspring_dparam( gausses(1)%pMaterial )
475 stiff(id1,id1) = stiff(id1,id1) + params(1)
476 stiff(id1,id2) = stiff(id1,id2) - params(1)
477 stiff(id2,id1) = stiff(id2,id1) - params(1)
478 stiff(id2,id2) = stiff(id2,id2) + params(1)
484 real(kind=kreal),
intent(in) :: ecoord(:,:)
485 real(kind=kreal),
intent(in) :: u(:,:)
486 real(kind=kreal),
intent(in) :: du(:,:)
487 real(kind=kreal),
intent(out) :: qf(:)
490 real(kind=kreal) :: params(1)
491 integer(kind=kint) :: iparams(2)
492 real(kind=kreal) :: totaldisp(3,2), stretch, sforce
493 integer(kind=kint) :: i, j, n_ndof, dof1, dof2, id1, id2
495 n_ndof = getnumofspring_dparam( gausses(1)%pMaterial )
496 totaldisp(1:3,1:2) = u(1:3,1:2) + du(1:3,1:2)
504 stretch = totaldisp(dof1,1)-totaldisp(dof2,2)
505 sforce = params(1) * stretch
506 if( dof1 == dof2 )
then
507 gausses(1)%strain(dof1) = gausses(1)%strain(dof1) + stretch
508 gausses(1)%stress(dof1) = gausses(1)%stress(dof1) + sforce
510 qf(id1) = qf(id1) + sforce
511 qf(id2) = qf(id2) - sforce
517 real(kind=kreal),
intent(in) :: ecoord(:,:)
518 real(kind=kreal),
intent(in) :: u(:,:)
519 real(kind=kreal),
intent(out) :: stiff(:,:)
521 real(kind=kreal) :: params(1)
522 integer(kind=kint) :: iparams(2)
523 integer(kind=kint) :: i, j, n_ndof, dof1, dof2, id1, id2
524 real(kind=kreal) :: llen, llen0, elem(3,2)
525 real(kind=kreal) :: direc(3), direc0(3), ratio
531 elem(1:3,1:2) = ecoord(1:3,1:2) + u(1:3,1:2)
534 direc = elem(1:3,1) - elem(1:3,2)
535 llen = dsqrt( dot_product(direc, direc) )
538 direc0 = ecoord(1:3,1) - ecoord(1:3,2)
539 llen0 = dsqrt( dot_product(direc0, direc0) )
542 if( llen < 1.d-10 )
then
546 direc(1:3) = direc(1:3) / llen
547 ratio = (llen - llen0) / llen
552 stiff(i,i) = stiff(i,i) + params(1) * ratio
554 stiff(i,j) = stiff(i,j) + params(1) * (1.d0 - ratio) * direc(i) * direc(j)
559 stiff(4:6, 1:3) = -stiff(1:3, 1:3)
560 stiff(1:3, 4:6) = transpose(stiff(4:6, 1:3))
561 stiff(4:6, 4:6) = stiff(1:3, 1:3)
567 real(kind=kreal),
intent(in) :: ecoord(:,:)
568 real(kind=kreal),
intent(in) :: u(:,:)
569 real(kind=kreal),
intent(in) :: du(:,:)
570 real(kind=kreal),
intent(out) :: qf(:)
573 real(kind=kreal) :: params(1)
574 integer(kind=kint) :: iparams(2)
575 real(kind=kreal) :: llen, llen0, elem(3,2)
576 real(kind=kreal) :: direc(3), direc0(3)
582 elem(1:3,1:2) = ecoord(1:3,1:2) + u(1:3,1:2) + du(1:3,1:2)
585 direc = elem(1:3,1) - elem(1:3,2)
586 llen = dsqrt( dot_product(direc, direc) )
589 direc0 = ecoord(1:3,1) - ecoord(1:3,2)
590 llen0 = dsqrt( dot_product(direc0, direc0) )
593 if( llen < 1.d-10 )
then
596 direc(1:3) = direc(1:3) / llen
600 gausses(1)%strain(1) = llen - llen0
601 gausses(1)%stress(1) = params(1) * gausses(1)%strain(1)
604 qf(1:3) = qf(1:3) + gausses(1)%stress(1)*direc(1:3)
605 qf(4:6) = qf(4:6) - gausses(1)%stress(1)*direc(1:3)
610 real(kind=kreal),
intent(in) :: tincr
611 real(kind=kreal),
intent(out) :: stiff(:,:)
613 real(kind=kreal) :: params(1)
614 integer(kind=kint) :: iparams(2)
615 integer(kind=kint) :: i, j, n_ndof, id1, id2
617 n_ndof = getnumofdashpot_dparam( gausses(1)%pMaterial )
623 stiff(id1,id1) = stiff(id1,id1) + params(1)/tincr
624 stiff(id1,id2) = stiff(id1,id2) - params(1)/tincr
625 stiff(id2,id1) = stiff(id2,id1) - params(1)/tincr
626 stiff(id2,id2) = stiff(id2,id2) + params(1)/tincr
632 real(kind=kreal),
intent(in) :: ecoord(:,:)
633 real(kind=kreal),
intent(in) :: du(:,:)
634 real(kind=kreal),
intent(in) :: tincr
635 real(kind=kreal),
intent(out) :: qf(:)
638 real(kind=kreal) :: params(1)
639 integer(kind=kint) :: iparams(2)
640 real(kind=kreal) :: totaldisp(3,2), stretch, dforce
641 integer(kind=kint) :: i, j, n_ndof, dof1, dof2, id1, id2
643 n_ndof = getnumofdashpot_dparam( gausses(1)%pMaterial )
651 stretch = du(dof1,1)-du(dof2,2)
652 dforce = params(1) * stretch / tincr
653 if( dof1 == dof2 )
then
654 gausses(1)%strain(dof1) = gausses(1)%strain(dof1) + stretch
655 gausses(1)%stress(dof1) = gausses(1)%stress(dof1) + dforce
657 qf(id1) = qf(id1) + dforce
658 qf(id2) = qf(id2) - dforce
664 real(kind=kreal),
intent(in) :: ecoord(:,:)
665 real(kind=kreal),
intent(in) :: u(:,:)
666 real(kind=kreal),
intent(in) :: tincr
667 real(kind=kreal),
intent(out) :: stiff(:,:)
669 real(kind=kreal) :: params(1)
670 integer(kind=kint) :: iparams(2)
671 integer(kind=kint) :: i, j, n_ndof, dof1, dof2, id1, id2
672 real(kind=kreal) :: llen, elem(3,2)
673 real(kind=kreal) :: direc(3), ratio
679 elem(1:3,1:2) = ecoord(1:3,1:2) + u(1:3,1:2)
682 direc = elem(1:3,1) - elem(1:3,2)
683 llen = dsqrt( dot_product(direc, direc) )
686 if( llen < 1.d-10 )
then
690 direc(1:3) = direc(1:3) / llen
691 ratio = gausses(1)%strain(1) / llen
696 stiff(i,i) = stiff(i,i) + params(1) * ratio / tincr
698 stiff(i,j) = stiff(i,j) + params(1) * (1.d0 - ratio) * direc(i) * direc(j) / tincr
703 stiff(4:6, 1:3) = -stiff(1:3, 1:3)
704 stiff(1:3, 4:6) = transpose(stiff(4:6, 1:3))
705 stiff(4:6, 4:6) = stiff(1:3, 1:3)
711 real(kind=kreal),
intent(in) :: ecoord(:,:)
712 real(kind=kreal),
intent(in) :: u(:,:)
713 real(kind=kreal),
intent(in) :: du(:,:)
714 real(kind=kreal),
intent(in) :: tincr
715 real(kind=kreal),
intent(out) :: qf(:)
718 real(kind=kreal) :: params(1)
719 integer(kind=kint) :: iparams(2)
720 real(kind=kreal) :: llen, llen0, elem(3,2)
721 real(kind=kreal) :: direc(3), direc0(3)
727 elem(1:3,1:2) = ecoord(1:3,1:2) + u(1:3,1:2) + du(1:3,1:2)
730 direc = elem(1:3,1) - elem(1:3,2)
731 llen = dsqrt( dot_product(direc, direc) )
734 direc0 = ecoord(1:3,1) + u(1:3,1) - ecoord(1:3,2) - u(1:3,2)
735 llen0 = dsqrt( dot_product(direc0, direc0) )
738 if( llen < 1.d-10 )
then
741 direc(1:3) = direc(1:3) / llen
745 gausses(1)%strain(1) = llen - llen0
746 gausses(1)%stress(1) = params(1) * gausses(1)%strain(1) / tincr
749 qf(1:3) = qf(1:3) + gausses(1)%stress(1)*direc(1:3)
750 qf(4:6) = qf(4:6) - gausses(1)%stress(1)*direc(1:3)