eTurb
cvode_aux.h
Go to the documentation of this file.
1  subroutine cvunpack(w1,w1p,y)
2 c
3 c copy the internal cvode vector y to nek array w1 and w1p
4 c
5  include 'SIZE'
6  include 'TOTAL'
7  include 'CVODE'
8 
9  real w1(lx1,ly1,lz1,lelt,*)
10  real w1p
11  real y(*)
12 
13  nxyz = lx1*ly1*lz1
14 
15  j = 1
16  do ifield = 2,nfield
17  if (ifcvfld(ifield)) then
18  ntot = nxyz*nelfld(ifield)
19  call copy (w1(1,1,1,1,ifield-1),y(j),ntot)
20  call bcdirsc(w1(1,1,1,1,ifield-1)) ! restore dirichlet bcs
21  j = j + ntot
22  endif
23  enddo
24 
25  if (ifdp0dt) then
26  w1p = y(j)
27  j = j + 1
28  endif
29 
30  return
31  end
32 c----------------------------------------------------------------------
33  subroutine cvpack(y,w1,w1p,ifrhs)
34 c
35 c copy the nek array w1 and w1p to the internal cvode vector y
36 c note: assumes temperature is stored in ifield=2 (only for ifdp0dt)
37 c
38  include 'SIZE'
39  include 'TOTAL'
40  include 'CVODE'
41 
42  real y(*)
43  real w1(lx1,ly1,lz1,lelt,*)
44  real w1p
45  logical ifrhs
46 
47  common /scrsf/ dtmp(lx1,ly1,lz1,lelt)
48 
49 
50  nxyz = lx1*ly1*lz1
51 
52  if (ifrhs .and. ifdp0dt) then
53  call qthermal ! computes dp0thdt
54  dd = (gamma0 - 1.)/gamma0
55  dd = dd * dp0thdt
56  ntot = nxyz*nelfld(2)
57  call invers2(dtmp,vtrans(1,1,1,1,2),ntot)
58  call cmult(dtmp,dd,ntot)
59  call add2 (w1,dtmp,ntot)
60  endif
61 
62  j = 1
63  do ifield = 2,nfield
64  if (ifcvfld(ifield)) then
65  ntot = nxyz*nelfld(ifield)
66  call copy (y(j),w1(1,1,1,1,ifield-1),ntot)
67  if (ifrhs) call col2(y(j),tmask(1,1,1,1,ifield-1),ntot)
68  j = j + ntot
69  endif
70  enddo
71 
72  if (ifdp0dt) then
73  y(j) = w1p
74  if (ifrhs) y(j) = w1p
75  endif
76 
77  return
78  end
79 
subroutine ly1
Definition: cvode_aux.h:9
subroutine bcdirsc(S)
Definition: bdry.f:725
subroutine add2(a, b, n)
Definition: math.f:599
subroutine qthermal
Definition: plan4.f:562
subroutine copy(a, b, n)
Definition: math.f:237
subroutine lz1
Definition: cvode_aux.h:9
subroutine cmult(a, const, n)
Definition: math.f:292
subroutine lelt
Definition: cvode_aux.h:9
subroutine invers2(a, b, n)
Definition: math.f:35
subroutine cvunpack(w1, w1p, y) c c copy the internal cvode vector y to nek array w1 and w1p c include 'SIZE' include 'TOTAL' include 'CVODE' real w1(lx1
subroutine col2(a, b, n)
Definition: math.f:541