Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PartitionCeff.f90
Go to the documentation of this file.
1 
2 !!****
3 !!
4 !! NAME
5 !! Partition_Ceff
6 !!
7 !! FUNCTION
8 !! This subroutine partitions the full effective capacitance matrix
9 !! into the blocks corresponding to the prescribed-prescribed,
10 !! prescribed-free and free-free DOFs. This is accomplished by converting
11 !! Ceff into its explicit form, partitioning, and converting the free-free
12 !! part back to CRS format. The prescribed-prescribed and free-prescribed
13 !! blocks can stay in explicit form because they are not going to be input
14 !! to BlockSolve95.
15 !!
16 !! INPUTS
17 !! ndim -- The size of one dimension of the global Ceff matrix
18 !! nrows -- The number of rows assigned to this processor
19 !! nnz -- The number of nonzeros in section of the Ceff matrix on this processor
20 !! nstart -- The global index of the first row assigned to this processor
21 !! rp1 -- The row mapping vector
22 !! cval -- The collumn mapping vector
23 !! aval -- The nonzero value vector
24 !! ProcTemp -- The part of the global temperature vector that's assigned to this processor
25 !!
26 !! OUTPUTS
27 !! newnrows -- The number of rows assigned to this proc after BCs have been removed
28 !! newnstart -- The global index of the first row assigned to this proc after BCs have been removed
29 !! newndim -- The size of the global CeffFF matrix after BCs have been removed
30 !!
31 !! USES
32 !! none
33 !!
34 !!****
35 
36 SUBROUTINE partition_ceff(ndim,nrows,nnz,nstart,rp1,cval,aval,newnrows,newnstart,newndim,ProcTemp,global)
37 
39  USE comp_row_global
40  USE implicit_global
41  USE precision
43 
44  IMPLICIT NONE
45 
46  include 'mpif.h'
47 
48  TYPE(rocfrac_global) :: global
49 
50  ! ... Arguments
51  INTEGER :: ndim, nnz, nstart, nrows
52  REAL(kind=wp), DIMENSION(nnz) :: aval
53  INTEGER, DIMENSION(nnz) :: cval
54  INTEGER, DIMENSION(nrows+1) :: rp1
55  REAL(kind=wp), DIMENSION(LNumNp) :: proctemp
56 
57  INTEGER :: newnrows
58  INTEGER :: newnstart
59  INTEGER :: newndim
60 
61  ! ... local variables
62  INTEGER :: numdisp ! Local number of displacement BCs
63  INTEGER, ALLOCATABLE, DIMENSION(:) :: dispbc ! Local displacement BCs
64  INTEGER, ALLOCATABLE, DIMENSION(:) :: tempintv
65 
66  INTEGER :: i, j, n, m, counter1, counter2, counter3, counter4, counter5
67 
68 
69  INTEGER :: ncols, idof, jdof
70 
71  REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:) :: ceffexplicit, ceffff, cefffp, ceffpf, ceffpp
72 
73 
74  ! ... Deallocate removeBCs_global variables
75  IF(ALLOCATED(gtempbc)) DEALLOCATE(gtempbc)
76  IF(ALLOCATED(numtempproc)) DEALLOCATE(numtempproc)
77 
78  ! ... Count the number of temperature boundary conditions in this
79  ! ... processes partition.
80  numdisp = 0
81  DO i = 1, global%NumNp
82  IF (nodeproc(i) == myid) THEN
83  ! ... If the value of the flag at node i on in this processes
84  ! ... is 8, add 1 to the count of temperature BCs.
85  IF(node_flag(i,1) == 8) THEN
86  numdisp = numdisp + 1
87  ENDIF
88 
89  ENDIF
90  ENDDO
91  print*,myid,' number of local disp BCs = ',numdisp
92 
93  ! Sum the local disp BCs, then broadcast to all procs
94  CALL mpi_barrier(rocstar_communicator,ierr)
95 
96  ! ... MPI_REDUCE sums values on all processes to one value. (SUM(numdisp)=GNumTemp)
97  CALL mpi_reduce(numdisp, gnumtemp, 1, mpi_integer, mpi_sum, 0 , rocstar_communicator, ierr)
98  ! ... The number GNumTemp is then communicated to all processes, all know the global
99  ! ... number of temperature boundary condtions.
100  CALL mpi_bcast(gnumtemp, 1, mpi_integer, 0, rocstar_communicator, ierr)
101 
102  ! ... newndim is the size of the Global capacitance matrix after the temperature BC's are removed.
103  newndim = gnumnp - gnumtemp
104  print*,myid,' number of global disp BCs = ',gnumtemp
105 
106  ! ... Figure out which nodes have perscribed temperatures
107  ! ... If this processes partition contains prescribed temperatures, then
108  ! ... allocate an array to store the global index of that temperature BC.
109  IF(numdisp > 0) THEN
110  ALLOCATE(dispbc(1:numdisp))
111  dispbc(:) = 0
112  counter2 = 0
113 
114  DO m = 1, gnumnp
115  DO i = 1, global%NumNp
116  ! ... If global node m is owned by this process and there is a temperature
117  ! ... BC at that node, record the node number as the next entry in array dispbc.
118  IF (local2global(i) == m) THEN
119  IF (nodeproc(i) == myid) THEN
120  IF(node_flag(i,1) == 8) THEN ! Imposed constant nodal displacement
121  counter2 = counter2 + 1
122  dispbc(counter2) = m
123  ENDIF
124  ENDIF
125  ENDIF
126  ENDDO
127  ENDDO
128  ENDIF
129  If(numdisp >0) print*,myid,' local disp bcs = ',dispbc(:)
130 
131  ! ... Have each proc in turn broadcast its number of temperature BCs to the other procs
132  ALLOCATE(numtempproc(1:nprocs))
133  numtempproc(:) = 0
134  numtempproc(myid+1) = numdisp
135  DO i = 1, nprocs
136  CALL mpi_bcast(numtempproc(i), 1, mpi_integer, i-1, rocstar_communicator, ierr)
137  ENDDO
138 
139  ! ... The global row index of the first row on this process is the old index
140  ! ... minus the number of temperature BCs on global nodes in the range from
141  ! ... node 1 to node nstart(the old starting row index).
142  newnstart = nstart
143  DO i = 1, myid
144  newnstart = newnstart - numtempproc(i)
145  ENDDO
146  print*,myid,' number of disp bcs on other procs = ',numtempproc(:)
147 
148  ! ... Have each proc in turn broadcast the node numbers that it owns which have temperature
149  ! ... boundary conditions. The global list of these node numbers will be stored in the array
150  ! ... GTempBC.
151  ALLOCATE(gtempbc(1:gnumtemp))
152  gtempbc(:) = 0
153  counter1 = 0
154  ! ... Loop through the processes
155  DO i = 1, nprocs
156  ! ... If there are temperature boundary conditions on process i then allocate the temporary array
157  ! ... tempintv to the number of temperature BCs on process i.
158  IF (numtempproc(i) > 0) THEN
159  ALLOCATE(tempintv(1:numtempproc(i)))
160  tempintv(:) = 0
161  ! ... It process i is this process, fill the array tempintv with the node numbers of the
162  ! ... temperature boundary conditions on this process.
163  if (i-1 == myid) tempintv(:) = dispbc(:)
164  ! ... The process i broadcasts the array tempintv to all other processes.
165  CALL mpi_bcast(tempintv(1), numtempproc(i), mpi_integer, i-1, rocstar_communicator, ierr)
166  ! ... Loop through the number of temperature BC nodes on process i and record them on
167  ! ... array GTempBC.
168  DO j = 1, numtempproc(i)
169  counter1 = counter1 + 1
170  gtempbc(counter1) = tempintv(j)
171  ENDDO
172  DEALLOCATE(tempintv)
173  ENDIF
174  ENDDO
175  print*,myid,' global disp bcs = ',gtempbc(:)
176 
177  ! ... convert Ceff to explicit form, CeffExplicit
178 
179  ! ... Allocate explicit matrix
180  ALLOCATE(ceffexplicit(nrows,ndim))
181 
182  ! ... initialize CeffExplicit
183  ceffexplicit = 0.0d0
184 
185  ! ... n is the CRS index for the aval and cval vectors
186  n = 1
187 
188  ! ... First loop through the rows i
189  DO i = 1, nrows
190  ! ... loop through the columns j
191  DO j = 1, ndim
192  ! ... is n in the index range for row i?
193  IF ((rp1(i) < n).AND.(rp1(i+1) >= n)) THEN
194  ! ... if this is the correct column corresponding to index n
195  IF (cval(n) == j - 1) THEN
196  ceffexplicit(i,j) = aval(n)
197  n = n + 1
198  ENDIF
199  ENDIF
200  ! ... if end of CRS vectors, no need to keep looping
201  IF (n > nnz) EXIT
202  ENDDO
203  ! ... if end of CRS vectors, no need to keep looping
204  IF (n > nnz) EXIT
205  ENDDO
206 
207 
208 
209  ! ... Partition matrix CeffExplicit into explicit forms of
210  ! ... - CeffFF: Free-free DOFs
211  ! ... - CeffPP: Prescribed-prescribed DOFs
212  ! ... - CeffPF: Prescribed-free DOFs
213  ! ... - CeffFP: Free-prescribed DOFs
214 
215  ! ... Allocate the partitioned matrices
216  ALLOCATE(ceffff(nrows - numdisp, ndim - gnumtemp))
217  ALLOCATE(ceffpp(numdisp,gnumtemp))
218  ALLOCATE(ceffpf(numdisp, ndim - gnumtemp))
219  ALLOCATE(cefffp(nrows - numdisp, gnumtemp))
220  ALLOCATE(ceff_fptp(nrows - numdisp))
221 
222  ! ... Begin partitioning
223  counter1 = 0
224  counter2 = 0
225 
226  ! ... outer loop through rows i
227  DO i = nstart, nstart + nrows - 1
228  ! ... iDOF stores the DOF number of the current essential BC
229  idof = 0
230 
231  ! ... reset the nmber of prescribed BSs counted in a row (counter 2)
232  counter2 = 0
233 
234  ! ... check the DOFs of all local prescribed BCs to see if they are in
235  ! ... this row
236  DO n = 1, numdisp
237 
238  IF(i == dispbc(n)) THEN
239  ! ... if i is a prescribed DOF, then increase row BC counter1
240  counter1 = counter1 + 1
241 
242 
243  ! ... if i is a prescribed DOF, then record the value of the DOF
244  idof = i
245 
246  ! ... stop searching through dispBC, i can only equal one of them
247  EXIT
248  ENDIF
249  ENDDO
250  jdof = 0
251  ! ... if row i corresponds to a prescribed DOF, then fill CeffPP and CeffPF
252  IF(idof > 0) THEN
253  ! ... loop through the columns in prescribed row i
254  DO j = 1, ndim
255  ! ... check the DOFs of all local prescribed BCs to see if they are in
256  ! ... this column, j
257  DO n = 1, gnumtemp
258  IF(j == gtempbc(n)) THEN
259  ! ... if i is a prescribed DOF, then increase column BC counter2
260  counter2 = counter2 + 1
261  ! ... if i is a prescribed DOF, then record the value of the dof
262  jdof = j
263  ! ... stop searching through dispBC, j can only equal one of them
264  EXIT
265  ENDIF
266  ENDDO
267  IF(jdof > 0) THEN
268  ! ... if row j corresponds to a prescribed DOF, then fill CeffPP
269 
270  ceffpp(counter1,counter2) = ceffexplicit(idof-nstart+1,jdof)
271 
272  ! ... reset jDOF for next loop
273  jdof = 0
274  ELSE
275 
276  ! ... if row j corresponds to a free DOF, then fill CeffPF
277  ceffpf(counter1,j-counter2) = ceffexplicit(idof-nstart+1,j)
278  ENDIF
279  ENDDO
280  ELSE
281  ! ... loop through the columns in free row i
282  DO j = 1, ndim
283 
284  ! ... check the DOFs of all local prescribed BCs to see if they are in
285  ! ... this column, j
286  DO n = 1, gnumtemp
287 
288  IF(j == gtempbc(n)) THEN
289  ! ... if i is a prescribed DOF, then increase column BC counter2
290  counter2 = counter2 + 1
291  ! ... if i is a prescribed DOF, then record the value of the dof
292  jdof = j
293  ! ... stop searching through dispBC, j can only equal one of them
294  EXIT
295  ENDIF
296  ENDDO
297 
298 
299  IF(jdof > 0) THEN
300  ! ... if row j corresponds to a prescribed DOF
301  cefffp(i-counter1-nstart+1,counter2) = ceffexplicit(i-nstart+1,jdof)
302 
303  ! ... reset jDOF for next loop
304  jdof = 0
305  ELSE
306  ! ... if row j corresponds to a free DOF, then fill CeffFF
307  ceffff(i-counter1-nstart+1,j-counter2) = ceffexplicit(i-nstart+1,j)
308  ENDIF
309  ENDDO
310  ENDIF
311  ENDDO
312 
313  ! ... Now convert CeffFF back to CRS format
314 
315  ! ... Count nonzeros in new matrix
316  nnz_temp = 0
317  counter2 = 0
318  ! ... Loop throught the number of rows on this process
319  DO i = 1, nrows
320  ! ... Loop from the beginning to the end of each row, keeping track for the column
321  ! ... index using counter2.
322  DO j = rp1(i)+1, rp1(i+1)
323  counter2 = counter2 + 1
324  counter1 = 0
325  DO m = 1, gnumtemp
326  ! ... If the global index of a temperature BC matches either the row or column
327  ! ... indices, then do not increment the number of non-zeros.
328  IF((gtempbc(m) == i + nstart - 1).OR.(gtempbc(m) == cval(counter2)+1)) THEN
329  counter1 = 1
330  ENDIF
331  ENDDO
332 
333  IF(counter1 == 0) nnz_temp = nnz_temp + 1
334  ENDDO
335  ENDDO
336 
337  ! ... Count rows in new matrix
338  newnrows = 0
339  counter2 = 0
340  ! ... Loop throught the number of rows on this process
341  DO i = 1, nrows
342  counter1 = 0
343  DO m = 1, gnumtemp
344  ! ... If the global index of a termperature BC matches the row index, then
345  ! ... do not increment the new number of rows on this process.
346  IF(gtempbc(m) == i + nstart - 1) THEN
347  counter1 = 1
348  ENDIF
349  ENDDO
350  if(counter1==1) print*,myid,' row removed at ',i+nstart-1
351  IF(counter1 == 0) newnrows = newnrows + 1
352  ENDDO
353 
354  ! ... Allocate variables for new matrix
355  ALLOCATE(rp_temp(1:newnrows+1))
356  ALLOCATE(cval_temp(1:nnz_temp))
357  ALLOCATE(aval_temp(1:nnz_temp))
358 
359  ! ... n is the CRS index for the vectors aval_temp and cval_temp
360  n = 0
361  ! ... loop through the rows in the matrix CeffFF
362  DO i = 1, newnrows
363  rp_temp(i) = n
364  ! ... loop through the columns in the matrix CeffFF
365  DO j = 1, newndim
366  ! ... check for a non-zero at i,j in CeffFF
367  IF (ceffff(i,j) > 0.0d0) THEN
368  n = n + 1
369  ! ... if there is a non-zero, it is entered into position n of
370  ! ... aval_temp and the column j(-1) is entered into positon n
371  ! ... of cval_temp
372  aval_temp(n) = ceffff(i,j)
373  cval_temp(n) = j - 1
374  ENDIF
375  ENDDO
376  ENDDO
377  ! ... fill in the last entry of rp_temp
378 
379  rp_temp(newnrows+1) = nnz_temp
380 
381 
382 
383  ! ... multiply CeffFP with the global prescribed temperature vector
384  CALL prescribedload(nrows,nstart,numdisp,dispbc,cefffp,proctemp)
385 
386 
387 
388 END SUBROUTINE partition_ceff
389 
390 
391 !!****
392 !!
393 !! NAME
394 !! PrescribedLoad
395 !!
396 !! FUNCTION
397 !! This subroutine multiplies the Free-Prescribed partition of the effective thermal capacitance
398 !! matrix with the list of global prescribed temperatures.
399 !!
400 !! INPUTS
401 !! ncols -- The number of columns in Ceff_fp, same as number of prescribed temperatures
402 !! nrows -- The number of rows in Ceff_fp
403 !! nstart -- The global index of the first row assigned to this processor
404 !! GNumTemp -- The global number of prescribed temperatures
405 !! GTempBC -- Vector containing global nodes of the prescribed temperatures
406 !! NumpTemp -- The local number of prescribed temperatures
407 !! TempBC -- Vector containing local nodes of the prescribed temperatures
408 !! Ceff_fp -- The free-perscribed partition of the effective thermal capacitance matrix
409 !! ProcTemp -- The part of the global temperature vector that's assigned to this processor
410 !!
411 !! OUTPUTS
412 !! Ceff_fpTp -- The product of Ceff_fp and the global prescribed temperature vector
413 !!
414 !! USES
415 !! MPI
416 !!
417 !!****
418 
419 SUBROUTINE prescribedload(nrows,nstart,NumTemp,TempBC,Ceff_fp,ProcTemp)
420 
421  USE precision
422  USE implicit_global
423  USE comp_row_global
425  USE removebcs_global
426 
427  IMPLICIT NONE
428 
429  include 'mpif.h'
430 
431  ! ... Input variables
432  ! ... the Ceff_fp matrix
433  INTEGER :: nrows, numtemp
434  REAL(kind=wp), DIMENSION(nrows-NumTemp,GNumTemp) :: ceff_fp
435  ! ... the local temperature boundary condions
436  INTEGER, DIMENSION(NumTemp) :: tempbc
437  ! ... first row of this processor
438  INTEGER :: nstart
439  ! ... all temperatures on this processor
440  REAL(kind=wp), DIMENSION(LNumNp) :: proctemp
441 
442  ! ... Internal variables
443  ! ... the prescribed temperature vector
444  REAL(kind=wp), DIMENSION(GNumTemp) :: gtempbcvalue
445 
446  ! ... communication
447  REAL(kind=wp), DIMENSION(GNumNp) :: temptemp
448  INTEGER, ALLOCATABLE, DIMENSION(:) :: numtempfrom
449  REAL(kind=wp), ALLOCATABLE, DIMENSION(:) :: bufsnd
450  INTEGER :: i, j, k, m, counter1, counter2
451  REAL(kind=wp) :: tempval
452  INTEGER, ALLOCATABLE, DIMENSION(:) :: req_rcv, req_snd
453  INTEGER, ALLOCATABLE, DIMENSION(:,:) :: stat_rcv, stat_snd
454 
455  !
456  ! Communicate how many pieces of temp to send to each other proc
457  !
458 
459  IF ( nprocs > 1) THEN
460 
461  CALL mpi_barrier(rocstar_communicator,ierr)
462  ALLOCATE(req_rcv(1:nprocs))
463  ALLOCATE(req_snd(1:nprocs))
464  ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
465  ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
466  ALLOCATE(numtempfrom(1:nprocs))
467  DO i = 1, nprocs
468  req_rcv(i) = 0
469  req_snd(i) = 0
470  DO j = 1, mpi_status_size
471  stat_rcv(j,i) = 0
472  stat_snd(j,i) = 0
473  ENDDO
474  ENDDO
475  DO i = 1, nprocs
476  IF (i-1 /= myid) THEN
477  CALL mpi_irecv(numtempfrom(i),1, &
478  mpi_integer,i-1,10,rocstar_communicator, &
479  req_rcv(i),ierr)
480  ENDIF
481  ENDDO
482  DO i = 1, nprocs
483  IF (i-1 /= myid) THEN
484  !CALL MPI_ISEND(nrows,1,MPI_INTEGER, &
485  ! i-1,10,ROCSTAR_COMMUNICATOR,req_snd(i),ierr)
486  CALL mpi_send(nrows,1,mpi_integer, &
487  i-1,10,rocstar_communicator,ierr)
488  ENDIF
489  ENDDO
490  CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
491  !CALL MPI_WAITALL(nprocs,req_snd,stat_snd,ierr)
492  DEALLOCATE(req_rcv)
493  DEALLOCATE(req_snd)
494  DEALLOCATE(stat_snd)
495  DEALLOCATE(stat_rcv)
496 
497 
498  !
499  ! Communicate temperature to all the other procs
500  !
501 
502  ! ... receive
503  CALL mpi_barrier(rocstar_communicator,ierr)
504  ALLOCATE(req_rcv(1:nprocs))
505  ALLOCATE(req_snd(1:nprocs))
506  ALLOCATE(stat_snd(1:mpi_status_size,1:nprocs))
507  ALLOCATE(stat_rcv(1:mpi_status_size,1:nprocs))
508  DO i = 1, nprocs
509  req_rcv(i) = 0
510  req_snd(i) = 0
511  DO j = 1, mpi_status_size
512  stat_rcv(j,i) = 0
513  stat_snd(j,i) = 0
514  ENDDO
515  ENDDO
516  ALLOCATE(frmproc(1:nprocs))
517  DO i = 1, nprocs
518  ! ... if processor i is not this processor (i=1=processor 0)
519  IF (i-1 /= myid) THEN
520  ! ... Allocate a buffer of size 2 times the number of nodes from
521  ! ... processor j. The buffer is orgnized as {node #, temp, node #, temp...}
522  ALLOCATE(frmproc(i)%rcvbuf(1:2*int(numtempfrom(i))))
523  CALL mpi_irecv(frmproc(i)%rcvbuf(1),2*int(numtempfrom(i)), &
524  mpi_double_precision,i-1,10,rocstar_communicator, &
525  req_rcv(i),ierr)
526  ENDIF
527  ENDDO
528 
529  ! ... send
530  DO i = 1, nprocs
531  IF (i-1 /= myid) THEN
532  ! ... if processor i is not this processor
533  ! ... allocate a buffer 2 times the number of the nodes
534  ! ... on this processor to send to processor i
535  ALLOCATE(bufsnd(1:2*lnumnp))
536  counter1 = 0
537  DO j = 1, gnumnp
538  ! ... if global node j belongs to this processor
539  ! ... then the corresponding temperature is copied
540  ! ... to a buffer to go to processor i
541  IF ((global2local(j) /= -1) .AND. (nodeproc(global2local(j)) == myid)) THEN
542  ! ... if global node j belongs to this processor
543  ! ... then counter1 determines the index in ProcTemp where
544  ! ... the corresponding temperature is stored
545  counter1 = counter1 + 1
546  bufsnd(2*counter1-1) = j
547  bufsnd(2*counter1) = proctemp(counter1)
548  ENDIF
549  ENDDO
550  !CALL MPI_ISEND(bufsnd,4*INT(nrows/3),MPI_DOUBLE_PRECISION, &
551  ! i-1,10,ROCSTAR_COMMUNICATOR,req_snd(i),ierr)
552 
553  ! ... send the buffer of length 2*nodes on this processor
554  ! ... to processor (i-1).
555  CALL mpi_send(bufsnd,2*nrows,mpi_double_precision, &
556  i-1,10,rocstar_communicator,ierr)
557  DEALLOCATE(bufsnd)
558  ENDIF
559  ENDDO
560  !CALL MPI_WAITALL(NumCommProcsFrom2,req_rcv,stat_rcv,ierr)
561  !CALL MPI_WAITALL(NumCommProcs2,req_snd,stat_snd,ierr)
562  CALL mpi_waitall(nprocs,req_rcv,stat_rcv,ierr)
563  !CALL MPI_WAITALL(nprocs,req_snd,stat_snd,ierr)
564  DEALLOCATE(req_rcv)
565  DEALLOCATE(req_snd)
566  DEALLOCATE(stat_snd)
567  DEALLOCATE(stat_rcv)
568 
569  ENDIF
570 
571  ! ... create a global temperature vector
572  DO i = 1, gnumnp
573  ! ... if global node i belongs to this processor
574  ! ... then the corresponding temperature is copied
575  ! ... in from the input array ProcTemp
576  IF ((global2local(i) /= -1) .AND. (nodeproc(global2local(i)) == myid)) THEN
577  temptemp( i ) = proctemp( i - (nstart-1))
578  ELSE
579 
580  ! ... if global node i does not belong to this processor
581  ! ... then find which processor it does belong to
582  ! ... and get the temperature from the buffer received from
583  ! ... that processor
584  DO j = 1, nprocs
585  IF (j-1 /= myid) THEN
586  ! ... loop through the number of temperature values from processor j
587  DO m = 1, numtempfrom(j)
588  ! ... frmproc(j)%rcvbuf(2*m-1) is where the node number
589  ! ... is stored for the temperature value stored at
590  ! ... frmproc(j)%rcvbuf(2*m)
591  IF (int(frmproc(j)%rcvbuf(2*m-1)) == i) THEN
592  temptemp( i ) = frmproc(j)%rcvbuf(2*m)
593  ENDIF
594  ENDDO
595  ENDIF
596  ENDDO
597  ENDIF
598  ENDDO
599  IF (nprocs > 1) DEALLOCATE(frmproc)
600 
601 
602  ! ... Get only the prescribed temperatures
603  ! ... put in GTempBCValues
604  DO i = 1, gnumnp
605  ! ... loop through prescribed temperature nodes
606  DO j = 1, gnumtemp
607  IF (i == gtempbc(j)) THEN
608  gtempbcvalue(j)= temptemp(i)
609  ENDIF
610  ENDDO
611  ENDDO
612 
613 ceff_fptp = 0.0d0
614 
615  ! ... multiply Ceff_fp with GTempBCValue
616  DO i = 1, nrows-numtemp
617  DO j = 1, gnumtemp
618  ceff_fptp(i) = ceff_fptp(i) + ceff_fp(i,j) * gtempbcvalue(j)
619  ENDDO
620  ENDDO
621 
622 
623 END SUBROUTINE prescribedload
624 
625 
626 
627 
FT m(int i, int j) const
j indices k indices k
Definition: Indexing.h:6
blockLoc i
Definition: read.cpp:79
const NT & n
virtual std::ostream & print(std::ostream &os) const
subroutine partition_ceff(ndim, nrows, nnz, nstart, rp1, cval, aval, newnrows, newnstart, newndim, ProcTemp, global)
j indices j
Definition: Indexing.h:6
subroutine prescribedload(nrows, nstart, NumTemp, TempBC, Ceff_fp, ProcTemp)