| 1 | subroutine cvunpack(w1,y)
|
|---|
| 2 | c
|
|---|
| 3 | c copy the internal cvode vector y to nek array w1
|
|---|
| 4 | c
|
|---|
| 5 | include 'SIZE'
|
|---|
| 6 | include 'TOTAL'
|
|---|
| 7 | include 'CVODE'
|
|---|
| 8 |
|
|---|
| 9 | real w1(lx1,ly1,lz1,lelt,*)
|
|---|
| 10 | real y(*)
|
|---|
| 11 |
|
|---|
| 12 | nxyz = lx1*ly1*lz1
|
|---|
| 13 |
|
|---|
| 14 | j = 1
|
|---|
| 15 | do ifield = 2,nfield
|
|---|
| 16 | if (ifcvfld(ifield)) then
|
|---|
| 17 | ntot = nxyz*nelfld(ifield)
|
|---|
| 18 | call copy (w1(1,1,1,1,ifield-1),y(j),ntot)
|
|---|
| 19 | call bcdirsc(w1(1,1,1,1,ifield-1)) ! restore dirichlet bcs
|
|---|
| 20 | j = j + ntot
|
|---|
| 21 | endif
|
|---|
| 22 | enddo
|
|---|
| 23 |
|
|---|
| 24 | return
|
|---|
| 25 | end
|
|---|
| 26 | c----------------------------------------------------------------------
|
|---|
| 27 | subroutine cvpack(y,w1,ifrhs)
|
|---|
| 28 | c
|
|---|
| 29 | c copy the nek array w1 to the internal cvode vector y
|
|---|
| 30 | c note: assumes temperature is stored in ifield=2 (only for ifdp0dt)
|
|---|
| 31 | c
|
|---|
| 32 | include 'SIZE'
|
|---|
| 33 | include 'TOTAL'
|
|---|
| 34 | include 'CVODE'
|
|---|
| 35 |
|
|---|
| 36 | real y(*)
|
|---|
| 37 | real w1(lx1,ly1,lz1,lelt,*)
|
|---|
| 38 | logical ifrhs
|
|---|
| 39 |
|
|---|
| 40 | common /scrsf/ dtmp(lx1,ly1,lz1,lelt)
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | nxyz = lx1*ly1*lz1
|
|---|
| 44 |
|
|---|
| 45 | if (ifrhs .and. ifdp0dt) then
|
|---|
| 46 | call qthermal ! computes dp0thdt
|
|---|
| 47 | dd = (gamma0 - 1.)/gamma0
|
|---|
| 48 | dd = dd * dp0thdt
|
|---|
| 49 | ntot = nxyz*nelfld(2)
|
|---|
| 50 | call invers2(dtmp,vtrans(1,1,1,1,2),ntot)
|
|---|
| 51 | call cmult(dtmp,dd,ntot)
|
|---|
| 52 | call add2 (w1,dtmp,ntot)
|
|---|
| 53 | endif
|
|---|
| 54 |
|
|---|
| 55 | j = 1
|
|---|
| 56 | do ifield = 2,nfield
|
|---|
| 57 | if (ifcvfld(ifield)) then
|
|---|
| 58 | ntot = nxyz*nelfld(ifield)
|
|---|
| 59 | call copy (y(j),w1(1,1,1,1,ifield-1),ntot)
|
|---|
| 60 | if (ifrhs) call col2(y(j),tmask(1,1,1,1,ifield-1),ntot)
|
|---|
| 61 | j = j + ntot
|
|---|
| 62 | endif
|
|---|
| 63 | enddo
|
|---|
| 64 |
|
|---|
| 65 | return
|
|---|
| 66 | end
|
|---|