xref: /phasta/phSolver/incompressible/asiqGradV.f (revision 595995161822a203c8467e0e4a253d7bd7d6df32)
1        subroutine AsIqGradV (y,       x,       shp,
2     &                   shgl,    ien,
3     &                   qres )
4c
5c----------------------------------------------------------------------
6c
7c This routine computes and assembles the data corresponding to the
8c interior elements for the global reconstruction of the diffusive
9c flux vector.
10c
11c input:
12c     y     (numnp,ndof)        : Y variables
13c     x     (numnp,nsd)         : nodal coordinates
14c     shp   (nen,nintg)         : element shape-functions
15c     shgl  (nsd,nen,nintg)     : element local shape-function gradients
16c     ien   (npro)              : nodal connectivity array
17c
18c output:
19c     qres  (numnp,nsd,nsd)  : residual vector for diffusive flux
20c
21c----------------------------------------------------------------------
22c
23        include "common.h"
24c
25        dimension y(nshg,ndof),               x(numnp,nsd),
26     &            shp(nshl,ngauss),         shgl(nsd,nshl,ngauss),
27     &            ien(npro,nshl),
28     &            qres(nshg,nsdsq)
29c
30        dimension yl(npro,nshl,ndof),          xl(npro,nenl,nsd),
31     &            ql(npro,nshl,nsdsq)
32c
33        dimension sgn(npro,nshl)
34c
35c.... create the matrix of mode signs for the hierarchic basis
36c     functions.
37c
38        do i=1,nshl
39           where ( ien(:,i) < 0 )
40              sgn(:,i) = -one
41           elsewhere
42              sgn(:,i) = one
43           endwhere
44        enddo
45
46c
47c.... gather the variables
48c
49
50        call localy(y,      yl,     ien,    ndof,   'gather  ')
51        call localx (x,      xl,     ien,    nsd,    'gather  ')
52c
53c.... get the element residuals
54c
55        ql     = zero
56
57        call e3qGradV  (yl,         shp,      shgl,
58     &             xl,         ql,
59     &             sgn  )
60
61c
62c.... assemble the diffusive flux residual
63c
64        call local (qres,   ql,  ien,  nsdsq,  'scatter ')
65c
66c.... end
67c
68        return
69        end
70
71