18 subroutine fstr_ass_load(cstep, ctime, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
30 integer(kind=kint),
intent(in) :: cstep
31 real(kind=kreal),
intent(in) :: ctime
32 type(hecmwst_matrix),
intent(inout) :: hecmat
33 type(hecmwst_local_mesh),
intent(in) :: hecMESH
37 real(kind=kreal) :: xx(20), yy(20), zz(20)
38 real(kind=kreal) :: params(0:6)
39 real(kind=kreal) :: vect(60)
40 integer(kind=kint) :: iwk(60)
41 integer(kind=kint) :: nodLocal(20)
42 real(kind=kreal) :: tt(20), tt0(20), coords(3, 3), factor
43 integer(kind=kint) :: ndof, ig0, ig, ityp, ltype, iS0, iE0, ik, in, i, j
44 integer(kind=kint) :: icel, ic_type, nn, is, isect, id, iset, nsize
45 integer(kind=kint) :: itype, iE, ierror, grpid, cdsys_ID, jj_n_amp
46 real(kind=kreal) :: fval, rho, thick, pa1
48 integer(kind=kint) :: tstep
49 type(tmaterial),
pointer :: material
50 integer(kind=kint) :: ihead
54 integer(kind=kint) :: n_rot, rid, n_nodes, idof
56 real(kind=kreal) :: tval, normal(3), direc(3), ccoord(3), cdisp(3), cdiff(3)
63 n_rot = fstrsolid%CLOAD_ngrp_rot
66 fstrsolid%GL(:) = 0.0d0
67 fstrsolid%EFORCE(:) = 0.0d0
68 do ig0 = 1, fstrsolid%CLOAD_ngrp_tot
69 grpid = fstrsolid%CLOAD_ngrp_GRPID(ig0)
71 jj_n_amp = fstrsolid%CLOAD_ngrp_amp(ig0)
72 if( jj_n_amp <= 0 )
then
73 factor = fstrsolid%FACTOR(2)
75 call table_amp(hecmesh,fstrsolid,cstep,jj_n_amp,ctime,factor)
79 ig = fstrsolid%CLOAD_ngrp_ID(ig0)
80 ityp = fstrsolid%CLOAD_ngrp_DOF(ig0)
81 fval = fstrsolid%CLOAD_ngrp_val(ig0)
82 is0 = hecmesh%node_group%grp_index(ig-1) + 1
83 ie0 = hecmesh%node_group%grp_index(ig )
85 if( fstrsolid%CLOAD_ngrp_rotID(ig0) > 0 )
then
86 rid = fstrsolid%CLOAD_ngrp_rotID(ig0)
87 if( .not. rinfo%conds(rid)%active )
then
88 rinfo%conds(rid)%active = .true.
89 rinfo%conds(rid)%center_ngrp_id = fstrsolid%CLOAD_ngrp_centerID(ig0)
90 rinfo%conds(rid)%torque_ngrp_id = ig
92 if( ityp>ndof ) ityp = ityp-ndof
93 rinfo%conds(rid)%vec(ityp) = factor*fval
98 in = hecmesh%node_group%grp_item(ik)
99 fstrsolid%GL(ndof*(in-1)+ityp) = fstrsolid%GL(ndof*(in-1)+ityp)+factor*fval
105 if( .not. rinfo%conds(rid)%active ) cycle
107 n_nodes = hecmw_ngrp_get_number(hecmesh, rinfo%conds(rid)%torque_ngrp_id)
110 ig = rinfo%conds(rid)%center_ngrp_id
112 ccoord(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, hecmesh%node)
113 cdisp(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, fstrsolid%unode)
114 cdisp(idof) = cdisp(idof) + hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, fstrsolid%dunode)
116 ccoord(1:ndof) = ccoord(1:ndof) + cdisp(1:ndof)
118 tval = dsqrt(dot_product(rinfo%conds(rid)%vec(1:ndof),rinfo%conds(rid)%vec(1:ndof)))
119 if( tval < 1.d-16 )
then
120 write(*,*)
'###ERROR### : norm of torque vector must be > 0.0'
121 call hecmw_abort( hecmw_comm_get_comm() )
123 normal(1:ndof) = rinfo%conds(rid)%vec(1:ndof)/tval
124 tval = tval/dble(n_nodes)
126 ig = rinfo%conds(rid)%torque_ngrp_id
127 is0 = hecmesh%node_group%grp_index(ig-1) + 1
128 ie0 = hecmesh%node_group%grp_index(ig )
130 in = hecmesh%node_group%grp_item(ik)
131 cdiff(1:ndof) = hecmesh%node(ndof*(in-1)+1:ndof*in)+fstrsolid%unode(ndof*(in-1)+1:ndof*in) &
132 & +fstrsolid%dunode(ndof*(in-1)+1:ndof*in)-ccoord(1:ndof)
134 fval = dot_product(vect(1:ndof),vect(1:ndof))
135 if( fval < 1.d-16 )
then
136 write(*,*)
'###ERROR### : torque node is at the same position as that of center node in rotational surface.'
137 call hecmw_abort( hecmw_comm_get_comm() )
139 vect(1:ndof) = (tval/fval)*vect(1:ndof)
140 fstrsolid%GL(ndof*(in-1)+1:ndof*in) = fstrsolid%GL(ndof*(in-1)+1:ndof*in)+vect(1:ndof)
148 do ig0 = 1, fstrsolid%DLOAD_ngrp_tot
149 grpid = fstrsolid%DLOAD_ngrp_GRPID(ig0)
151 jj_n_amp = fstrsolid%DLOAD_ngrp_amp(ig0)
152 if( jj_n_amp <= 0 )
then
153 factor = fstrsolid%FACTOR(2)
155 call table_amp(hecmesh,fstrsolid,cstep,jj_n_amp,ctime,factor)
159 ig = fstrsolid%DLOAD_ngrp_ID(ig0)
160 ltype = fstrsolid%DLOAD_ngrp_LID(ig0)
162 params(i)= fstrsolid%DLOAD_ngrp_params(i,ig0)
165 fg_surf = (ltype == 100)
167 is0 = hecmesh%surf_group%grp_index(ig-1) + 1
168 ie0 = hecmesh%surf_group%grp_index(ig )
170 is0 = hecmesh%elem_group%grp_index(ig-1) + 1
171 ie0 = hecmesh%elem_group%grp_index(ig )
175 ltype = hecmesh%surf_group%grp_item(2*ik)*10
176 icel = hecmesh%surf_group%grp_item(2*ik-1)
177 ic_type = hecmesh%elem_type(icel)
179 icel = hecmesh%elem_group%grp_item(ik)
180 ic_type = hecmesh%elem_type(icel)
182 if( hecmw_is_etype_link(ic_type) ) cycle
183 if( hecmw_is_etype_patch(ic_type) ) cycle
185 nn = hecmw_get_max_node(ic_type)
187 is = hecmesh%elem_node_index(icel-1)
188 if( fstrsolid%DLOAD_follow == 0 )
then
190 nodlocal(j) = hecmesh%elem_node_item (is+j)
192 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )
193 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )
194 zz(j) = hecmesh%node( 3*nodlocal(j) )
197 iwk( ndof*(j-1)+i ) = ndof*( nodlocal(j)-1 )+i
202 nodlocal(j) = hecmesh%elem_node_item (is+j)
205 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )+fstrsolid%unode( 2*nodlocal(j)-1 )+fstrsolid%dunode( 2*nodlocal(j)-1 )
206 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )+fstrsolid%unode( 2*nodlocal(j) )+fstrsolid%dunode( 2*nodlocal(j) )
207 else if (ndof==3)
then
208 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )+fstrsolid%unode( 3*nodlocal(j)-2 )+fstrsolid%dunode( 3*nodlocal(j)-2 )
209 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )+fstrsolid%unode( 3*nodlocal(j)-1 )+fstrsolid%dunode( 3*nodlocal(j)-1 )
210 zz(j) = hecmesh%node( 3*nodlocal(j) )+fstrsolid%unode( 3*nodlocal(j) )+fstrsolid%dunode( 3*nodlocal(j) )
211 else if (ndof==6)
then
212 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )+fstrsolid%unode( 6*nodlocal(j)-5 )+fstrsolid%dunode( 6*nodlocal(j)-5 )
213 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )+fstrsolid%unode( 6*nodlocal(j)-4 )+fstrsolid%dunode( 6*nodlocal(j)-4 )
214 zz(j) = hecmesh%node( 3*nodlocal(j) )+fstrsolid%unode( 6*nodlocal(j)-3 )+fstrsolid%dunode( 6*nodlocal(j)-3 )
218 iwk( ndof*(j-1)+i ) = ndof*( nodlocal(j)-1 )+i
223 isect = hecmesh%section_ID(icel)
225 material => fstrsolid%elements(icel)%gausses(1)%pMaterial
226 rho = material%variables(m_density)
230 id=hecmesh%section%sect_opt(isect)
233 else if( id == 1 )
then
235 else if( id == 2)
then
241 if (ic_type==301)
then
242 ihead = hecmesh%section%sect_R_index(isect-1)
243 call dl_c1(ic_type,nn,xx(1:nn),yy(1:nn),zz(1:nn),rho,thick,ltype,params,vect(1:nn*ndof),nsize)
245 elseif( ic_type == 241 .or. ic_type == 242 .or. ic_type == 231 .or. ic_type == 232 .or. ic_type == 2322 )
then
246 call dl_c2(ic_type,nn,xx(1:nn),yy(1:nn),rho,pa1,ltype,params,vect(1:nn*ndof),nsize,iset)
248 else if ( ic_type == 341 .or. ic_type == 351 .or. ic_type == 361 .or. &
249 ic_type == 342 .or. ic_type == 352 .or. ic_type == 362 )
then
250 call dl_c3(ic_type,nn,xx(1:nn),yy(1:nn),zz(1:nn),rho,ltype,params,vect(1:nn*ndof),nsize)
252 else if ( ic_type == 641 )
then
253 ihead = hecmesh%section%sect_R_index(isect-1)
254 call dl_beam_641(ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), rho, ltype, params, &
255 hecmesh%section%sect_R_item(ihead+1:), vect(1:nn*ndof), nsize)
257 else if( ( ic_type == 741 ) .or. ( ic_type == 743 ) .or. ( ic_type == 731 ) )
then
258 call dl_shell(ic_type, nn, ndof, xx, yy, zz, rho, thick, ltype, params, vect, nsize, fstrsolid%elements(icel)%gausses)
260 else if( ( ic_type==761 ) .or. ( ic_type==781 ) )
then
261 call dl_shell_33(ic_type, nn, ndof, xx, yy, zz, rho, thick, ltype, params, vect, nsize, &
262 fstrsolid%elements(icel)%gausses)
266 write(*,*)
"### WARNING: DLOAD",ic_type
271 fstrsolid%GL( iwk(j) )=fstrsolid%GL( iwk(j) )+factor*vect(j)
277 call uloading( cstep, factor, fstrsolid%GL )
282 call hecmw_update_r (hecmesh,fstrsolid%GL,hecmesh%n_node, hecmesh%n_dof)
284 call hecmw_mat_clear_b( hecmat )
285 do i=1, hecmesh%n_node* hecmesh%n_dof
286 hecmat%B(i)=fstrsolid%GL(i)-fstrsolid%QFORCE(i)
289 do i=1, hecmat%NDOF*hecmat%NP
291 fstrsolid%EFORCE(i) = fstrsolid%GL(i)
300 if( fstrsolid%TEMP_ngrp_tot > 0 .or. fstrsolid%TEMP_irres > 0 )
then
301 do ig0 = 1, fstrsolid%TEMP_ngrp_tot
302 grpid = fstrsolid%TEMP_ngrp_GRPID(ig0)
304 factor = fstrsolid%factor(2)
306 ig = fstrsolid%TEMP_ngrp_ID(ig0)
307 fval =fstrsolid%TEMP_ngrp_val(ig0)
308 is0 = hecmesh%node_group%grp_index(ig-1)+1
309 ie0 = hecmesh%node_group%grp_index(ig )
311 in = hecmesh%node_group%grp_item(ik)
312 pa1 = fstrsolid%temp_bak( in )
313 fstrsolid%temperature( in ) = pa1+(fval-pa1)*factor
317 if( fstrsolid%TEMP_irres > 0 )
then
319 & fstrsolid%TEMP_rtype, fstrsolid%TEMP_interval, fstrsolid%TEMP_factor, ctime, &
320 & fstrsolid%temperature, fstrsolid%temp_bak)
324 do itype = 1, hecmesh%n_elem_type
326 is = hecmesh%elem_type_index(itype-1)+1
327 ie = hecmesh%elem_type_index(itype )
328 ic_type = hecmesh%elem_type_item(itype)
329 if( hecmw_is_etype_link(ic_type) ) cycle
330 if( hecmw_is_etype_patch(ic_type) ) cycle
332 nn = hecmw_get_max_node(ic_type)
338 is= hecmesh%elem_node_index(icel-1)
340 nodlocal(j)=hecmesh%elem_node_item(is+j)
343 xx(j)=hecmesh%node(3*nodlocal(j)-2)+fstrsolid%unode(ndof*nodlocal(j)-1)
344 yy(j)=hecmesh%node(3*nodlocal(j)-1)+fstrsolid%unode(ndof*nodlocal(j) )
345 else if (ndof==3)
then
346 xx(j)=hecmesh%node(3*nodlocal(j)-2)+fstrsolid%unode(ndof*nodlocal(j)-2)
347 yy(j)=hecmesh%node(3*nodlocal(j)-1)+fstrsolid%unode(ndof*nodlocal(j)-1)
348 zz(j)=hecmesh%node(3*nodlocal(j) )+fstrsolid%unode(ndof*nodlocal(j))
350 tt0(j)=fstrsolid%last_temp( nodlocal(j) )
351 tt(j) = fstrsolid%temperature( nodlocal(j) )
354 iwk(ndof*(j-1)+i)=ndof*(nodlocal(j)-1)+i
359 isect= hecmesh%section_ID(icel)
360 cdsys_id = hecmesh%section%sect_orien_ID(isect)
364 id=hecmesh%section%sect_opt(isect)
367 else if( id == 1 )
then
369 else if( id == 2 )
then
375 if( ic_type == 641 )
then
377 isect= hecmesh%section_ID(icel)
378 ihead = hecmesh%section%sect_R_index(isect-1)
380 call tload_beam_641( ic_type, nn, ndof, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
381 fstrsolid%elements(icel)%gausses, hecmesh%section%sect_R_item(ihead+1:), &
385 hecmat%B( iwk(j) ) = hecmat%B( iwk(j) )+vect(j)
391 if(ic_type == 241 .or. ic_type == 242 .or. ic_type == 231 .or. ic_type == 232 )
then
392 call tload_c2( ic_type, nn, xx(1:nn), yy(1:nn), tt(1:nn), tt0(1:nn), &
393 fstrsolid%elements(icel)%gausses,pa1, iset, vect(1:nn*2) )
395 else if( ic_type == 361 )
then
396 if( fstrsolid%sections(isect)%elemopt361 ==
kel361fi )
then
398 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
399 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
400 else if( fstrsolid%sections(isect)%elemopt361 ==
kel361bbar )
then
401 call tload_c3d8bbar &
402 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
403 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
404 else if( fstrsolid%sections(isect)%elemopt361 ==
kel361ic )
then
406 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
407 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
408 else if( fstrsolid%sections(isect)%elemopt361 ==
kel361fbar )
then
409 call tload_c3d8fbar &
410 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
411 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
414 else if( ic_type == 341 .or. ic_type == 351 .or. &
415 ic_type == 342 .or. ic_type == 352 .or. ic_type == 362 )
then
417 ( ic_type, nn, xx(1:nn), yy(1:nn), zz(1:nn), tt(1:nn), tt0(1:nn), &
418 fstrsolid%elements(icel)%gausses, vect(1:nn*ndof), cdsys_id, coords )
420 else if( ic_type == 741 .or. ic_type == 743 .or. ic_type == 731 )
then
422 write(
imsg,*)
'*------------------------', &
423 '-------------------*'
424 write(
imsg,*)
' Thermal loading option for shell elements', &
426 write(
imsg,*)
'*------------------------', &
427 '-------------------*'
428 call hecmw_abort( hecmw_comm_get_comm())
436 hecmat%B( iwk(j) ) = hecmat%B( iwk(j) )+vect(j)