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)
60 factor = factor - factor0
61 if(fstrsolid%step_ctrl(cstep)%solution==stepvisco)
then
63 if(factor0 < 1.d-10) factor = 1.d0
68 ig = fstrsolid%BOUNDARY_ngrp_ID(ig0)
69 rhs0 = fstrsolid%BOUNDARY_ngrp_val(ig0)
71 ityp = fstrsolid%BOUNDARY_ngrp_type(ig0)
73 idofe = ityp - idofs*10
75 istot = fstrsolid%BOUNDARY_ngrp_istot(ig0)
77 is0 = hecmesh%node_group%grp_index(ig-1) + 1
78 ie0 = hecmesh%node_group%grp_index(ig )
80 if( fstrsolid%BOUNDARY_ngrp_rotID(ig0) > 0 )
then
81 rid = fstrsolid%BOUNDARY_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%BOUNDARY_ngrp_centerID(ig0)
85 rinfo%conds(rid)%torque_ngrp_id = ig
91 write(*,*)
'Error: rotational boundary cannot be specified with total value'
92 call hecmw_abort( hecmw_comm_get_comm() )
96 rinfo%conds(rid)%vec(idof-ndof) = rhs
98 rinfo%conds(rid)%vec(idof) = rhs
106 in = hecmesh%node_group%grp_item(ik)
108 do idof = idofs, idofe
109 if( istot == 0 )
then
112 rhs = (rhs0 - fstrsolid%unode_bak(ndof*(in-1)+idof))*factor
114 if(
present(rhsvector))
then
115 rhsvector(ndof*(in-1)+idof) = rhs
119 if(
present(conmat))
then
120 call hecmw_mat_ass_bc(hecmat, in, idof, rhs, conmat)
122 call hecmw_mat_ass_bc(hecmat, in, idof, rhs)
126 if(
present(conmat))
then
127 call hecmw_mat_ass_bc_contactlag(conmat,heclagmat,in,idof,rhs)
129 call hecmw_mat_ass_bc_contactlag(hecmat,heclagmat,in,idof,rhs)
140 if( .not. rinfo%conds(rid)%active ) cycle
145 if( factor > 0.d0 )
then
146 ig = rinfo%conds(rid)%center_ngrp_id
148 ccoord(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, hecmesh%node)
149 cdisp(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, fstrsolid%unode)
150 cddisp(idof) = hecmw_ngrp_get_totalvalue(hecmesh, ig, ndof, idof, hecmat%B)
152 ccoord(1:ndof) = ccoord(1:ndof) + cdisp(1:ndof)
155 ig = rinfo%conds(rid)%torque_ngrp_id
156 is0 = hecmesh%node_group%grp_index(ig-1) + 1
157 ie0 = hecmesh%node_group%grp_index(ig )
159 in = hecmesh%node_group%grp_item(ik)
160 if( factor > 0.d0 )
then
161 cdiff0(1:ndof) = hecmesh%node(ndof*(in-1)+1:ndof*in)+fstrsolid%unode(ndof*(in-1)+1:ndof*in)-ccoord(1:ndof)
162 cdiff(1:ndof) = cdiff0(1:ndof)
166 rhs = cdiff(idof)-cdiff0(idof)+cddisp(idof)
167 if(
present(rhsvector))
then
168 rhsvector(ndof*(in-1)+idof) = rhs
172 if(
present(conmat))
then
173 call hecmw_mat_ass_bc(hecmat, in, idof, rhs, conmat)
175 call hecmw_mat_ass_bc(hecmat, in, idof, rhs)
179 if(
present(conmat))
then
180 call hecmw_mat_ass_bc_contactlag(conmat,heclagmat,in,idof,rhs)
182 call hecmw_mat_ass_bc_contactlag(hecmat,heclagmat,in,idof,rhs)
188 if( n_rot > 0 )
call fstr_rotinfo_finalize(rinfo)
196 do ig0=1,fstrsolid%n_fix_mpc
197 if( fstrsolid%mpc_const(ig0) == 0.d0 ) cycle
199 rhs = fstrsolid%mpc_const(ig0)*factor
200 hecmesh%mpc%mpc_const(ig0) = rhs