8 private :: area_of_triangle
9 private :: area_of_triangle2
10 private :: area_of_squre
11 private :: node_on_surface
13 integer(kind=kint),
private :: icall = 0
19 type(hecmwst_matrix) :: hecMAT
20 type(hecmwst_local_mesh) :: hecMESH
24 integer(kind=kint) :: ig0, ig, is, ie, ik
25 integer(kind=kint) :: i, j, count
26 integer(kind=kint) :: eid, sid, etype
27 integer(kind=kint) :: node(20)
28 integer(kind=kint) :: node_n
29 real(kind=kreal) :: px, py, pz
30 real(kind=kreal) :: vx, vy, vz
34 integer,
parameter :: MaxNumNodesOnSurf = 8
36 real(kind=kreal) :: xx(maxnumnodesonsurf)
37 real(kind=kreal) :: yy(maxnumnodesonsurf)
38 real(kind=kreal) :: zz(maxnumnodesonsurf)
41 real(kind=kreal) :: area, wg
42 integer(kind=kint) :: ierr
47 do ig0= 1, fstrsolid%COUPLE_ngrp_tot
48 ig= fstrsolid%COUPLE_ngrp_ID(ig0)
49 is= hecmesh%surf_group%grp_index(ig-1) + 1
50 ie= hecmesh%surf_group%grp_index(ig )
52 sid = hecmesh%surf_group%grp_item(2*ik)
53 eid = hecmesh%surf_group%grp_item(2*ik-1)
54 etype = hecmesh%elem_type(eid)
55 call node_on_surface( hecmesh, etype, eid, sid, node, node_n )
65 j=3*fstrcpl%index( node(i) )
69 write(
idbg,
'(a,i0,a)')
"dynamic_mat_ass_couple: traction for node ", &
70 & hecmesh%global_node_ID(node(i)),
" on coupling surface not found"
74 write(
idbg,
'(a,i0,a)')
"dynamic_mat_ass_couple: traction for node ", &
75 & hecmesh%global_node_ID(node(i)),
" on coupling surface OK"
78 px = px + fstrcpl%trac(j-2)
79 py = py + fstrcpl%trac(j-1)
80 pz = pz + fstrcpl%trac(j )
83 if( count == 0 ) cycle
92 xx(i)=hecmesh%node(j-2)
93 yy(i)=hecmesh%node(j-1)
94 zz(i)=hecmesh%node(j )
97 if( node_n == 3 )
then
98 area = area_of_triangle( xx,yy,zz )
99 else if( node_n == 4 )
then
100 area = area_of_squre( xx,yy,zz )
101 else if( node_n == 6 )
then
102 area = area_of_triangle2(xx,yy,zz)
104 write(*,*)
"#Error : in FSTR_MAT_ASS_COUPLE "
105 call hecmw_abort( hecmw_comm_get_comm())
118 hecmat%B(j-2)=hecmat%B(j-2) + vx
119 hecmat%B(j-1)=hecmat%B(j-1) + vy
120 hecmat%B(j )=hecmat%B(j ) + vz
124 call hecmw_barrier(hecmesh)
126 write(*,*)
"#Error : in FSTR_MAT_ASS_COUPLE"
127 call hecmw_abort( hecmw_comm_get_comm())
135 function area_of_triangle( XX,YY,ZZ )
137 real(kind=kreal) :: xx(*), yy(*), zz(*)
138 real(kind=kreal) :: v1x, v1y, v1z
139 real(kind=kreal) :: v2x, v2y, v2z
140 real(kind=kreal) :: v3x, v3y, v3z
141 real(kind=kreal) :: area_of_triangle
152 area_of_triangle = sqrt( v3x*v3x + v3y*v3y + v3z*v3z )*0.5
153 end function area_of_triangle
155 function area_of_triangle2( XX,YY,ZZ )
157 real(kind=kreal) :: xx(*), yy(*), zz(*)
158 real(kind=kreal) :: area_of_triangle2
159 real(kind=kreal) :: x(3), y(3), z(3)
170 area_of_triangle2 = area_of_triangle(x,y,z)
171 end function area_of_triangle2
175 real(kind=kreal) xx(*),yy(*),zz(*)
177 real(kind=kreal) x(3),y(3),z(3)
191 function area_of_squre ( XX,YY,ZZ )
194 real(kind=kreal) :: xx(*), yy(*), zz(*)
195 real(kind=kreal) :: area_of_squre
197 integer(kind=kint),
parameter :: nn = 8
198 integer(kind=kint),
parameter :: ng = 2
200 real(kind=kreal) :: h(nn), hr(nn), hs(nn)
201 real(kind=kreal) :: ri, si
202 real(kind=kreal) :: xj11, xj21, xj31, xj12, xj22, xj32, xj13, xj23, xj33, det, wg
203 integer(kind=kint) :: ig1, ig2, i
204 real(kind=kreal) :: g1x, g1y, g1z
205 real(kind=kreal) :: g2x, g2y, g2z
206 real(kind=kreal) :: g3x, g3y, g3z
207 real(kind=kreal) :: xsum
208 real(kind=kreal) :: area, xg(2), wgt(2)
210 data xg/-0.5773502691896, 0.5773502691896/
218 h(1)=0.25*(1.0-ri)*(1.0-si)
219 h(2)=0.25*(1.0+ri)*(1.0-si)
220 h(3)=0.25*(1.0+ri)*(1.0+si)
221 h(4)=0.25*(1.0-ri)*(1.0+si)
247 xsum=dsqrt(g3x**2+g3y**2+g3z**2)
268 wg=wgt(ig1)*wgt(ig2)*det
270 area = area + h(i)*wg
274 area_of_squre = area;
275 end function area_of_squre
281 subroutine node_on_surface( hecMESH, etype, eid, sid, node, node_n )
283 type(hecmwst_local_mesh) :: hecmesh
284 integer(kind=kint) :: eid
285 integer(kind=kint) :: sid
286 integer(kind=kint) :: node(*)
287 integer(kind=kint) :: node_n
289 integer(kind=kint) :: etype
290 integer(kind=kint) :: is
291 integer(kind=kint) :: tbl341(3, 4)
292 integer(kind=kint) :: tbl342(6, 4)
293 integer(kind=kint) :: tbl361(4, 6)
295 data tbl341 / 1,2,3, 1,2,4, 2,3,4, 3,1,4 /
296 data tbl342 / 1,5,2,6,3,7, 1,5,2,9,4,8, 2,6,3,10,4,9, 3,7,1,10,4,8 /
297 data tbl361 / 1,2,3,4, 5,6,7,8, 1,2,6,5, 2,3,7,6, 3,4,8,7, 4,1,5,8 /
300 integer(kind=kint) :: tbl351(4,5)
301 data tbl351 / 1,2,3,1, 4,5,6,4, 1,2,5,4, 2,3,6,5, 3,1,4,6 /
303 integer(kind=kint) :: tbl362(8,6)
304 data tbl362 / 1, 9, 2,10, 3,11, 4,12, &
305 & 5,13, 6,14, 7,15, 8,16, &
306 & 1, 9, 2,18, 6,13, 5,17, &
307 & 2,10, 3,19, 7,14, 6,18, &
308 & 3,11, 4,20, 8,15, 7,19, &
309 & 4,12, 1,17, 5,16, 8,20 /
312 etype = hecmesh%elem_type( eid )
313 is = hecmesh%elem_node_index( eid-1 )
317 node(1) = hecmesh%elem_node_item (is + tbl341(1,sid) )
318 node(2) = hecmesh%elem_node_item (is + tbl341(2,sid) )
319 node(3) = hecmesh%elem_node_item (is + tbl341(3,sid) )
322 node(1) = hecmesh%elem_node_item (is + tbl342(1,sid) )
323 node(2) = hecmesh%elem_node_item (is + tbl342(2,sid) )
324 node(3) = hecmesh%elem_node_item (is + tbl342(3,sid) )
325 node(4) = hecmesh%elem_node_item (is + tbl342(4,sid) )
326 node(5) = hecmesh%elem_node_item (is + tbl342(5,sid) )
327 node(6) = hecmesh%elem_node_item (is + tbl342(6,sid) )
330 node(1) = hecmesh%elem_node_item (is + tbl361(1,sid) )
331 node(2) = hecmesh%elem_node_item (is + tbl361(2,sid) )
332 node(3) = hecmesh%elem_node_item (is + tbl361(3,sid) )
333 node(4) = hecmesh%elem_node_item (is + tbl361(4,sid) )
338 node(1) = hecmesh%elem_node_item (is + tbl351(1,sid) )
339 node(2) = hecmesh%elem_node_item (is + tbl351(2,sid) )
340 node(3) = hecmesh%elem_node_item (is + tbl351(3,sid) )
341 node(4) = hecmesh%elem_node_item (is + tbl351(4,sid) )
342 if ( node(1) == node(4) )
then
359 if( hecmesh%my_rank==0 )
then
360 write(*,*)
'##Error: not supported element type for coupling analysis ', etype
363 write(*,*)
' This version supports element type 341,342, 351, and 361 only.'
366 call hecmw_abort( hecmw_comm_get_comm() )
369 end subroutine node_on_surface
This module contains functions relates to coupling analysis.
subroutine dynamic_mat_ass_couple(hecMESH, hecMAT, fstrSOLID, fstrCPL)
real(kind=kreal) function area_of_triangle2a(XX, YY, ZZ)
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter idbg
Data for coupling analysis.