source: CIVL/examples/fortran/nek5000/core/navier0.f

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: 3.3 KB
Line 
1 SUBROUTINE ESOLVER (RES,H1,H2,H2INV,INTYPE)
2C---------------------------------------------------------------------
3C
4C Choose E-solver
5C
6C--------------------------------------------------------------------
7 INCLUDE 'SIZE'
8 INCLUDE 'ESOLV'
9 INCLUDE 'INPUT'
10C
11 REAL RES (LX2,LY2,LZ2,LELV)
12 REAL H1 (LX1,LY1,LZ1,LELV)
13 REAL H2 (LX1,LY1,LZ1,LELV)
14 REAL H2INV (LX1,LY1,LZ1,LELV)
15 common /scruz/ wk1(lx2*ly2*lz2*lelv)
16 $ , wk2(lx2*ly2*lz2*lelv)
17 $ , wk3(lx2*ly2*lz2*lelv)
18
19 include 'CTIMER'
20 real kwave2
21
22 if (icalld.eq.0) teslv=0.0
23
24 call ortho(res) !Ensure that residual is orthogonal to null space
25
26 icalld=icalld+1
27 neslv=icalld
28 etime1=dnekclock()
29
30 if (.not. ifsplit) then
31 if (param(42).eq.1) then
32 CALL UZAWA (RES,H1,H2,H2INV,INTYPE,ICG)
33 else
34 call uzawa_gmres(res,h1,h2,h2inv,intype,icg)
35 endif
36 else
37 WRITE(6,*) 'ERROR: E-solver does not exist PnPn'
38 CALL EXITT
39 ENDIF
40
41 teslv=teslv+(dnekclock()-etime1)
42
43 RETURN
44 END
45c-----------------------------------------------------------------------
46 subroutine dmp_map(imap)
47c
48c Dump map file and element center point
49c
50 include 'SIZE'
51 include 'TOTAL'
52
53 common /ivrtx/ vertex ((2**ldim)*lelt)
54 common /scruz/ xbar(ldim,lelt),ibar(lelt)
55 integer vertex
56 integer imap(nelgt)
57
58 integer e,eg
59
60 nxb = (lx1+1)/2
61 nyb = (ly1+1)/2
62 nzb = (lz1+1)/2
63
64 do e=1,nelt
65 xbar(ldim,e) = zm1(nxb,nyb,nzb,e)
66 xbar(1 ,e) = xm1(nxb,nyb,nzb,e)
67 xbar(2 ,e) = ym1(nxb,nyb,nzb,e)
68 eg = lglel(e)
69 ibar(e) = imap(eg)
70 enddo
71 call p_outvec_ir(ibar,xbar,ldim,'mpxyz.dat')
72
73 return
74 end
75c-----------------------------------------------------------------------
76 subroutine p_outvec_ir(ia,a,lda,name9)
77 integer ia(1)
78 real a(lda,1)
79 character*9 name9
80
81 include 'SIZE'
82 include 'TOTAL'
83
84 parameter (lbuf=50)
85 common /scbuf/ buf(lbuf)
86 integer ibuf(10),e,eg
87 equivalence (buf,ibuf)
88
89 if (nid.eq.0) then
90 open(unit=49,file=name9)
91 write(6,*) 'Opening ',name9,' in p_outveci. lda=',lda
92 endif
93
94 len = wdsize*(lda+1)
95 dum = 0.
96
97 do eg=1,nelgt
98
99 mid = gllnid(eg)
100 e = gllel (eg)
101 mtype = 2000+e
102
103 if (nid.eq.0) then
104 if (mid.eq.0) then
105 call icopy(buf(1),ia(e),1)
106 call copy(buf(2),a(1,e),lda)
107 else
108 call csend (mtype,dum,wdsize,mid,nullpid)
109 call crecv2 (mtype,buf,len,mid)
110 endif
111 write(49,49) mid,ibuf(1),(buf(k+1),k=1,lda)
112 49 format(2i12,1p3e16.7)
113 elseif (nid.eq.mid) then
114 call icopy(buf(1),ia(e),1)
115 call copy(buf(2),a(1,e),lda)
116 call crecv2 (mtype,dum,wdsize,0)
117 call csend (mtype,buf,len,node0,nullpid)
118 endif
119 enddo
120
121 if (nid.eq.0) then
122 close(49)
123 write(6,*) 'Done writing to ',name9,' p_outveci.'
124 endif
125
126 call nekgsync()
127
128 return
129 end
130c-----------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.