80 REAL*8,
ALLOCATABLE,
DIMENSION(:) :: buf
82 INTEGER ::
j, j1,
k , k1
84 INTEGER :: totnumndcomm3
85 INTEGER :: elemstart, elemend
90 IF(glb%HeatTransSoln) glb%CapctInv(:) = 0.d0
94 IF(glb%iElType.EQ.4)
THEN
96 IF(.NOT.(glb%NdBasedEl))
THEN
99 DO j = 1, glb%NumMatVol
100 elemend = glb%NumElPartBndryMat(
j) + elemstart - 1
101 CALL
v3d4_mass(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%xmass, &
102 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
104 IF(glb%HeatTransSoln) CALL
v3d4_capacitance(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%Cp,glb%CapctInv, &
105 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
107 elemstart = glb%NumElVolMat(
j) + elemstart
110 ELSE IF(glb%NdBasedEl)
THEN
121 glb%NumNP,glb%NumElVol,glb%NumMatVol,1,glb%NumElVol,glb%TotalMassSolidp, &
122 glb%NumElNeigh,glb%ElConnNd,glb%AlphaR,glb%VolUndfmd)
126 ELSE IF(glb%iElType.EQ.10)
THEN
128 DO j = 1, glb%NumMatVol
129 elemend = glb%NumElPartBndryMat(
j) + elemstart - 1
130 CALL
v3d10_mass(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%xmass, &
131 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend,glb%TotalMassSolidp)
132 IF(glb%HeatTransSoln) CALL
v3d10_capacitance(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%Cp,glb%CapctInv, &
133 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
135 elemstart = glb%NumElVolMat(
j) + elemstart
138 ELSE IF(glb%iElType.EQ.8)
THEN
140 DO j = 1, glb%NumMatVol
141 elemend = glb%NumElPartBndryMat(
j) + elemstart - 1
142 CALL
v3d8_mass(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%xmass, &
143 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
144 elemstart = glb%NumElVolMat(
j) + elemstart
148 IF(.NOT.(glb%HeatTransSoln))
THEN
152 totnumndcomm3 = glb%TotNumNdComm/3
153 ALLOCATE(buf(1:totnumndcomm3))
155 DO j1 = 1, glb%TotNumNeighProcs
156 k = glb%NeighProcList(j1)
157 DO j = 1, glb%NumNdComm(j1)
158 buf(k1) = glb%xmass( glb%NdCommList(j1)%NdId(
j) )
165 DO j1 = 1, glb%TotNumNeighProcs
166 k = glb%NeighProcList(j1)+1
167 CALL mpi_irecv(glb%RecvDataFrm(
k)%rcvbuf(1),glb%NumNdComm(j1), &
168 mpi_double_precision,
k-1,10,glb%MPI_COMM_ROCFRAC,glb%ReqRcv(j1),ierr)
174 DO j1 = 1, glb%TotNumNeighProcs
175 k = glb%NeighProcList(j1)
176 CALL mpi_isend(buf(k1),glb%NumNdComm(j1), &
177 mpi_double_precision,
k,10,glb%MPI_COMM_ROCFRAC,glb%ReqSnd(j1),ierr)
178 k1 = k1 + glb%NumNdComm(j1)
186 totnumndcomm3 = ( glb%TotNumNdComm/3 )*2
187 ALLOCATE(buf(1:totnumndcomm3))
189 DO j1 = 1, glb%TotNumNeighProcs
190 k = glb%NeighProcList(j1)
191 DO j = 1, glb%NumNdComm(j1)
192 buf(k1) = glb%xmass( glb%NdCommList(j1)%NdId(
j) )
193 buf(k1+1) = glb%CapctInv( glb%NdCommList(j1)%NdId(
j) )
202 DO j1 = 1, glb%TotNumNeighProcs
203 k = glb%NeighProcList(j1)+1
204 CALL mpi_irecv(glb%RecvDataFrm(
k)%rcvbuf(1),glb%NumNdComm(j1)*2, &
205 mpi_double_precision,
k-1,10,glb%MPI_COMM_ROCFRAC,glb%ReqRcv(j1),ierr)
211 DO j1 = 1, glb%TotNumNeighProcs
212 k = glb%NeighProcList(j1)
213 CALL mpi_isend(buf(k1),glb%NumNdComm(j1)*2, &
214 mpi_double_precision,
k,10,glb%MPI_COMM_ROCFRAC,glb%ReqSnd(j1),ierr)
215 k1 = k1 + glb%NumNdComm(j1)*2
224 IF(glb%iElType.EQ.4)
THEN
225 IF(glb%iSolnType(1).LT.10)
THEN
227 DO j = 1, glb%NumMatVol
228 elemstart = elemend + glb%NumElPartBndryMat(
j) + 1
229 elemend = glb%NumElVolMat(
j) + elemend
230 CALL
v3d4_mass(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%xmass, &
231 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
233 IF(glb%HeatTransSoln) CALL
v3d4_capacitance(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%Cp,glb%CapctInv, &
234 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
237 ELSE IF(glb%iElType.EQ.10)
THEN
239 DO j = 1, glb%NumMatVol
240 elemstart = elemend + glb%NumElPartBndryMat(
j) + 1
241 elemend = glb%NumElVolMat(
j) + elemend
242 CALL
v3d10_mass(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%xmass, &
243 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend,glb%TotalMassSolidp)
245 IF(glb%HeatTransSoln) CALL
v3d10_capacitance(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%Cp,glb%CapctInv, &
246 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
250 ELSE IF(glb%iElType.EQ.8)
THEN
252 DO j = 1, glb%NumMatVol
253 elemstart = elemend + glb%NumElPartBndryMat(
j) + 1
254 elemend = glb%NumElVolMat(
j) + elemend
255 CALL
v3d8_mass(glb%MeshCoor,glb%ElConnVol,glb%MatIdVol,glb%rho,glb%xmass, &
256 glb%NumNP,glb%NumElVol,glb%NumMatVol,elemstart,elemend)
267 IF(glb%TotNumNeighProcs.GT.0)
THEN
268 CALL mpi_waitall(glb%TotNumNeighProcs,glb%ReqRcv,glb%StatRcv,ierr)
269 CALL mpi_waitall(glb%TotNumNeighProcs,glb%ReqSnd,glb%StatSnd,ierr)
278 IF(.NOT.(glb%HeatTransSoln))
THEN
279 DO j1 = 1, glb%TotNumNeighProcs
280 k = glb%NeighProcList(j1)+1
281 DO j = 1, glb%NumNdComm(j1)
282 k1 = glb%NdCommList(j1)%NdId(
j)
283 glb%xmass(k1) = glb%xmass(k1) + glb%RecvDataFrm(
k)%rcvbuf(
j)
289 DO j1 = 1, glb%TotNumNeighProcs
290 k = glb%NeighProcList(j1)+1
291 DO j = 1, glb%NumNdComm(j1)
292 k1 = glb%NdCommList(j1)%NdId(
j)
293 glb%xmass(k1) = glb%xmass(k1) + glb%RecvDataFrm(
k)%rcvbuf(
j*2-1)
294 glb%CapctInv(k1) = glb%CapctInv(k1) + glb%RecvDataFrm(
k)%rcvbuf(
j*2)
299 glb%xmass(:) = 1.d0/glb%xmass(:)
301 IF(glb%HeatTransSoln) glb%CapctInv(:) = 1./glb%CapctInv(:)
304 IF(glb%iSolnType(1).GE.10)
THEN
306 ALLOCATE(buf(1:totnumndcomm3))
308 DO j1 = 1, glb%TotNumNeighProcs
309 k = glb%NeighProcList(j1)
310 DO j = 1, glb%NumNdComm(j1)
311 buf(k1) = glb%VolUndfmd( glb%NdCommList(j1)%NdId(
j) )
318 DO j1 = 1, glb%TotNumNeighProcs
319 k = glb%NeighProcList(j1)+1
320 CALL mpi_irecv(glb%RecvDataFrm(
k)%rcvbuf(1),glb%NumNdComm(j1), &
321 mpi_double_precision,
k-1,10,glb%MPI_COMM_ROCFRAC,glb%ReqRcv(j1),ierr)
327 DO j1 = 1, glb%TotNumNeighProcs
328 k = glb%NeighProcList(j1)
329 CALL mpi_isend(buf(k1),glb%NumNdComm(j1), &
330 mpi_double_precision,
k,10,glb%MPI_COMM_ROCFRAC,glb%ReqSnd(j1),ierr)
331 k1 = k1 + glb%NumNdComm(j1)
337 IF(glb%TotNumNeighProcs.GT.0)
THEN
338 CALL mpi_waitall(glb%TotNumNeighProcs,glb%ReqRcv,glb%StatRcv,ierr)
339 CALL mpi_waitall(glb%TotNumNeighProcs,glb%ReqSnd,glb%StatSnd,ierr)
346 DO j1 = 1, glb%TotNumNeighProcs
347 k = glb%NeighProcList(j1)+1
348 DO j = 1, glb%NumNdComm(j1)
349 k1 = glb%NdCommList(j1)%NdId(
j)
350 glb%VolUndfmd(k1) = glb%VolUndfmd(k1) + glb%RecvDataFrm(
k)%rcvbuf(
j)
subroutine v3d4_mass(coor, lmcstet, matcstet, rho, xm, numnp, numcstet, numat_vol, nstart, nend)
subroutine v3d8_mass(coor, nodes, MatType, rho, xm, NumNP, NumEl, NumMat, nstart, nend)
subroutine v3d10_capacitance(coor, lmcstet, matcstet, Rho, Cp, Capct, numnp, numcstet, numat_vol, nstart, nend)
subroutine v3d10_mass(coor, lmcstet, matcstet, rho, xm, numnp, numcstet, numat_vol, nstart, nend, TotalMass)
subroutine v3d4_capacitance(coor, lmcstet, matcstet, Rho, Cp, Capct, numnp, numcstet, numat_vol, nstart, nend)
subroutine updatemassmatrix(glb)
subroutine v3d4n_mass(coor, lmcstet, matcstet, rho, xm, numnp, numcstet, numat_vol, nstart, nend, TotalMass, NumElNeigh, ElConn, Alpha, Vhat)