24 integer(kind=kint),
save :: n_contact_mpc
30 integer,
intent(in) :: etype
31 integer,
intent(in) :: nnode
32 real(kind=kreal),
intent(out) :: mpcval(nnode*3 + 4)
35 real(kind=kreal) :: shapefunc(nnode)
37 call getshapefunc( etype, cstate%lpos(1:2), shapefunc )
38 mpcval(1:3) = cstate%direction(1:3)
41 mpcval( i*3+j ) = -cstate%direction(j)*shapefunc(i)
44 mpcval( 3*nnode+4 )=cstate%distance
49 type(
tcontact ),
intent(in) :: contact
50 type( hecmwst_mpc ),
intent(inout) :: mpcs
51 integer(kind=kint),
intent(out) :: nmpc
52 integer(kind=kint),
parameter :: ndof = 3
53 real(kind=kreal),
parameter :: tol =1.d-10
54 integer(kind=kint) :: i, j, k, nn, csurf, nenode, etype, tdof
55 integer(kind=kint) :: nodes(l_max_surface_node*ndof+ndof), dofs(l_max_surface_node*ndof+ndof)
56 real(kind=kreal) :: values(l_max_surface_node*ndof+ndof+1),val(l_max_surface_node*ndof+ndof+1)
58 do i=1,
size(contact%states)
59 if( contact%states(i)%state == -1 ) cycle
60 csurf = contact%states(i)%surface
61 if( csurf<=0 ) stop
"error in contact state"
62 etype = contact%master(csurf)%etype
63 nenode =
size(contact%master(csurf)%nodes)
64 tdof = nenode*ndof+ndof
65 call contact2mpcval( contact%states(i), etype, nenode, values(1:tdof+1) )
68 if( dabs(values(j))<tol ) cycle
70 nodes(tdof) = contact%slave(i)
75 nn = contact%master(csurf)%nodes(j)
76 nodes( j*ndof+1:j*ndof+ndof ) = nn
78 if( dabs(values(j*ndof+k)) < tol ) cycle
82 val(tdof)=values(j*ndof+k)
85 val(tdof+1) = values(nenode*ndof+ndof+1)
87 call fstr_append_mpc( tdof, nodes(1:tdof), dofs(1:tdof), val(1:tdof+1), mpcs )
95 type(
tcontact ),
intent(in) :: contact
96 type( hecmwst_mpc ),
intent(inout) :: mpcs
97 integer(kind=kint),
intent(out) :: nmpc
98 integer(kind=kint) :: i, j, csurf, nenode, etype, tdof
99 integer(kind=kint) :: nodes(l_max_surface_node+1), dofs(l_max_surface_node+1)
100 real(kind=kreal) :: values(l_max_surface_node+2)
102 do i=1,
size(contact%slave)
103 csurf = contact%states(i)%surface
105 nenode =
size(contact%master(csurf)%nodes)
107 nodes(1) = contact%slave(i)
108 nodes( 2:tdof ) = contact%master(csurf)%nodes(:)
110 values(2:tdof) = 1.d0
111 values(tdof+1) = 0.d0
112 etype = contact%master(csurf)%etype
115 call fstr_append_mpc( tdof, nodes(1:tdof), dofs(1:tdof), values(1:tdof+1), mpcs )
123 type(
tcontact ),
intent(in) :: contacts(:)
124 type( hecmwst_mpc ),
intent(inout) :: mpcs
125 integer(kind=kint) :: i, nmpc
127 do i=1,
size(contacts)
130 print *,
"Cannot deal with finit slip problems by MPC!"
135 n_contact_mpc = n_contact_mpc + nmpc
138 n_contact_mpc = n_contact_mpc + nmpc
146 type( hecmwst_mpc ),
intent(inout) :: mpcs
152 integer(kind=kint),
intent(in) :: file
153 type( hecmwst_mpc ),
intent(in) :: mpcs
155 integer(kind=kint) :: i,j,n0,n1
156 write(file, *)
"Number of equation", mpcs%n_mpc
158 write(file,*)
"--Equation",i
159 n0=mpcs%mpc_index(i-1)+1
162 write(file,
'(30i5)') (mpcs%mpc_item(j),j=n0,n1)
163 write(file,
'(30i5)') (mpcs%mpc_dof(j),j=n0,n1)
164 write(file,
'(30f7.2)') (mpcs%mpc_val(j),j=n0,n1),mpcs%mpc_const(i)
This module provides functions to modify MPC conditions.
subroutine fstr_delete_mpc(np, mpcs)
Delete last n equation conditions from current mpc condition.
subroutine fstr_append_mpc(np, nodes, dofs, values, mpcs)
Append new equation condition at end of existing mpc conditions.
This module defines common data and basic structures for analysis.