67 REAL(kind=wp) :: tempkval
68 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: amounttoreceive, amounttosend
70 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: bufsnd
72 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: tempmg, mg
73 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: aval_m_temp
74 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: rp_m_temp, cval_m_temp
76 REAL(kind=wp),
DIMENSION(1:3,1:8) :: ri = reshape( &
77 (/-0.577350269189626,-0.577350269189626,-0.577350269189626, &
78 0.577350269189626,-0.577350269189626,-0.577350269189626, &
79 0.577350269189626, 0.577350269189626,-0.577350269189626, &
80 -0.577350269189626, 0.577350269189626,-0.577350269189626, &
81 -0.577350269189626,-0.577350269189626, 0.577350269189626, &
82 0.577350269189626,-0.577350269189626, 0.577350269189626, &
83 0.577350269189626, 0.577350269189626, 0.577350269189626, &
84 -0.577350269189626, 0.577350269189626, 0.577350269189626/),(/3,8/) )
89 IF(myid==0)
print*,
'CONSTRUCTING THE MASS MATRIX'
92 CALL
implicit_v3d8_mass_consistent(global%NumElVol,global%NumNp,global%NumMatVol,global%MeshCoor,global%ElConnVol,global%MatIdVol,ri,global%rho,global%ElConnVol)
94 ALLOCATE(cval_m(1:nnz_m))
95 ALLOCATE(aval_m(1:nnz_m))
96 ALLOCATE(rp_m(1:3*gnumnp+1))
101 DEALLOCATE(cval_temp)
102 DEALLOCATE(aval_temp)
106 CALL mpi_barrier(rocstar_communicator,ierr)
107 ALLOCATE(req_rcv(1:nprocs))
108 ALLOCATE(req_snd(1:nprocs))
109 ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
110 ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
114 DO j = 1, mpi_status_size
119 ALLOCATE(amounttoreceive(1:numcommprocsfrom1))
120 DO i = 1, numcommprocsfrom1
121 CALL mpi_irecv(amounttoreceive(
i),1, &
122 mpi_integer,commprocsfrom1(
i),10,rocstar_communicator, &
125 ALLOCATE(amounttosend(1:numcommprocs1))
126 DO i = 1, numcommprocs1
128 DO j = 1, numcommnodes1(
i)
132 inode = local2global(commnodes1(
i,
j))
138 IF (tempkval /= 0.0)
THEN
139 counter = counter + 1
146 amounttosend(
i) = counter
149 CALL mpi_send(amounttosend(
i),1,mpi_integer, &
150 commprocs1(
i),10,rocstar_communicator,ierr)
154 CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
158 CALL mpi_barrier(rocstar_communicator,ierr)
159 ALLOCATE(frmproc(1:numcommprocsfrom1))
160 DO i = 1, numcommprocsfrom1
161 ALLOCATE(frmproc(
i)%rcvbuf(1:3*amounttoreceive(
i)))
162 CALL mpi_irecv(frmproc(
i)%rcvbuf(1),3*amounttoreceive(
i), &
163 mpi_double_precision,commprocsfrom1(
i),10,rocstar_communicator, &
166 DO i = 1, numcommprocs1
167 ALLOCATE(bufsnd(1:3*amounttosend(
i)))
170 DO j = 1, numcommnodes1(
i)
174 inode = local2global(commnodes1(
i,
j))
180 IF (tempkval /= 0.0)
THEN
181 counter = counter + 1
182 bufsnd(3*counter-2) = local2global(commnodes1(
i,
j))*3-3+p
183 bufsnd(3*counter-1) =
m
184 bufsnd(3*counter) = tempkval
192 CALL mpi_send(bufsnd,3*amounttosend(
i),mpi_double_precision, &
193 commprocs1(
i),10,rocstar_communicator,ierr)
198 CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
207 DO i = 1, numcommprocsfrom1
209 DO j = 1, amounttoreceive(
i)
211 int(frmproc(
i)%rcvbuf(3*
j-2)),int(frmproc(
i)%rcvbuf(3*
j-1)),frmproc(
i)%rcvbuf(3*
j))
212 IF (nnz_temp /= nnz_m)
THEN
213 DEALLOCATE(cval_m,aval_m)
214 ALLOCATE(cval_m(nnz_temp),aval_m(nnz_temp))
220 DEALLOCATE(rp_temp,cval_temp,aval_temp)
224 DEALLOCATE(amounttoreceive)
225 DEALLOCATE(amounttosend)
229 CALL
comp_row_resize(3*gnumnp,3*gnumnp,nnz_m,1,rp_m,cval_m,aval_m,nstart_km,nrows_km)
230 DEALLOCATE(rp_m,cval_m,aval_m)
231 ALLOCATE(rp_m(1:nrows_km+1))
232 ALLOCATE(cval_m(1:nnz_temp))
233 ALLOCATE(aval_m(1:nnz_temp))
238 DEALLOCATE(rp_temp,cval_temp,aval_temp)
244 ALLOCATE(tempmg(1:global%NumNp))
245 ALLOCATE(mg(1:3*lnumnp))
246 ALLOCATE(cval_m_temp(1:3*lnumnp))
247 ALLOCATE(aval_m_temp(1:3*lnumnp))
248 ALLOCATE(rp_m_temp(1:3*lnumnp+1))
249 tempmg(1:global%NumNp) = 0.0
250 CALL
implicit_v3d8_mass(global%NumElVol,global%NumNp,global%NumMatVol,global%MeshCoor,global%ElConnVol,global%MatIdVol,ri,global%rho,tempmg,1,global%NumElVol)
251 DO i = 1, global%NumNp
252 tempmg(
i) = 1.0 / tempmg(
i)
256 CALL mpi_barrier(rocstar_communicator,ierr)
261 ALLOCATE(req_rcv(1:nprocs))
262 ALLOCATE(req_snd(1:nprocs))
263 ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
264 ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
268 DO j = 1, mpi_status_size
273 ALLOCATE(frmproc(1:numcommprocsfrom1))
274 DO i = 1, numcommprocsfrom1
275 ALLOCATE(frmproc(
i)%rcvbuf(1:2*numcommnodesfrom1(
i)))
276 CALL mpi_irecv(frmproc(
i)%rcvbuf(1),2*numcommnodesfrom1(
i), &
277 mpi_double_precision,commprocsfrom1(
i),10,rocstar_communicator, &
280 DO i = 1, numcommprocs1
281 ALLOCATE(bufsnd(2*numcommnodes1(
i)))
282 DO j = 1, numcommnodes1(
i)
283 bufsnd(2*
j-1) = local2global(commnodes1(
i,
j))
284 bufsnd(2*
j) = tempmg(commnodes1(
i,
j))
288 CALL mpi_send(bufsnd,2*numcommnodes1(
i),mpi_double_precision, &
289 commprocs1(
i),10,rocstar_communicator,ierr)
294 CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
302 DO i = 1, numcommprocsfrom1
303 DO j = 1, numcommnodesfrom1(
i)
304 tempmg(global2local(int(frmproc(
i)%rcvbuf(2*
j-1)))) = &
305 tempmg(global2local(int(frmproc(
i)%rcvbuf(2*
j-1)))) + frmproc(
i)%rcvbuf(2*
j)
315 DO i = 1, global%NumNp
316 IF (local2global(
i) ==
m)
THEN
317 IF (nodeproc(
i) == myid)
THEN
319 counter = counter + 1
320 mg(counter) = tempmg(
i)
328 cval_m_temp(
i) =
i-1 + (nstart_km - 1)
329 aval_m_temp(
i) = mg(
i)
331 rp_m_temp(3*lnumnp+1) = 3*lnumnp
336 CALL
comp_row_add(3*lnumnp,3*gnumnp,nrows_km,nrows_km,nnz_m,3*lnumnp,1, &
337 rp_m,cval_m,0.5*aval_m,1,rp_m_temp,cval_m_temp,0.5*aval_m_temp)
338 DEALLOCATE(rp_m,cval_m,aval_m)
339 DEALLOCATE(rp_m_temp,cval_m_temp,aval_m_temp)
340 ALLOCATE(rp_m(nrows_km+1),cval_m(nnz_temp),aval_m(nnz_temp))
345 DEALLOCATE(rp_temp,cval_temp,aval_temp)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE inode
subroutine comp_row_add(ndim, gndim, nrows1, nrows2, nnz1, nnz2, nstart1, rp1, cval1, aval1, nstart2, rp2, cval2, aval2)
subroutine createm(global)
subroutine comp_row_getval(ndim, nrows, nnz, nstart, rp, cval, aval, ipos, jpos, val)
subroutine comp_row_resize(ndim, nrows, nnz, nstart, rp, cval, aval, newnstart, newnrows)
subroutine implicit_v3d8_mass(NumEl, NumNP, NumMat, coor, nodes, MatType, ri, rho, xm, iElStart, iElEnd)
subroutine implicit_v3d8_mass_consistent(NumEl, NumNP, NumMat, coor, nodes, MatType, ri, rho, ElConnVol)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jnode
subroutine comp_row_addval(ndim, nrows, nnz, nstart, rp, cval, aval, ipos, jpos, val)