13 subroutine fstr_addbc(cstep,hecMESH,hecMAT,fstrSOLID,fstrPARAM,hecLagMAT,iter,conMAT,RHSvector)
20 integer,
intent(in) :: cstep
21 type(hecmwst_local_mesh) :: hecMESH
22 type(hecmwst_matrix) :: hecMAT
25 type(hecmwst_matrix_lagrange) :: hecLagMAT
26 integer(kind=kint) :: iter
27 type(hecmwst_matrix),
optional :: conMAT
28 real(kind=kreal),
optional :: rhsvector(:)
30 integer(kind=kint) :: ig0, ig, ityp, idofS, idofE, idof, iS0, iE0, ik, in
31 real(kind=kreal) :: rhs0, rhs, factor, factor0
32 integer(kind=kint) :: ndof, grpid, istot
35 integer(kind=kint) :: n_rot, rid, jj_n_amp
36 type(trotinfo) :: rinfo
37 real(kind=kreal) :: ccoord(3), cdiff(3), cdiff0(3)
38 real(kind=kreal) :: cdisp(3), cddisp(3)
43 n_rot = fstrsolid%BOUNDARY_ngrp_rot
44 if( n_rot > 0 )
call fstr_rotinfo_init(n_rot, rinfo)
47 do ig0 = 1, fstrsolid%BOUNDARY_ngrp_tot
48 grpid = fstrsolid%BOUNDARY_ngrp_GRPID(ig0)
52 jj_n_amp = fstrsolid%BOUNDARY_ngrp_amp(ig0)
53 if( jj_n_amp <= 0 )
then
54 factor0 = fstrsolid%FACTOR(1)
55 factor = fstrsolid%FACTOR(2)
62 factor = factor - factor0
63 if(fstrsolid%step_ctrl(cstep)%amp_default_type==stepampstep)
then
65 if(factor0 < 1.d-10) factor = 1.d0
70 ig = fstrsolid%BOUNDARY_ngrp_ID(ig0)
71 rhs0 = fstrsolid%BOUNDARY_ngrp_val(ig0)
73 ityp = fstrsolid%BOUNDARY_ngrp_type(ig0)
75 idofe = ityp - idofs*10
77 istot = fstrsolid%BOUNDARY_ngrp_istot(ig0)
79 is0 = hecmesh%node_group%grp_index(ig-1) + 1
80 ie0 = hecmesh%node_group%grp_index(ig )
82 if( fstrsolid%BOUNDARY_ngrp_rotID(ig0) > 0 )
then
83 rid = fstrsolid%BOUNDARY_ngrp_rotID(ig0)
84 if( .not. rinfo%conds(rid)%active )
then
85 rinfo%conds(rid)%active = .true.
86 rinfo%conds(rid)%center_ngrp_id = fstrsolid%BOUNDARY_ngrp_centerID(ig0)
87 rinfo%conds(rid)%torque_ngrp_id = ig
93 write(*,*)
'Error: rotational boundary cannot be specified with total value'
94 call hecmw_abort( hecmw_comm_get_comm() )
98 rinfo%conds(rid)%vec(idof-ndof) = rhs
100 rinfo%conds(rid)%vec(idof) = rhs
108 in = hecmesh%node_group%grp_item(ik)
110 do idof = idofs, idofe
111 if( istot == 0 )
then
114 rhs = (rhs0 - fstrsolid%unode_bak(ndof*(in-1)+idof))*factor
116 if(
present(rhsvector))
then
117 rhsvector(ndof*(in-1)+idof) = rhs
121 if(
present(conmat))
then
122 call hecmw_mat_ass_bc(hecmat, in, idof, rhs, conmat)
124 call hecmw_mat_ass_bc(hecmat, in, idof, rhs)
128 if(
present(conmat))
then
129 call hecmw_mat_ass_bc_contactlag(conmat,heclagmat,in,idof,rhs)
131 call hecmw_mat_ass_bc_contactlag(hecmat,heclagmat,in,idof,rhs)
142 if( .not. rinfo%conds(rid)%active ) cycle
147 if( factor > 0.d0 )
then
148 ig = rinfo%conds(rid)%center_ngrp_id
150 ccoord(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, hecmesh%node)
151 cdisp(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, fstrsolid%unode)
152 cddisp(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, hecmat%B)
154 ccoord(1:ndof) = ccoord(1:ndof) + cdisp(1:ndof)
157 ig = rinfo%conds(rid)%torque_ngrp_id
158 is0 = hecmesh%node_group%grp_index(ig-1) + 1
159 ie0 = hecmesh%node_group%grp_index(ig )
161 in = hecmesh%node_group%grp_item(ik)
162 if( factor > 0.d0 )
then
163 cdiff0(1:ndof) = hecmesh%node(ndof*(in-1)+1:ndof*in)+fstrsolid%unode(ndof*(in-1)+1:ndof*in)-ccoord(1:ndof)
164 cdiff(1:ndof) = cdiff0(1:ndof)
168 rhs = cdiff(idof)-cdiff0(idof)+cddisp(idof)
169 if(
present(rhsvector))
then
170 rhsvector(ndof*(in-1)+idof) = rhs
174 if(
present(conmat))
then
175 call hecmw_mat_ass_bc(hecmat, in, idof, rhs, conmat)
177 call hecmw_mat_ass_bc(hecmat, in, idof, rhs)
181 if(
present(conmat))
then
182 call hecmw_mat_ass_bc_contactlag(conmat,heclagmat,in,idof,rhs)
184 call hecmw_mat_ass_bc_contactlag(hecmat,heclagmat,in,idof,rhs)
190 if( n_rot > 0 )
call fstr_rotinfo_finalize(rinfo)
198 do ig0=1,fstrsolid%n_fix_mpc
199 if( fstrsolid%mpc_const(ig0) == 0.d0 ) cycle
201 rhs = fstrsolid%mpc_const(ig0)*factor
202 hecmesh%mpc%mpc_const(ig0) = rhs
This module provides a function to deal with prescribed displacement.
subroutine fstr_addbc(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, hecLagMAT, iter, conMAT, RHSvector)
Add Essential Boundary Conditions.
This module provides functions to deal with time and increment of stress analysis.
real(kind=kreal) function fstr_get_timeinc()
real(kind=kreal) function fstr_get_time()
This module defines common data and basic structures for analysis.
subroutine fstr_get_amplitude(hecMESH, fstrSOLID, cstep, jj_n_amp, time, value)
Evaluate the amplitude-scaled target value a(t) for static analysis.
integer(kind=kint), parameter kcaslagrange
contact analysis algorithm
integer(kind=kint), parameter kststatic
logical function fstr_isboundaryactive(fstrSOLID, nbc, cstep)
This module provide common functions of 3D truss elements.
subroutine truss_diag_modify(hecMAT, hecMESH)
This module provides aux functions.
subroutine rotate_3dvector_by_rodrigues_formula(r, v)
FSTR INNER CONTROL PARAMETERS (fstrPARAM)