xref: /phasta/phSolver/incompressible/asigmr.f (revision 595995161822a203c8467e0e4a253d7bd7d6df32)
1        subroutine AsIGMR (y,       ac,      x,       xmudmi,
2     &                     shp,     shgl,    ien,
3     &                     res,     qres,
4     &                     xKebe,   xGoC,    rerr, CFLworst)
5c
6c----------------------------------------------------------------------
7c
8c This routine computes and assembles the data corresponding to the
9c  interior elements.
10c
11c Zdenek Johan, Winter 1991.  (Fortran 90)
12c----------------------------------------------------------------------
13c
14      use stats
15      use rlssave  ! Use the resolved Leonard stresses at the nodes.
16      use timedata    ! time series
17      use turbsa                ! access to d2wall
18
19
20      include "common.h"
21c
22        dimension y(nshg,ndofl),              ac(nshg,ndofl),
23     &            x(numnp,nsd),
24     &            shp(nshl,ngauss),            shgl(nsd,nshl,ngauss),
25     &            ien(npro,nshl),
26     &            res(nshg,nflow),
27     &            qres(nshg,idflx)
28
29c
30        dimension yl(npro,nshl,ndofl),         acl(npro,nshl,ndofl),
31     &            xl(npro,nenl,nsd),           dwl(npro,nenl),
32     &            rl(npro,nshl,nflow),
33     &            ql(npro,nshl,idflx)
34c
35        dimension xKebe(npro,9,nshl,nshl),
36     &            xGoC(npro,4,nshl,nshl)
37c
38        dimension rlsl(npro,nshl,6)
39
40c
41        real*8    lStsVec(npro,nshl,nResDims)
42
43        dimension xmudmi(npro,ngauss)
44        dimension sgn(npro,nshl)
45        dimension CFLworst(npro)
46c
47        real*8 rerrl(npro,nshl,6), rerr(nshg,10)
48c
49c.... gather the variables
50c
51c
52c.... get the matrix of mode signs for the hierarchic basis functions.
53c
54        if (ipord .gt. 1) then
55           call getsgn(ien,sgn)
56        endif
57
58        call localy(y,      yl,     ien,    ndofl,  'gather  ')
59        call localy(ac,    acl,     ien,    ndofl,  'gather  ')
60        call localx(x,      xl,     ien,    nsd,    'gather  ')
61        call local (qres,   ql,     ien,    idflx,  'gather  ')
62        if (iRANS .eq. -2) then ! kay-epsilon
63           call localx (d2wall,   dwl,     ien,    1,     'gather  ')
64        endif
65
66        if( (iLES.gt.10).and.(iLES.lt.20)) then  ! bardina
67           call local (rls, rlsl,     ien,       6, 'gather  ')
68        else
69           rlsl = zero
70        endif
71
72c
73c.... zero the matrices if they are being recalculated
74c
75        if (lhs. eq. 1)  then
76           xKebe = zero
77           xGoC  = zero
78        endif
79c
80c.... get the element residuals, LHS matrix, and preconditioner
81c
82        rl     = zero
83
84        if(ierrcalc.eq.1) rerrl = zero
85
86        call e3  (yl,      acl,     dwl,     shp,
87     &            shgl,    xl,      rl,
88     &            ql,      xKebe,   xGoC,    xmudmi,
89     &            sgn,     rerrl,  rlsl,     CFLworst)
90c
91c.... assemble the statistics residual
92c
93        if ( stsResFlg .eq. 1 ) then
94           call e3StsRes ( xl, rl, lStsVec )
95           call local( stsVec, lStsVec, ien, nResDims, 'scatter ')
96        else
97c
98c.... assemble the residual
99c
100           call local (res,    rl,     ien,    nflow,  'scatter ')
101
102           if ( ierrcalc .eq. 1 ) then
103              call local (rerr, rerrl,  ien, 6, 'scatter ')
104           endif
105        endif
106c
107c.... end
108c
109        if (exts.and.ires.ne.2) then
110           if ((iter.eq.1).and.(mod(lstep,freq).eq.0)) then
111              call timeseries(yl,xl,ien,sgn)
112           endif
113        endif
114
115        return
116        end
117
118
119
120C^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121c-----------------------------------------------------------------------
122c=======================================================================
123
124
125        subroutine AsIGMRSclr(y,       ac,      x,
126     &                     shp,     shgl,    ien,
127     &                     res,     qres,    xSebe, xmudmi )
128c
129c----------------------------------------------------------------------
130c
131c This routine computes and assembles the data corresponding to the
132c  interior elements.
133c
134c Zdenek Johan, Winter 1991.  (Fortran 90)
135c----------------------------------------------------------------------
136c
137      use     turbSA
138      include "common.h"
139c
140        dimension y(nshg,ndofl),              ac(nshg,ndofl),
141     &            x(numnp,nsd),
142     &            shp(nshl,ngauss),            shgl(nsd,nshl,ngauss),
143     &            ien(npro,nshl),
144     &            res(nshg),                  qres(nshg,nsd)
145
146c
147        real*8    yl(npro,nshl,ndofl),        acl(npro,nshl,ndofl),
148     &            xl(npro,nenl,nsd),
149     &            rl(npro,nshl),              ql(npro,nshl,nsd),
150     &            dwl(npro,nenl)
151c
152        real*8    xSebe(npro,nshl,nshl),      xmudmi(npro,ngauss)
153c
154c.... gather the variables
155c
156        real*8 sgn(npro,nshl)
157c
158c.... get the matrix of mode signs for the hierarchic basis functions.
159c
160        if (ipord .gt. 1) then
161           call getsgn(ien,sgn)
162        endif
163
164        call localy(y,      yl,     ien,    ndofl,  'gather  ')
165        call localy(ac,    acl,     ien,    ndofl,  'gather  ')
166        call localx(x,      xl,     ien,    nsd,    'gather  ')
167        if(iRANS.lt. 0)
168     &  call localx(d2wall, dwl,    ien,    1,      'gather  ')
169        call local (qres,   ql,     ien,    nsd,    'gather  ')
170c
171c.... zero the matrices if they are being recalculated
172c
173        if (lhs. eq. 1)  then
174           xSebe = zero
175        endif
176c
177c.... get the element residuals, LHS matrix, and preconditioner
178c
179      rl = zero
180      call e3Sclr  (yl,      acl,     shp,
181     &              shgl,    xl,      dwl,
182     &              rl,      ql,      xSebe,
183     &              sgn, xmudmi)
184c
185c.... assemble the residual
186c
187        call local (res,    rl,     ien,    1,  'scatter ')
188c
189c.... end
190c
191        return
192        end
193