32 integer(kind=kint),
intent(in) :: cstep
33 type(hecmwst_local_mesh),
intent(in) :: hecmesh
34 type(hecmwst_matrix),
intent(inout) :: hecmat
36 type(hecmwst_matrix),
intent(inout),
optional :: conmat
38 integer(kind=kint) :: ndof, idof
39 real(kind=kreal) :: factor
41 factor = fstrsolid%factor(2)
44 do idof=1, hecmesh%n_node* hecmesh%n_dof
45 hecmat%B(idof)=fstrsolid%GL(idof)-fstrsolid%QFORCE(idof)
62 call hecmw_update_r(hecmesh,hecmat%B,hecmesh%n_node, ndof)
67 type(hecmwst_local_mesh),
intent(in) :: hecmesh
68 real(kind=kreal),
intent(inout) :: b(:)
70 integer(kind=kint) ndof, ig0, is0, ie0, ik, in, idof
71 real(kind=kreal) :: rhs, lambda
74 outer:
do ig0=1,hecmesh%mpc%n_mpc
75 is0= hecmesh%mpc%mpc_index(ig0-1)+1
76 ie0= hecmesh%mpc%mpc_index(ig0)
78 if (hecmesh%mpc%mpc_dof(ik) > ndof) cycle outer
81 in = hecmesh%mpc%mpc_item(is0)
82 idof = hecmesh%mpc%mpc_dof(is0)
83 rhs = hecmesh%mpc%mpc_val(is0)
84 lambda = b(ndof*(in-1)+idof)/rhs
87 in = hecmesh%mpc%mpc_item(ik)
88 idof = hecmesh%mpc%mpc_dof(ik)
89 rhs = hecmesh%mpc%mpc_val(ik)
90 b(ndof*(in-1)+idof) = b(ndof*(in-1)+idof) - rhs*lambda
97 integer(kind=kint),
intent(in) :: cstep
98 type(hecmwst_local_mesh),
intent(in) :: hecmesh
100 real(kind=kreal),
intent(inout) :: b(:)
102 integer(kind=kint) ndof, ig0, ig, ityp, is0, ie0, ik, in, idof1, idof2, idof
103 integer(kind=kint) :: grpid
108 do ig0= 1, fstrsolid%BOUNDARY_ngrp_tot
109 grpid = fstrsolid%BOUNDARY_ngrp_GRPID(ig0)
111 ig= fstrsolid%BOUNDARY_ngrp_ID(ig0)
112 ityp= fstrsolid%BOUNDARY_ngrp_type(ig0)
113 is0= hecmesh%node_group%grp_index(ig-1) + 1
114 ie0= hecmesh%node_group%grp_index(ig )
116 in = hecmesh%node_group%grp_item(ik)
118 idof2 = ityp - idof1*10
119 if( fstrsolid%BOUNDARY_ngrp_rotID(ig0) > 0 )
then
124 b( ndof*(in-1) + idof ) = 0.d0
137 integer(kind=kint),
intent(in) :: cstep
138 type(hecmwst_local_mesh),
intent(in) :: hecmesh
141 integer(kind=kint) :: ndof, ig0, ig, ityp, is0, ie0, ik, in, idof1, idof2, idof
142 integer(kind=kint) :: grpid
145 fstrsolid%REACTION = 0.d0
148 do ig0= 1, fstrsolid%BOUNDARY_ngrp_tot
149 grpid = fstrsolid%BOUNDARY_ngrp_GRPID(ig0)
151 ig= fstrsolid%BOUNDARY_ngrp_ID(ig0)
152 ityp= fstrsolid%BOUNDARY_ngrp_type(ig0)
153 is0= hecmesh%node_group%grp_index(ig-1) + 1
154 ie0= hecmesh%node_group%grp_index(ig )
156 in = hecmesh%node_group%grp_item(ik)
158 idof2 = ityp - idof1*10
159 if( fstrsolid%BOUNDARY_ngrp_rotID(ig0) > 0 )
then
164 fstrsolid%REACTION(ndof*(in-1)+idof) = fstrsolid%QFORCE(ndof*(in-1)+idof)
166 if(
associated(fstrsolid%EMBED_NFORCE) ) fstrsolid%REACTION(ndof*(in-1)+idof) = &
167 & fstrsolid%QFORCE(ndof*(in-1)+idof) - fstrsolid%EMBED_NFORCE(ndof*(in-1)+idof)
173 if( fstrsolid%VELOCITY_type /=
kbcinitial )
then
174 do ig0= 1, fstrsolid%VELOCITY_ngrp_tot
175 grpid = fstrsolid%VELOCITY_ngrp_GRPID(ig0)
177 ig= fstrsolid%VELOCITY_ngrp_ID(ig0)
178 ityp= fstrsolid%VELOCITY_ngrp_type(ig0)
179 is0= hecmesh%node_group%grp_index(ig-1) + 1
180 ie0= hecmesh%node_group%grp_index(ig )
182 idof2 = ityp - idof1*10
184 in = hecmesh%node_group%grp_item(ik)
186 fstrsolid%REACTION(ndof*(in-1)+idof) = fstrsolid%QFORCE(ndof*(in-1)+idof)
193 if( fstrsolid%ACCELERATION_type /=
kbcinitial )
then
194 do ig0= 1, fstrsolid%ACCELERATION_ngrp_tot
195 grpid = fstrsolid%ACCELERATION_ngrp_GRPID(ig0)
197 ig= fstrsolid%ACCELERATION_ngrp_ID(ig0)
198 ityp= fstrsolid%ACCELERATION_ngrp_type(ig0)
199 is0= hecmesh%node_group%grp_index(ig-1) + 1
200 ie0= hecmesh%node_group%grp_index(ig )
202 idof2 = ityp - idof1*10
204 in = hecmesh%node_group%grp_item(ik)
206 fstrsolid%REACTION(ndof*(in-1)+idof) = fstrsolid%QFORCE(ndof*(in-1)+idof)
219 integer,
intent(in) :: cstep
220 type (hecmwST_local_mesh) :: hecMESH
221 type (hecmwST_matrix) :: hecMAT
222 type (fstr_solid) :: fstrSOLID
223 real(kind=kreal),
intent(in) :: ctime
224 real(kind=kreal),
intent(in) :: dtime
225 type (fstr_param) :: fstrPARAM
226 real(kind=kreal),
intent(in) :: tincr
227 integer(kind=kint) :: iter
230 call fstr_updatenewton(hecmesh, hecmat, fstrsolid, fstrparam, ctime, tincr, iter)
233 if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
234 &
call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam )
237 if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 )
then
250 integer,
intent(in) :: cstep
251 type (hecmwST_local_mesh) :: hecMESH
252 type (hecmwST_matrix) :: hecMAT
253 type (fstr_solid) :: fstrSOLID
254 real(kind=kreal),
intent(in) :: ctime
255 real(kind=kreal),
intent(in) :: dtime
256 type (fstr_param) :: fstrPARAM
257 real(kind=kreal),
intent(in) :: tincr
258 integer(kind=kint) :: iter
261 real(kind=kreal) :: dunode_bak(hecmat%ndof*hecmesh%n_node)
262 real(kind=kreal),
allocatable :: shell_dtriad_bak(:), shell_ddrill_bak(:)
264 do i=1, hecmat%ndof*hecmesh%n_node
265 dunode_bak(i) = fstrsolid%dunode(i)
267 if(
associated(fstrsolid%shell_dtriad) )
then
268 allocate(shell_dtriad_bak(
size(fstrsolid%shell_dtriad)))
269 shell_dtriad_bak(:) = fstrsolid%shell_dtriad(:)
271 if(
associated(fstrsolid%shell_ddrill) )
then
272 allocate(shell_ddrill_bak(
size(fstrsolid%shell_ddrill)))
273 shell_ddrill_bak(:) = fstrsolid%shell_ddrill(:)
277 do i=1, hecmat%ndof*hecmesh%n_node
278 fstrsolid%dunode(i) = dunode_bak(i)
280 if(
allocated(shell_dtriad_bak) )
then
281 fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
282 deallocate(shell_dtriad_bak)
284 if(
allocated(shell_ddrill_bak) )
then
285 fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
286 deallocate(shell_ddrill_bak)
293 real(kind=kreal),
intent(in) :: force(:), displacement(:)
294 type(hecmwst_local_mesh),
intent(in) :: hecmesh
297 call hecmw_innerproduct_r(hecmesh, ndof, force, displacement,
fstr_get_energy)
307 type(hecmwst_matrix),
intent(in) :: hecmat
308 type(hecmwst_matrix_lagrange),
intent(in) :: heclagmat
309 type(hecmwst_matrix),
intent(in) :: conmat
310 type(hecmwst_local_mesh),
intent(in) :: hecmesh
311 real(kind=kreal),
intent(out) :: resid_vec(:)
312 integer(kind=kint),
intent(out) :: nresid
314 integer(kind=kint) :: i, ndof, nndof, npndof, num_lagrange
317 nndof = conmat%N * ndof
318 npndof = conmat%NP * ndof
319 num_lagrange = heclagmat%num_lagrange
320 nresid = nndof + num_lagrange
324 resid_vec(i) = conmat%B(i)
326 call hecmw_assemble_r(hecmesh, resid_vec, conmat%NP, conmat%NDOF)
330 resid_vec(i) = resid_vec(i) + hecmat%B(i)
334 do i = 1, num_lagrange
335 resid_vec(nndof + i) = conmat%B(npndof + i)
345 integer(kind=kint),
intent(in) :: cstep
346 type(hecmwst_local_mesh),
intent(in) :: hecmesh
347 type(hecmwst_matrix),
intent(inout) :: hecmat
349 integer(kind=kint),
intent(in) :: ptype
350 real(kind=kreal) :: potential
352 integer(kind=kint) :: ndof, i, icel, icel0, ig
353 real(kind=kreal),
allocatable :: totload(:)
354 real(kind=kreal) :: factor
355 real(kind=kreal) :: extenal_work, internal_work
358 factor = fstrsolid%factor(2)
361 allocate(totload(ndof*hecmesh%n_node))
364 do i=1,ndof*hecmesh%n_node
365 totload(i) = 0.5d0*(fstrsolid%GL(i)+fstrsolid%GL0(i))
374 if( ptype == 1 )
then
377 do icel0=1,hecmesh%ne_internal
378 icel=hecmesh%elem_internal_list(icel0)
379 do ig=1,
size(fstrsolid%elements(icel)%gausses)
380 internal_work = internal_work + fstrsolid%elements(icel)%gausses(ig)%strain_energy
383 call hecmw_allreduce_r1(hecmesh, internal_work, hecmw_sum)
385 call hecmw_innerproduct_r(hecmesh,ndof,totload,fstrsolid%dunode,extenal_work)
386 potential = internal_work - extenal_work
387 else if( ptype == 2 )
then
389 call hecmw_innerproduct_r(hecmesh,ndof,0.5d0*(fstrsolid%QFORCE+fstrsolid%QFORCE_bak),fstrsolid%dunode,internal_work)
391 call hecmw_innerproduct_r(hecmesh,ndof,totload,fstrsolid%dunode,extenal_work)
392 potential = internal_work - extenal_work
393 else if( ptype == 3 )
then
395 totload(:) = fstrsolid%QFORCE(:) - totload(:)
399 call hecmw_innerproduct_r(hecmesh,ndof,totload,totload,potential)
400 potential = dsqrt(potential)
402 stop
"ptype error in fstr_get_potential"
413 integer(kind=kint),
intent(in) :: cstep
414 type(hecmwst_local_mesh),
intent(in) :: hecmesh
415 type(hecmwst_matrix),
intent(inout) :: hecmat
417 integer(kind=kint),
intent(in) :: ptype
418 real(kind=kreal) :: potential
421 real(kind=kreal) :: dunode_bak(hecmat%ndof*hecmesh%n_node)
422 real(kind=kreal),
allocatable :: shell_dtriad_bak(:), shell_ddrill_bak(:)
424 do i=1, hecmat%ndof*hecmesh%n_node
425 dunode_bak(i) = fstrsolid%dunode(i)
427 if(
associated(fstrsolid%shell_dtriad) )
then
428 allocate(shell_dtriad_bak(
size(fstrsolid%shell_dtriad)))
429 shell_dtriad_bak(:) = fstrsolid%shell_dtriad(:)
431 if(
associated(fstrsolid%shell_ddrill) )
then
432 allocate(shell_ddrill_bak(
size(fstrsolid%shell_ddrill)))
433 shell_ddrill_bak(:) = fstrsolid%shell_ddrill(:)
437 do i=1, hecmat%ndof*hecmesh%n_node
438 fstrsolid%dunode(i) = dunode_bak(i)
440 if(
allocated(shell_dtriad_bak) )
then
441 fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
442 deallocate(shell_dtriad_bak)
444 if(
allocated(shell_ddrill_bak) )
then
445 fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
446 deallocate(shell_ddrill_bak)
451 restrt_step_num, sub_step, ctime, dtime, iter, tincr )
454 integer,
intent(in) :: cstep
455 type (hecmwST_local_mesh) :: hecMESH
456 type (hecmwST_matrix) :: hecMAT
457 type (fstr_solid) :: fstrSOLID
458 integer,
intent(in) :: sub_step
459 real(kind=kreal),
intent(in) :: ctime
460 real(kind=kreal),
intent(in) :: dtime
461 type (fstr_param) :: fstrPARAM
462 integer(kind=kint) :: restrt_step_num
464 integer(kind=kint) :: iter, i
465 integer(kind=kint),
parameter :: ntot = 30
466 real(kind=kreal) :: tincr, alpha, dulen
467 real(kind=kreal) :: pot(3)
468 real(kind=kreal),
allocatable :: dunode_bak(:)
469 real(kind=kreal),
allocatable :: shell_dtriad_bak(:), shell_ddrill_bak(:)
471 dulen = dsqrt(dot_product(fstrsolid%dunode(:),fstrsolid%dunode(:)))
472 write(
imsg,*)
"dulen",dulen
474 allocate(dunode_bak(
size(fstrsolid%dunode)))
475 do i=1, hecmat%ndof*hecmesh%n_node
476 dunode_bak(i) = fstrsolid%dunode(i)
478 if(
associated(fstrsolid%shell_dtriad) )
then
479 allocate(shell_dtriad_bak(
size(fstrsolid%shell_dtriad)))
480 shell_dtriad_bak(:) = fstrsolid%shell_dtriad(:)
482 if(
associated(fstrsolid%shell_ddrill) )
then
483 allocate(shell_ddrill_bak(
size(fstrsolid%shell_ddrill)))
484 shell_ddrill_bak(:) = fstrsolid%shell_ddrill(:)
488 alpha = 5.d-3*dble(i)/dble(ntot)
489 hecmat%X(:) = alpha*fstrsolid%dunode(:)
490 fstrsolid%dunode(:) = dunode_bak(:)
491 if(
allocated(shell_dtriad_bak) ) fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
492 if(
allocated(shell_ddrill_bak) ) fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
498 write(
imsg,
'(I4,5(",",1pE16.9))') i,alpha,alpha*dulen,pot(1:3)
501 do i=1,
size(fstrsolid%dunode)
502 fstrsolid%dunode(i) = dunode_bak(i)
504 if(
allocated(shell_dtriad_bak) )
then
505 fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
506 deallocate(shell_dtriad_bak)
508 if(
allocated(shell_ddrill_bak) )
then
509 fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
510 deallocate(shell_ddrill_bak)
This module provides functions to take into account external load.
subroutine fstr_ass_load(cstep, ctime, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
This subroutine assmble following external force into fstrSOLIDGL and hecMATB afterwards.
This module provide a function to elemact elements.
subroutine fstr_update_elemact_solid_by_value(hecMESH, fstrSOLID, cstep, ctime)
Finite-rotation nodal kinematics for NLGEOM.
subroutine, public fstr_apply_solution_increment(hecMESH, fstrSOLID, ndof, x)
Apply the linear-solver solution increment x to the step displacement dunode.
This module provides function to calculate residual of nodal force.
subroutine, public fstr_update_ndforce_spc(cstep, hecMESH, fstrSOLID, B)
subroutine, public fstr_update_ndforce(cstep, hecMESH, hecMAT, fstrSOLID, conMAT)
subroutine plot_potential_graph(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, restrt_step_num, sub_step, ctime, dtime, iter, tincr)
real(kind=kreal) function, public fstr_get_potential(cstep, hecMESH, hecMAT, fstrSOLID, ptype)
subroutine fstr_calc_residual_vector(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
\breaf This subroutine calculate residual vector
subroutine fstr_calc_residual_vector_with_x(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
\breaf This subroutine calculate residual vector
real(kind=kreal) function fstr_get_potential_with_x(cstep, hecMESH, hecMAT, fstrSOLID, ptype)
real(kind=kreal) function fstr_get_energy(force, displacement, hecMESH)
Calculate magnitude of a real vector.
subroutine, public fstr_update_ndforce_mpc(hecMESH, B)
subroutine, public fstr_assemble_residual_contact(hecMAT, hecLagMAT, conMAT, hecMESH, resid_vec, nresid)
Assemble contact residual vector (hecMATB + conMATB + Lagrange) into a single vector.
subroutine, public fstr_update_reaction_spc(cstep, hecMESH, fstrSOLID)
Set fstrSOLIDREACTION at constrained DOFs using current fstrSOLIDQFORCE. Constrained DOFs are enumera...
This module provides functions to deal with spring force.
subroutine fstr_update_ndforce_spring(cstep, hecMESH, fstrSOLID, B)
This module provides function to calculate to do updates.
subroutine fstr_updatenewton(hecMESH, hecMAT, fstrSOLID, fstrPARAM, time, tincr, iter, strainEnergy)
Update displacement, stress, strain and internal forces.
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter imsg
integer(kind=kint), parameter kbcinitial
logical function fstr_isboundaryactive(fstrSOLID, nbc, cstep)
This subroutine read in used-defined loading tangent.
subroutine uresidual(cstep, factor, residual)
This subroutine take consider of user-defined external loading.