KTH framework for Nek5000 toolboxes; testing version  0.0.1
navier0.f
Go to the documentation of this file.
1  SUBROUTINE esolver (RES,H1,H2,H2INV,INTYPE)
2 C---------------------------------------------------------------------
3 C
4 C Choose E-solver
5 C
6 C--------------------------------------------------------------------
7  include 'SIZE'
8  include 'ESOLV'
9  include 'INPUT'
10 C
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
45 c-----------------------------------------------------------------------
46  subroutine dmp_map(imap)
47 c
48 c Dump map file and element center point
49 c
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
75 c-----------------------------------------------------------------------
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
130 c-----------------------------------------------------------------------
void exitt()
Definition: comm_mpi.f:604
subroutine crecv2(mtype, buf, lenm, jnid)
Definition: comm_mpi.f:333
subroutine nekgsync()
Definition: comm_mpi.f:502
subroutine csend(mtype, buf, len, jnid, jpid)
Definition: comm_mpi.f:303
real *8 function dnekclock()
Definition: comm_mpi.f:393
integer function gllel(ieg)
Definition: dprocmap.f:183
integer function gllnid(ieg)
Definition: dprocmap.f:161
subroutine uzawa_gmres(res, h1, h2, h2inv, intype, iter)
Definition: gmres.f:3
subroutine icopy(a, b, n)
Definition: math.f:289
subroutine copy(a, b, n)
Definition: math.f:260
subroutine dmp_map(imap)
Definition: navier0.f:47
subroutine esolver(RES, H1, H2, H2INV, INTYPE)
Definition: navier0.f:2
subroutine p_outvec_ir(ia, a, lda, name9)
Definition: navier0.f:77
subroutine uzawa(rcg, h1, h2, h2inv, intype, iter)
Definition: navier1.f:2827
subroutine ortho(respr)
Definition: navier1.f:224