25 type(hecmwst_matrix) :: hecMAT
26 type(hecmwst_local_mesh) :: hecMESH
31 real(kind=kreal) :: xx(20), yy(20), zz(20)
32 real(kind=kreal) :: params(0:6)
33 real(kind=kreal) :: vect(60)
34 integer(kind=kint) :: iwk(60)
35 integer(kind=kint) :: nodLocal(20)
36 real(kind=kreal) :: tt(20), tt0(20), coords(3,3)
37 real(kind=kreal),
pointer:: temp(:)
38 integer(kind=kint) :: ndof, ig0, ig, ityp, ltype, iS0, iE0, ik, in, i, j
39 integer(kind=kint) :: icel, ic_type, nn, is, isect, id, iset, nsize
40 integer(kind=kint) :: itype, iE, cdsys_ID
41 real(kind=kreal) :: val, rho, thick, pa1
43 logical,
save :: isFirst = .true.
45 integer(kind=kint) :: flag_u, ierror
46 integer(kind=kint),
optional :: iter
47 real(kind=kreal) :: f_t
49 integer(kind=kint) :: iiS, idofS, idofE
50 real(kind=kreal) :: ecoord(3, 20)
51 real(kind=kreal) :: v(6, 20), dv(6, 20), r(6*20)
52 real(kind=kreal) :: rhs
53 real(kind=kreal) :: unode_tmp(hecmat%NDOF*hecmesh%n_node)
56 integer(kind=kint) :: n_rot, rid, n_nodes, idof
58 real(kind=kreal) :: tval, normal(3), direc(3), ccoord(3), cdisp(3), cdiff(3)
61 call hecmw_mat_clear_b( hecmat )
65 n_rot = fstrsolid%CLOAD_ngrp_rot
68 do ig0 = 1, fstrsolid%CLOAD_ngrp_tot
69 ig = fstrsolid%CLOAD_ngrp_ID(ig0)
70 ityp = fstrsolid%CLOAD_ngrp_DOF(ig0)
71 val = fstrsolid%CLOAD_ngrp_val(ig0)
74 call table_dyn(hecmesh, fstrsolid, fstrdynamic, ig0, f_t, flag_u)
77 is0= hecmesh%node_group%grp_index(ig-1)+1
78 ie0= hecmesh%node_group%grp_index(ig )
80 if( fstrsolid%CLOAD_ngrp_rotID(ig0) > 0 )
then
81 rid = fstrsolid%CLOAD_ngrp_rotID(ig0)
82 if( .not. rinfo%conds(rid)%active )
then
83 rinfo%conds(rid)%active = .true.
84 rinfo%conds(rid)%center_ngrp_id = fstrsolid%CLOAD_ngrp_centerID(ig0)
85 rinfo%conds(rid)%torque_ngrp_id = ig
87 if( ityp>ndof ) ityp = ityp-ndof
88 rinfo%conds(rid)%vec(ityp) = val
93 in = hecmesh%node_group%grp_item(ik)
94 hecmat%B( ndof*(in-1)+ityp ) = hecmat%B( ndof*(in-1)+ityp )+val
100 if( .not. rinfo%conds(rid)%active ) cycle
102 n_nodes = hecmw_ngrp_get_number(hecmesh, rinfo%conds(rid)%torque_ngrp_id)
105 ig = rinfo%conds(rid)%center_ngrp_id
107 ccoord(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, hecmesh%node)
108 cdisp(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, fstrsolid%unode)
110 ccoord(1:ndof) = ccoord(1:ndof) + cdisp(1:ndof)
112 tval = dsqrt(dot_product(rinfo%conds(rid)%vec(1:ndof),rinfo%conds(rid)%vec(1:ndof)))
113 if( tval < 1.d-16 )
then
114 write(*,*)
'###ERROR### : norm of torque vector must be > 0.0'
115 call hecmw_abort( hecmw_comm_get_comm() )
117 normal(1:ndof) = rinfo%conds(rid)%vec(1:ndof)/tval
118 tval = tval/dble(n_nodes)
120 ig = rinfo%conds(rid)%torque_ngrp_id
121 is0 = hecmesh%node_group%grp_index(ig-1) + 1
122 ie0 = hecmesh%node_group%grp_index(ig )
124 in = hecmesh%node_group%grp_item(ik)
125 cdiff(1:ndof) = hecmesh%node(ndof*(in-1)+1:ndof*in)+fstrsolid%unode(ndof*(in-1)+1:ndof*in)-ccoord(1:ndof)
127 val = dot_product(vect(1:ndof),vect(1:ndof))
128 if( val < 1.d-16 )
then
129 write(*,*)
'###ERROR### : torque node is at the same position as that of center node in rotational surface.'
130 call hecmw_abort( hecmw_comm_get_comm() )
132 vect(1:ndof) = (tval/val)*vect(1:ndof)
133 hecmat%B(ndof*(in-1)+1:ndof*in) = hecmat%B(ndof*(in-1)+1:ndof*in)+vect(1:ndof)
141 do ig0 = 1, fstrsolid%DLOAD_ngrp_tot
142 ig = fstrsolid%DLOAD_ngrp_ID(ig0)
143 ltype = fstrsolid%DLOAD_ngrp_LID(ig0)
145 params(i) = fstrsolid%DLOAD_ngrp_params(i,ig0)
148 fg_surf = (ltype == 100)
150 is0 = hecmesh%surf_group%grp_index(ig-1) + 1
151 ie0 = hecmesh%surf_group%grp_index(ig )
153 is0 = hecmesh%elem_group%grp_index(ig-1) + 1
154 ie0 = hecmesh%elem_group%grp_index(ig )
159 ltype = hecmesh%surf_group%grp_item(2*ik)*10
160 icel = hecmesh%surf_group%grp_item(2*ik-1)
161 ic_type = hecmesh%elem_type(icel)
163 icel = hecmesh%elem_group%grp_item(ik)
164 ic_type = hecmesh%elem_type(icel)
167 nn = hecmw_get_max_node(ic_type)
169 is = hecmesh%elem_node_index(icel-1)
171 nodlocal(j) = hecmesh%elem_node_item (is+j)
173 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )
174 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )
175 zz(j) = hecmesh%node( 3*nodlocal(j) )
178 iwk(ndof*(j-1)+i) = ndof*(nodlocal(j)-1)+i
182 isect = hecmesh%section_ID(icel)
184 rho = fstrsolid%elements(icel)%gausses(1)%pMaterial%variables(m_density)
189 id = hecmesh%section%sect_opt(isect)
192 elseif( id == 1 )
then
194 elseif( id == 2 )
then
201 if( ic_type == 241 .or.ic_type == 242 .or. ic_type == 231 .or. ic_type == 232 )
then
202 call dl_c2(ic_type,nn,xx(1:nn),yy(1:nn),rho,pa1,ltype,params,vect(1:nn*ndof),nsize,iset)
204 elseif( ic_type == 341 .or. ic_type == 351 .or. ic_type == 361 .or. &
205 ic_type == 342 .or. ic_type == 352 .or. ic_type == 362 )
then
206 call dl_c3(ic_type,nn,xx(1:nn),yy(1:nn),zz(1:nn),rho,ltype,params,vect(1:nn*ndof),nsize)
208 elseif( ( ic_type == 741 ) .or. ( ic_type == 743 ) .or. ( ic_type == 731 ) )
then
209 call dl_shell(ic_type, nn, ndof, xx, yy, zz, rho, thick, ltype, params, vect, nsize, fstrsolid%elements(icel)%gausses)
210 elseif( ( ic_type==761 ) )
then
211 call dl_shell_33(ic_type, nn, ndof, xx, yy, zz, rho, thick, ltype, params, vect, nsize, &
212 fstrsolid%elements(icel)%gausses)
213 elseif( ( ic_type==781 ) )
then
214 call dl_shell_33(ic_type, nn, ndof, xx, yy, zz, rho, thick, ltype, params, vect, nsize, &
215 fstrsolid%elements(icel)%gausses)
222 call table_dyn(hecmesh, fstrsolid, fstrdynamic, ig0, f_t, flag_u)
224 vect(j) = vect(j)*f_t
229 hecmat%B( iwk(j) )=hecmat%B( iwk(j) )+vect(j)
234 if (
present(iter) )
then
236 do i = 1, ndof*hecmesh%n_node
237 unode_tmp(i) = fstrsolid%unode(i)
240 do ig0 = 1, fstrsolid%BOUNDARY_ngrp_tot
241 ig = fstrsolid%BOUNDARY_ngrp_ID(ig0)
242 rhs = fstrsolid%BOUNDARY_ngrp_val(ig0)
243 ityp = fstrsolid%BOUNDARY_ngrp_type(ig0)
245 idofe = ityp-idofs*10
246 is0 = hecmesh%node_group%grp_index(ig-1) + 1
247 ie0 = hecmesh%node_group%grp_index(ig )
250 in = hecmesh%node_group%grp_item(ik)
251 do idof = idofs, idofe
252 unode_tmp( ndof*(in-1)+idof ) = rhs
257 do itype = 1, hecmesh%n_elem_type
258 ic_type = hecmesh%elem_type_item(itype)
259 if( ic_type == 3414 )
then
260 nn = hecmw_get_max_node(ic_type)
261 if( nn > 20 ) stop
"The number of elemental nodes > 20"
263 is = hecmesh%elem_type_index(itype-1)+1
264 ie = hecmesh%elem_type_index(itype )
266 if(fstrsolid%elements(icel)%gausses(1)%pMaterial%mtype /= incomp_newtonian)
then
267 write(*, *)
'###ERROR### : This element is not supported for this material'
268 write(*, *)
'ic_type = ', ic_type,
', mtype = ', fstrsolid%elements(icel)%gausses(1)%pMaterial%mtype
270 call hecmw_abort(hecmw_comm_get_comm())
275 iis = hecmesh%elem_node_index(icel-1)
277 nodlocal(j) = hecmesh%elem_node_item(iis+j)
280 ecoord(i,j) = hecmesh%node( 3*nodlocal(j)+i-3 )
282 v(i,j) = unode_tmp( ndof*nodlocal(j)+i-ndof )
283 fstrsolid%unode( ndof*nodlocal(j)+i-ndof ) = v(i,j)
285 dv(i,j) = fstrsolid%dunode( ndof*nodlocal(j)+i-ndof )
290 ( ic_type, nn, ecoord(:,1:nn), v(1:4,1:nn), dv(1:4,1:nn), &
291 r(1:nn*ndof), fstrsolid%elements(icel)%gausses(:), &
292 fstrdynamic%t_delta )
296 hecmat%B(ndof*(nodlocal(j)-1)+i) = hecmat%B(ndof*(nodlocal(j)-1)+i)+r(ndof*(j-1)+i)
304 do itype = 1, hecmesh%n_elem_type
305 ic_type = hecmesh%elem_type_item(itype)
306 if( ic_type == 3414 )
then
307 nn = hecmw_get_max_node(ic_type)
308 if( nn > 20 ) stop
"The number of elemental nodes > 20"
309 is = hecmesh%elem_type_index(itype-1)+1
310 ie = hecmesh%elem_type_index(itype )
312 iis = hecmesh%elem_node_index(icel-1)
314 nodlocal(j) = hecmesh%elem_node_item(iis+j)
318 hecmat%B(ndof*(nodlocal(j)-1)+i) = 0.0d0
332 if( fstrsolid%TEMP_ngrp_tot > 0 )
then
334 if( hecmesh%my_rank .eq. 0 )
then
335 write(
imsg,*)
'stop: THERMAL LOAD is not yet available in dynamic analysis!'
337 call hecmw_abort( hecmw_comm_get_comm())
339 allocate ( temp(hecmesh%n_node) )
341 do ig0= 1, fstrsolid%TEMP_ngrp_tot
342 ig= fstrsolid%TEMP_ngrp_ID(ig0)
343 val=fstrsolid%TEMP_ngrp_val(ig0)
345 is0= hecmesh%node_group%grp_index(ig-1) + 1
346 ie0= hecmesh%node_group%grp_index(ig )
348 in = hecmesh%node_group%grp_item(ik)
358 do itype = 1, hecmesh%n_elem_type
360 is = hecmesh%elem_type_index(itype-1)+1
361 ie = hecmesh%elem_type_index(itype )
362 ic_type = hecmesh%elem_type_item(itype)
363 if( hecmw_is_etype_link(ic_type) ) cycle
364 if( hecmw_is_etype_patch(ic_type) ) cycle
366 nn = hecmw_get_max_node(ic_type)
370 is= hecmesh%elem_node_index(icel-1)
372 nodlocal(j)=hecmesh%elem_node_item(is+j)
374 xx(j)=hecmesh%node(3*nodlocal(j)-2)
375 yy(j)=hecmesh%node(3*nodlocal(j)-1)
376 zz(j)=hecmesh%node(3*nodlocal(j) )
377 tt(j)=temp( nodlocal(j) )
381 iwk(ndof*(j-1)+i)=ndof*(nodlocal(j)-1)+i
386 isect= hecmesh%section_ID(icel)
387 cdsys_id = fstrsolid%elements(icel)%gausses(1)%pMaterial%cdsys_ID
388 call get_coordsys( cdsys_id, hecmesh, fstrsolid, coords )
391 if( ndof .eq. 2 )
then
392 id=hecmesh%section%sect_opt(isect)
395 elseif( id.eq.1)
then
397 elseif( id.eq.2)
then
404 if( ic_type == 241 .or. ic_type == 242 .or. ic_type == 231 .or. ic_type == 232 )
then
405 call tload_c2( ic_type, nn, xx(1:nn), yy(1:nn), tt(1:nn), tt0(1:nn), &
406 fstrsolid%elements(icel)%gausses,pa1,iset, vect(1:nn*2) )
408 elseif( ic_type == 361 )
then
409 if( fstrsolid%sections(isect)%elemopt361 ==
kel361fi )
then
411 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
412 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
413 else if( fstrsolid%sections(isect)%elemopt361 ==
kel361bbar )
then
414 call tload_c3d8bbar &
415 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
416 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
417 else if( fstrsolid%sections(isect)%elemopt361 ==
kel361ic )
then
419 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
420 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
421 else if( fstrsolid%sections(isect)%elemopt361 ==
kel361fbar )
then
422 call tload_c3d8fbar &
423 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
424 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
427 elseif (ic_type == 341 .or. ic_type == 351 .or. &
428 ic_type == 342 .or. ic_type == 352 .or. ic_type == 362 )
then
430 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
431 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
433 elseif ( ic_type == 741 .or. ic_type == 743 .or. ic_type == 731 )
then
435 write(
imsg,*)
'*------------------------', &
436 '-------------------*'
437 write(
imsg,*)
' Thermal loading option ', &
439 write(
imsg,*)
'*------------------------', &
440 '-------------------*'
441 call hecmw_abort( hecmw_comm_get_comm())
446 hecmat%B( iwk(j) ) = hecmat%B( iwk(j) )+vect(j)