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
45 integer( kind=kint ) :: node_global
51 do ig0= 1, fstrsolid%COUPLE_ngrp_tot
52 ig= fstrsolid%COUPLE_ngrp_ID(ig0)
53 is= hecmesh%surf_group%grp_index(ig-1) + 1
54 ie= hecmesh%surf_group%grp_index(ig )
56 sid = hecmesh%surf_group%grp_item(2*ik)
57 eid = hecmesh%surf_group%grp_item(2*ik-1)
58 etype = hecmesh%elem_type(eid)
59 call node_on_surface( hecmesh, etype, eid, sid, node, node_n )
69 j=3*fstrcpl%index( node(i) )
77 write(
idbg,
'(a,i0,a)')
"dynamic_mat_ass_couple: traction for node ", &
78 & hecmesh%global_node_ID(node(i)),
" on coupling surface not found"
85 write(
idbg,
'(a,i0,a)')
"dynamic_mat_ass_couple: traction for node ", &
86 & hecmesh%global_node_ID(node(i)),
" on coupling surface OK"
92 px = px + fstrcpl%trac(j-2)
93 py = py + fstrcpl%trac(j-1)
94 pz = pz + fstrcpl%trac(j )
97 if( count == 0 ) cycle
106 xx(i)=hecmesh%node(j-2)
107 yy(i)=hecmesh%node(j-1)
108 zz(i)=hecmesh%node(j )
111 if( node_n == 3 )
then
112 area = area_of_triangle( xx,yy,zz )
113 else if( node_n == 4 )
then
114 area = area_of_squre( xx,yy,zz )
115 else if( node_n == 6 )
then
116 area = area_of_triangle2(xx,yy,zz)
118 write(*,*)
"#Error : in FSTR_MAT_ASS_COUPLE "
119 call hecmw_abort( hecmw_comm_get_comm())
132 hecmat%B(j-2)=hecmat%B(j-2) + vx
133 hecmat%B(j-1)=hecmat%B(j-1) + vy
134 hecmat%B(j )=hecmat%B(j ) + vz
138 call hecmw_barrier(hecmesh)
140 write(*,*)
"#Error : in FSTR_MAT_ASS_COUPLE"
141 call hecmw_abort( hecmw_comm_get_comm())
149 function area_of_triangle( XX,YY,ZZ )
151 real(kind=kreal) :: xx(*), yy(*), zz(*)
152 real(kind=kreal) :: v1x, v1y, v1z
153 real(kind=kreal) :: v2x, v2y, v2z
154 real(kind=kreal) :: v3x, v3y, v3z
155 real(kind=kreal) :: area_of_triangle
166 area_of_triangle = sqrt( v3x*v3x + v3y*v3y + v3z*v3z )*0.5
167 end function area_of_triangle
169 function area_of_triangle2( XX,YY,ZZ )
171 real(kind=kreal) :: xx(*), yy(*), zz(*)
172 real(kind=kreal) :: area_of_triangle2
173 real(kind=kreal) :: x(3), y(3), z(3)
184 area_of_triangle2 = area_of_triangle(x,y,z)
185 end function area_of_triangle2
189 real(kind=kreal) xx(*),yy(*),zz(*)
191 real(kind=kreal) x(3),y(3),z(3)
205 function area_of_squre ( XX,YY,ZZ )
208 real(kind=kreal) :: xx(*), yy(*), zz(*)
209 real(kind=kreal) :: area_of_squre
211 integer(kind=kint),
parameter :: nn = 8
212 integer(kind=kint),
parameter :: ng = 2
214 real(kind=kreal) :: h(nn), hr(nn), hs(nn), ht(nn)
215 real(kind=kreal) :: ri, si, ti, rp, sp, tp, rm, sm, tm
216 real(kind=kreal) :: xj11, xj21, xj31, xj12, xj22, xj32, xj13, xj23, xj33, det, wg
217 integer(kind=kint) :: ig1, ig2, lx, ly, lz, i
218 real(kind=kreal) :: vx, vy, vz, xcod, ycod, zcod
219 real(kind=kreal) :: ax, ay, az, rx, ry, rz, hx, hy, hz, val
220 real(kind=kreal) :: phx, phy, phz
221 real(kind=kreal) :: g1x, g1y, g1z
222 real(kind=kreal) :: g2x, g2y, g2z
223 real(kind=kreal) :: g3x, g3y, g3z
224 real(kind=kreal) :: xsum, coefx, coefy, coefz
225 real(kind=kreal) :: area, xg(2), wgt(2)
227 data xg/-0.5773502691896, 0.5773502691896/
235 h(1)=0.25*(1.0-ri)*(1.0-si)
236 h(2)=0.25*(1.0+ri)*(1.0-si)
237 h(3)=0.25*(1.0+ri)*(1.0+si)
238 h(4)=0.25*(1.0-ri)*(1.0+si)
264 xsum=dsqrt(g3x**2+g3y**2+g3z**2)
285 wg=wgt(ig1)*wgt(ig2)*det
287 area = area + h(i)*wg
291 area_of_squre = area;
292 end function area_of_squre
298 subroutine node_on_surface( hecMESH, etype, eid, sid, node, node_n )
300 type(hecmwst_local_mesh) :: hecmesh
301 integer(kind=kint) :: eid
302 integer(kind=kint) :: sid
303 integer(kind=kint) :: node(*)
304 integer(kind=kint) :: node_n
306 integer(kind=kint) :: etype
307 integer(kind=kint) :: is
308 integer(kind=kint) :: tbl341(3, 4)
309 integer(kind=kint) :: tbl342(6, 4)
310 integer(kind=kint) :: tbl361(4, 6)
312 data tbl341 / 1,2,3, 1,2,4, 2,3,4, 3,1,4 /
313 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 /
314 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 /
317 integer(kind=kint) :: tbl351(4,5)
318 data tbl351 / 1,2,3,1, 4,5,6,4, 1,2,5,4, 2,3,6,5, 3,1,4,6 /
320 integer(kind=kint) :: tbl362(8,6)
321 data tbl362 / 1, 9, 2,10, 3,11, 4,12, &
322 & 5,13, 6,14, 7,15, 8,16, &
323 & 1, 9, 2,18, 6,13, 5,17, &
324 & 2,10, 3,19, 7,14, 6,18, &
325 & 3,11, 4,20, 8,15, 7,19, &
326 & 4,12, 1,17, 5,16, 8,20 /
329 etype = hecmesh%elem_type( eid )
330 is = hecmesh%elem_node_index( eid-1 )
334 node(1) = hecmesh%elem_node_item (is + tbl341(1,sid) )
335 node(2) = hecmesh%elem_node_item (is + tbl341(2,sid) )
336 node(3) = hecmesh%elem_node_item (is + tbl341(3,sid) )
339 node(1) = hecmesh%elem_node_item (is + tbl342(1,sid) )
340 node(2) = hecmesh%elem_node_item (is + tbl342(2,sid) )
341 node(3) = hecmesh%elem_node_item (is + tbl342(3,sid) )
342 node(4) = hecmesh%elem_node_item (is + tbl342(4,sid) )
343 node(5) = hecmesh%elem_node_item (is + tbl342(5,sid) )
344 node(6) = hecmesh%elem_node_item (is + tbl342(6,sid) )
347 node(1) = hecmesh%elem_node_item (is + tbl361(1,sid) )
348 node(2) = hecmesh%elem_node_item (is + tbl361(2,sid) )
349 node(3) = hecmesh%elem_node_item (is + tbl361(3,sid) )
350 node(4) = hecmesh%elem_node_item (is + tbl361(4,sid) )
355 node(1) = hecmesh%elem_node_item (is + tbl351(1,sid) )
356 node(2) = hecmesh%elem_node_item (is + tbl351(2,sid) )
357 node(3) = hecmesh%elem_node_item (is + tbl351(3,sid) )
358 node(4) = hecmesh%elem_node_item (is + tbl351(4,sid) )
359 if ( node(1) == node(4) )
then
376 if( hecmesh%my_rank==0 )
then
377 write(*,*)
'##Error: not supported element type for coupling analysis ', etype
380 write(*,*)
' This version supports element type 341,342, 351, and 361 only.'
383 call hecmw_abort( hecmw_comm_get_comm() )
386 end subroutine node_on_surface