25 integer,
intent(in) :: etype
26 integer,
intent(in) :: nnode
27 real(kind=kreal),
intent(out) :: mpcval(nnode*3 + 4)
30 real(kind=kreal) :: shapefunc(nnode)
32 call getshapefunc( etype, cstate%lpos(1:2), shapefunc )
33 mpcval(1:3) = cstate%direction(1:3)
36 mpcval( i*3+j ) = -cstate%direction(j)*shapefunc(i)
39 mpcval( 3*nnode+4 )=cstate%distance
44 type(
tcontact ),
intent(in) :: contact
45 type( hecmwst_mpc ),
intent(inout) :: mpcs
46 integer(kind=kint),
intent(out) :: nmpc
47 integer(kind=kint),
parameter :: ndof = 3
48 real(kind=kreal),
parameter :: tol =1.d-10
49 integer(kind=kint) :: i, j, k, nn, csurf, nenode, etype, tdof
50 integer(kind=kint) :: nodes(l_max_surface_node*ndof+ndof), dofs(l_max_surface_node*ndof+ndof)
51 real(kind=kreal) :: values(l_max_surface_node*ndof+ndof+1),val(l_max_surface_node*ndof+ndof+1)
53 do i=1,
size(contact%states)
54 if( contact%states(i)%state == -1 ) cycle
55 csurf = contact%states(i)%surface
56 if( csurf<=0 ) stop
"error in contact state"
57 etype = contact%master(csurf)%etype
58 nenode =
size(contact%master(csurf)%nodes)
59 tdof = nenode*ndof+ndof
60 call contact2mpcval( contact%states(i), etype, nenode, values(1:tdof+1) )
63 if( dabs(values(j))<tol ) cycle
65 nodes(tdof) = contact%slave(i)
70 nn = contact%master(csurf)%nodes(j)
71 nodes( j*ndof+1:j*ndof+ndof ) = nn
73 if( dabs(values(j*ndof+k)) < tol ) cycle
77 val(tdof)=values(j*ndof+k)
80 val(tdof+1) = values(nenode*ndof+ndof+1)
82 call fstr_append_mpc( tdof, nodes(1:tdof), dofs(1:tdof), val(1:tdof+1), mpcs )
90 type(
tcontact ),
intent(in) :: contact
91 type( hecmwst_mpc ),
intent(inout) :: mpcs
92 integer(kind=kint),
intent(out) :: nmpc
93 integer(kind=kint) :: i, j, csurf, nenode, etype, tdof
94 integer(kind=kint) :: nodes(l_max_surface_node+1), dofs(l_max_surface_node+1)
95 real(kind=kreal) :: values(l_max_surface_node+2)
97 do i=1,
size(contact%slave)
98 csurf = contact%states(i)%surface
100 nenode =
size(contact%master(csurf)%nodes)
102 nodes(1) = contact%slave(i)
103 nodes( 2:tdof ) = contact%master(csurf)%nodes(:)
105 values(2:tdof) = 1.d0
106 values(tdof+1) = 0.d0
107 etype = contact%master(csurf)%etype
110 call fstr_append_mpc( tdof, nodes(1:tdof), dofs(1:tdof), values(1:tdof+1), mpcs )
This module provides functions to modify MPC conditions.
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.