source: CIVL/examples/fortran/nek5000/core/navier3.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.7 KB
Line 
1 SUBROUTINE EPREC2(Z2,R2)
2C----------------------------------------------------------------
3C
4C Precondition the explicit pressure operator (E) with
5C a Neumann type (H1) Laplace operator: JT*A*J.
6C Invert A by conjugate gradient iteration or multigrid.
7C
8C NOTE: SCRNS is used.
9C
10C----------------------------------------------------------------
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
27c
28 integer icalld
29 save icalld
30 data icalld/0/
31 icalld=icalld+1
32c
33 ntot2 = lx2*ly2*lz2*nelv
34 call rzero(z2,ntot2)
35c
36c
37c
38c
39c Both local and global solver...
40 call dd_solver (z2,r2)
41c
42c
43c
44c Local solver only
45c call local_solves_fdm (z2,r2)
46c
47c
48c
49 return
50 end
51c-----------------------------------------------------------------------
52 subroutine dd_solver(u,v)
53c
54 include 'SIZE'
55 include 'DOMAIN'
56 include 'INPUT'
57 include 'PARALLEL'
58 include 'SOLN'
59 include 'CTIMER'
60c
61 real u(1),v(1)
62 common /scrprc/ uc(lx1*ly1*lz1*lelt)
63c
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.
86c if (param(89).ne.0.) alpha = abs(param(89))
87 call add2s2(u,uc,alpha,ntot)
88
89 return
90 end
91c-----------------------------------------------------------------------
92 subroutine rar2_out(x,name13)
93 include 'SIZE'
94c
95 real x(lx2,ly2,lz2,lelt)
96 character*13 name13
97c
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
110c
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
118c-----------------------------------------------------------------------
119 subroutine rarr_out2(x,name13)
120 include 'SIZE'
121 include 'INPUT'
122c
123 real x(lx2,ly2,lz2,lelt)
124 character*13 name13
125c
126 if (nelv.gt.20) return
127 write(6,*)
128 write(6,1) name13
129 1 format('rarr2',3x,a13)
130c
131c 3 D
132c
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
144c
145c 2 D
146c
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
155c
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
164c-----------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.