53 SUBROUTINE v3d4n(coor,nodes, NumElNeigh,ElConn,Rnet,alpha,disp,ci,&
54 numnp,numel,ahat,numat_vol,&
55 nprocs,totnumndcomm,totnumneighprocs,neighproclist,numndcomm,neigh_lst)
62 INTEGER :: k1, k2, j1,
k
66 INTEGER :: totnumneighprocs, nprocs,totnumndcomm
67 INTEGER,
DIMENSION(1:TotNumNeighProcs) :: neighproclist
68 INTEGER,
DIMENSION(1:TotNumNeighProcs) ::numndcomm
69 REAL*8,
allocatable,
dimension(:) :: buf
71 TYPE(rcv_buf),
ALLOCATABLE,
DIMENSION(:) :: recvdatafrm
72 TYPE(send_buf),
DIMENSION(1:TotNumNeighProcs) :: neigh_lst
76 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: req_rcv_lst, req_snd_lst
77 INTEGER,
ALLOCATABLE,
DIMENSION(:,:) :: stat_rcv_lst,stat_snd_lst
80 INTEGER :: numnp, numel,
i
81 REAL*8,
DIMENSION(1:numnp) :: ahat
82 REAL*8,
DIMENSION(1:numnp*3) :: disp, rnet
83 REAL*8,
DIMENSION(1:3,1:numnp) :: coor
84 INTEGER,
DIMENSION(1:numnp) :: numelneigh
85 INTEGER,
DIMENSION(1:numnp,1:40) :: elconn
86 INTEGER,
DIMENSION(1:4,1:numel) :: nodes
87 REAL*8,
DIMENSION(1:4,1:numel) ::
alpha
90 REAL*8,
DIMENSION(1:9,1:numat_vol) :: ci
95 REAL*8 :: x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4
96 INTEGER :: k1n1,k1n2,k1n3,k1n4,k2n1,k2n2,k2n3,k2n4
97 INTEGER :: k3n1,k3n2,k3n3,k3n4
103 REAL*8 :: u1,u2,u3,u4,v1,v2,v3,v4,w1,w2,w3,w4
106 REAL*8 :: x14, x24, x34, y14, y24, y34, z14, z24, z34
107 REAL*8 :: c11, c21, c31
111 REAL*8 :: b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12
113 REAL*8 :: e11,e22,e33,e12,e23,e13
114 REAL*8 :: b13, b14, b15
115 REAL*8 :: sums11n,sums22n,sums33n,sums12n,sums23n,sums13n
116 INTEGER :: k3i,k2i,k1i
118 INTEGER :: n1, n2, n3, n4
119 REAL*8,
DIMENSION(1:numnp) :: s11n, s22n, s33n, s12n, s23n, s13n
126 IF(totnumneighprocs.NE.0)
THEN
127 ALLOCATE(req_rcv_lst(1:totnumneighprocs) )
128 ALLOCATE(req_snd_lst(1:totnumneighprocs) )
130 ALLOCATE(stat_snd_lst(1:mpi_status_size,1:totnumneighprocs) )
131 ALLOCATE(stat_rcv_lst(1:mpi_status_size,1:totnumneighprocs) )
137 ahatinv = 1.d0/ahat(
i)
146 DO j = 1, numelneigh(
i)
208 b1 = -(y3*z4 - y4*z3 - y2*z4 + y2*z3 + z2*y4 - z2*y3) * sixinv
209 b2 = (x3*z4 - x4*z3 - x2*z4 + x2*z3 + z2*x4 - z2*x3) * sixinv
210 b3 = -(x3*y4 - x4*y3 - x2*y4 + x2*y3 + y2*x4 - y2*x3) * sixinv
211 b4 = (y3*z4 - y4*z3 - y1*z4 + y1*z3 + z1*y4 - z1*y3) * sixinv
212 b5 = -(x3*z4 - x4*z3 - x1*z4 + x1*z3 + z1*x4 - z1*x3) * sixinv
213 b6 = (x3*y4 - x4*y3 - x1*y4 + x1*y3 + y1*x4 - y1*x3) * sixinv
214 b7 = -(y2*z4 - z2*y4 - y1*z4 + y1*z2 + z1*y4 - z1*y2) * sixinv
215 b8 = (x2*z4 - z2*x4 - x1*z4 + x1*z2 + z1*x4 - z1*x2) * sixinv
216 b9 = -(x2*y4 - y2*x4 - x1*y4 + x1*y2 + y1*x4 - y1*x2) * sixinv
217 b10 = (y2*z3 - z2*y3 - y1*z3 + y1*z2 + z1*y3 - z1*y2) * sixinv
218 b11 = -(x2*z3 - z2*x3 - x1*z3 + x1*z2 + z1*x3 - z1*x2) * sixinv
219 b12 = (x2*y3 - y2*x3 - x1*y3 + x1*y2 + y1*x3 - y1*x2) * sixinv
224 e11 =
alpha(ix,ielnum)*(b1*u1 + b4*u2 + b7*u3 + b10*u4)
225 e22 =
alpha(ix,ielnum)*(b2*v1 + b5*v2 + b8*v3 + b11*v4)
226 e33 =
alpha(ix,ielnum)*(b3*w1 + b6*w2 + b9*w3 + b12*w4)
227 e12 =
alpha(ix,ielnum)*(b2*u1 + b1*v1 + b5*u2 + b4*v2 + b8*u3 + b7*v3 + b11*u4 + b10*v4)
228 e23 =
alpha(ix,ielnum)*(b3*v1 + b2*w1 + b6*v2 + b5*w2 + b9*v3 + b8*w3 + b12*v4 + b11*w4)
229 e13 =
alpha(ix,ielnum)*(b3*u1 + b1*w1 + b6*u2 + b4*w2 + b9*u3 + b7*w3 + b12*u4 + b10*w4)
233 sums11n = sums11n + e11*ci(1,1) + e22*ci(2,1) + e33*ci(4,1)
234 sums22n = sums22n + e11*ci(2,1) + e22*ci(3,1) + e33*ci(5,1)
235 sums33n = sums33n + e11*ci(4,1) + e22*ci(5,1) + e33*ci(6,1)
236 sums12n = sums12n + e12*ci(7,1)
237 sums23n = sums23n + e23*ci(8,1)
238 sums13n = sums13n + e13*ci(9,1)
241 s11n(
i) = ahatinv*sums11n
242 s22n(
i) = ahatinv*sums22n
243 s33n(
i) = ahatinv*sums33n
244 s12n(
i) = ahatinv*sums12n
245 s23n(
i) = ahatinv*sums23n
246 s13n(
i) = ahatinv*sums13n
252 ALLOCATE(recvdatafrm(0:nprocs-1))
257 ALLOCATE(buf(1:totnumndcomm*2))
259 DO j1 = 1, totnumneighprocs
260 k = neighproclist(j1)
261 ALLOCATE(recvdatafrm(
k)%rcvbuf(1:numndcomm(j1)*6))
262 DO j = 1, numndcomm(j1)
263 k2 = neigh_lst(j1)%NdID(
j)
277 DO j1 = 1, totnumneighprocs
278 k = neighproclist(j1)
279 CALL mpi_irecv(recvdatafrm(
k)%rcvbuf(1),numndcomm(j1)*6, &
280 mpi_double_precision,
k, 10, rocstar_communicator,req_rcv_lst(j1),ierr)
286 DO j1 = 1, totnumneighprocs
287 k = neighproclist(j1)
290 CALL mpi_isend(buf(k2),numndcomm(j1)*6,&
291 mpi_double_precision,
k,10,rocstar_communicator,req_snd_lst(j1),ierr)
292 k2 = k2 + numndcomm(j1)
297 IF(totnumneighprocs.GT.0)
THEN
298 CALL mpi_waitall(totnumneighprocs,req_rcv_lst,stat_rcv_lst,ierr)
299 CALL mpi_waitall(totnumneighprocs,req_snd_lst,stat_snd_lst,ierr)
306 DO j1 = 1, totnumneighprocs
307 k = neighproclist(j1)
310 DO j = 1, numndcomm(j1)
311 k2 = neigh_lst(j1)%NdID(
j)
312 s11n(k2) = s11n(k2) + recvdatafrm(
k)%rcvbuf(k1)
313 s22n(k2) = s22n(k2) + recvdatafrm(
k)%rcvbuf(k1+1)
314 s33n(k2) = s33n(k2) + recvdatafrm(
k)%rcvbuf(k1+2)
315 s12n(k2) = s12n(k2) + recvdatafrm(
k)%rcvbuf(k1+3)
316 s23n(k2) = s23n(k2) + recvdatafrm(
k)%rcvbuf(k1+4)
317 s13n(k2) = s13n(k2) + recvdatafrm(
k)%rcvbuf(k1+5)
322 DEALLOCATE(recvdatafrm)
334 DO j = 1, numelneigh(
i)
386 b1 = ( (y3-y4)*(z2-z4) - (y2-y4)*(z3-z4) ) * sixinv
387 b2 = ( (z3-z4)*(x2-x4) - (z2-z4)*(x3-x4) ) * sixinv
388 b3 = ( (x3-x4)*(y2-y4) - (x2-x4)*(y3-y4) ) * sixinv
389 b4 = ( (y1-y3)*(z1-z4) - (y1-y4)*(z1-z3) ) * sixinv
390 b5 = ( (z1-z3)*(x1-x4) - (z1-z4)*(x1-x3) ) * sixinv
391 b6 = ( (x1-x3)*(y1-y4) - (x1-x4)*(y1-y3) ) * sixinv
392 b7 = ( (y1-y4)*(z1-z2) - (y1-y2)*(z1-z4) ) * sixinv
393 b8 = ( (z1-z4)*(x1-x2) - (z1-z2)*(x1-x4) ) * sixinv
394 b9 = ( (x1-x4)*(y1-y2) - (x1-x2)*(y1-y4) ) * sixinv
395 b10 = ( (y1-y2)*(z1-z3) - (y1-y3)*(z1-z2) ) * sixinv
396 b11 = ( (z1-z2)*(x1-x3) - (z1-z3)*(x1-x2) ) * sixinv
397 b12 = ( (x1-x2)*(y1-y3) - (x1-x3)*(y1-y2) ) * sixinv
403 ELSE IF (n2.EQ.
i)
THEN
419 rnet(k1i) = rnet(k1i) - &
420 (s11n(n1)*b13 + s12n(n1)*b14 + s13n(n1)*b15)*
alpha(1,ielnum) - &
421 (s11n(n2)*b13 + s12n(n2)*b14 + s13n(n2)*b15)*
alpha(2,ielnum) - &
422 (s11n(n3)*b13 + s12n(n3)*b14 + s13n(n3)*b15)*
alpha(3,ielnum) - &
423 (s11n(n4)*b13 + s12n(n4)*b14 + s13n(n4)*b15)*
alpha(4,ielnum)
425 rnet(k2i) = rnet(k2i) - &
426 (s22n(n1)*b14 + s12n(n1)*b13 + s23n(n1)*b15)*
alpha(1,ielnum) - &
427 (s22n(n2)*b14 + s12n(n2)*b13 + s23n(n2)*b15)*
alpha(2,ielnum) - &
428 (s22n(n3)*b14 + s12n(n3)*b13 + s23n(n3)*b15)*
alpha(3,ielnum) - &
429 (s22n(n4)*b14 + s12n(n4)*b13 + s23n(n4)*b15)*
alpha(4,ielnum)
431 rnet(k3i) = rnet(k3i) - &
432 (s33n(n1)*b15 + s23n(n1)*b14 + s13n(n1)*b13)*
alpha(1,ielnum) - &
433 (s33n(n2)*b15 + s23n(n2)*b14 + s13n(n2)*b13)*
alpha(2,ielnum) - &
434 (s33n(n3)*b15 + s23n(n3)*b14 + s13n(n3)*b13)*
alpha(3,ielnum) - &
435 (s33n(n4)*b15 + s23n(n4)*b14 + s13n(n4)*b13)*
alpha(4,ielnum)
subroutine v3d4n(coor, nodes, NumElNeigh, ElConn, Rnet, alpha, disp, ci, numnp, numel, Ahat, numat_vol, nprocs, TotNumNdComm, TotNumNeighProcs, NeighProcList, NumNdComm, neigh_lst)
unsigned char alpha() const