source: CIVL/examples/fortran/nek5000/core/cvode_aux.h

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 1.6 KB
Line 
1 subroutine cvunpack(w1,y)
2c
3c copy the internal cvode vector y to nek array w1
4c
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
26c----------------------------------------------------------------------
27 subroutine cvpack(y,w1,ifrhs)
28c
29c copy the nek array w1 to the internal cvode vector y
30c note: assumes temperature is stored in ifield=2 (only for ifdp0dt)
31c
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
Note: See TracBrowser for help on using the repository browser.