KTH framework for Nek5000 toolboxes; testing version  0.0.1
navier3.f
Go to the documentation of this file.
1  SUBROUTINE eprec2(Z2,R2)
2 C----------------------------------------------------------------
3 C
4 C Precondition the explicit pressure operator (E) with
5 C a Neumann type (H1) Laplace operator: JT*A*J.
6 C Invert A by conjugate gradient iteration or multigrid.
7 C
8 C NOTE: SCRNS is used.
9 C
10 C----------------------------------------------------------------
11  include 'SIZE'
12  include 'INPUT'
13  include 'GEOM'
14  include 'SOLN'
15  include 'MASS'
16  include 'PARALLEL'
17  include 'TSTEP'
18  REAL Z2 (LX2,LY2,LZ2,LELV)
19  REAL R2 (LX2,LY2,LZ2,LELV)
20  COMMON /scrns/ mask(lx1,ly1,lz1,lelv)
21  $ ,r1(lx1,ly1,lz1,lelv)
22  $ ,x1(lx1,ly1,lz1,lelv)
23  $ ,w2(lx2,ly2,lz2,lelv)
24  $ ,h1(lx1,ly1,lz1,lelv)
25  $ ,h2(lx1,ly1,lz1,lelv)
26  REAL MASK
27 c
28  integer icalld
29  save icalld
30  data icalld/0/
31  icalld=icalld+1
32 c
33  ntot2 = lx2*ly2*lz2*nelv
34  call rzero(z2,ntot2)
35 c
36 c
37 c
38 c
39 c Both local and global solver...
40  call dd_solver (z2,r2)
41 c
42 c
43 c
44 c Local solver only
45 c call local_solves_fdm (z2,r2)
46 c
47 c
48 c
49  return
50  end
51 c-----------------------------------------------------------------------
52  subroutine dd_solver(u,v)
53 c
54  include 'SIZE'
55  include 'DOMAIN'
56  include 'INPUT'
57  include 'PARALLEL'
58  include 'SOLN'
59  include 'CTIMER'
60 c
61  real u(1),v(1)
62  common /scrprc/ uc(lx1*ly1*lz1*lelt)
63 c
64  if (icalld.eq.0) then
65  tddsl=0.0
66  tcrsl=0.0
67  nddsl=0
68  ncrsl=0
69  endif
70  icalld = icalld + 1
71  nddsl = nddsl + 1
72  ncrsl = ncrsl + 1
73 
74  ntot = lx2*ly2*lz2*nelv
75  call rzero(u,ntot)
76 
77  etime1=dnekclock()
78  call local_solves_fdm (u,v)
79  tddsl=tddsl+dnekclock()-etime1
80 
81  etime1=dnekclock()
82  call crs_solve_l2 (uc,v)
83  tcrsl=tcrsl+dnekclock()-etime1
84 
85  alpha = 10.
86 c if (param(89).ne.0.) alpha = abs(param(89))
87  call add2s2(u,uc,alpha,ntot)
88 
89  return
90  end
91 c-----------------------------------------------------------------------
92  subroutine rar2_out(x,name13)
93  include 'SIZE'
94 c
95  real x(lx2,ly2,lz2,lelt)
96  character*13 name13
97 c
98  if (nelv.gt.20) return
99  write(6,*)
100  write(6,1) name13
101  1 format(a13)
102  if (nelv.gt.2) then
103  write(6,*)
104  do j=ly2,1,-1
105  write(6,6) (x(k,j,1,3),k=1,lx2),(x(k,j,1,4),k=1,lx2)
106  enddo
107  write(6,*)
108  write(6,*)
109  endif
110 c
111  do j=ly2,1,-1
112  write(6,6) (x(k,j,1,1),k=1,lx2),(x(k,j,1,2),k=1,lx2)
113  enddo
114  write(6,*)
115  6 format(3f8.4,5x,3f8.4)
116  return
117  end
118 c-----------------------------------------------------------------------
119  subroutine rarr_out2(x,name13)
120  include 'SIZE'
121  include 'INPUT'
122 c
123  real x(lx2,ly2,lz2,lelt)
124  character*13 name13
125 c
126  if (nelv.gt.20) return
127  write(6,*)
128  write(6,1) name13
129  1 format('rarr2',3x,a13)
130 c
131 c 3 D
132 c
133  if (if3d) then
134  do iz=1,lz1
135  write(6,*)
136  do j=ly1,1,-1
137  write(6,3) (x(k,j,iz,1),k=1,lx2),(x(k,j,iz,2),k=1,lx2)
138  enddo
139  enddo
140  write(6,*)
141  write(6,*)
142  return
143  endif
144 c
145 c 2 D
146 c
147  if (nelv.gt.2) then
148  write(6,*)
149  do j=ly2,1,-1
150  write(6,6) (x(k,j,1,3),k=1,lx2),(x(k,j,1,4),k=1,lx2)
151  enddo
152  write(6,*)
153  write(6,*)
154  endif
155 c
156  do j=ly2,1,-1
157  write(6,6) (x(k,j,1,1),k=1,lx2),(x(k,j,1,2),k=1,lx2)
158  enddo
159  write(6,*)
160  3 format(4f6.2,5x,4f6.2)
161  6 format(4f8.5,5x,4f8.5)
162  return
163  end
164 c-----------------------------------------------------------------------
real *8 function dnekclock()
Definition: comm_mpi.f:393
subroutine local_solves_fdm(u, v)
Definition: fasts.f:3
subroutine add2s2(a, b, c1, n)
Definition: math.f:690
subroutine rzero(a, n)
Definition: math.f:208
subroutine rar2_out(x, name13)
Definition: navier3.f:93
subroutine eprec2(Z2, R2)
Definition: navier3.f:2
subroutine rarr_out2(x, name13)
Definition: navier3.f:120
subroutine dd_solver(u, v)
Definition: navier3.f:53
subroutine crs_solve_l2(uf, vf)
Definition: navier8.f:38